Skip to content

Commit

Permalink
Time step in the AmrLevel test (AMReX-Codes#2763)
Browse files Browse the repository at this point in the history
Make the dt in the AmrLevel test consistent with that in the AmrCore Test.
That is we use the velocity at t+0.5*dt (here dt is from the previous step)
to estimate the dt for the next step.
  • Loading branch information
WeiqunZhang authored and kngott committed May 19, 2022
1 parent 60a5547 commit 45f9617
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Tests/Amr/Advection_AmrLevel/Source/AmrLevelAdv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,10 @@ AmrLevelAdv::estTimeStep (Real)
GpuArray<Real,BL_SPACEDIM> prob_lo = geom.ProbLoArray();
const Real cur_time = state[Phi_Type].curTime();
const MultiFab& S_new = get_new_data(Phi_Type);
Real pred_time = cur_time;
if (cur_time > 0._rt) {
pred_time += 0.5_rt*parent->dtLevel(level);
}

#ifdef AMREX_USE_OMP
#pragma omp parallel reduction(min:dt_est)
Expand All @@ -431,7 +435,7 @@ AmrLevelAdv::estTimeStep (Real)
// Note: no need to set elixir on uface[i] temporary fabs since
// norm<RunOn::Device> kernel launch is blocking.

get_face_velocity(cur_time,
get_face_velocity(pred_time,
AMREX_D_DECL(uface[0], uface[1], uface[2]),
dx, prob_lo);

Expand Down

0 comments on commit 45f9617

Please sign in to comment.