#include <AMReX_Algorithm.H>
#include <AMReX_BoxArray.H>
#include <AMReX_REAL.H>
Go to the source code of this file.
◆ FixedDtCFLLimitValue()
| double FixedDtCFLLimitValue |
( |
double |
cfl | ) |
|
|
inline |
Courant number a fixed step may not exceed (erf-model/ERF#5238): min(erf.cfl, 0.8). An erf.cfl below 0.8 is honored; a larger one is capped at 0.8, a margin below the stability limit.
- Parameters
-
18 return amrex::min(cfl, 0.8);
Referenced by ERF::CheckFixedDtCFLLimit(), and FixedDtCFLScale().
◆ FixedDtCFLScale()
| double FixedDtCFLScale |
( |
double |
fixed_dt, |
|
|
double |
cfl_rate, |
|
|
double |
cfl |
|
) |
| |
|
inline |
Factor by which to scale erf.fixed_dt (and erf.fixed_fast_dt) on a level so that the fixed step respects the CFL limit (erf-model/ERF#5238). The fixed step exceeds the limit when its Courant number fixed_dt * cfl_rate is above FixedDtCFLLimitValue(erf.cfl) = min(erf.cfl, 0.8), and is then scaled to exactly that Courant number, so the scaled step is continuous in the Courant number. Returns 1 when the fixed step is within the limit, or when there is no fixed step, no CFL limit (cfl <= 0) or no constraining rate on the level.
- Parameters
-
| [in] | fixed_dt | fixed time step of the level |
| [in] | cfl_rate | inverse time step at a Courant number of one on the level (the rate the adaptive dt of estTimeStep is based on) |
| [in] | cfl | erf.cfl |
37 if (fixed_dt <= 0.0 || cfl_rate <= 0.0 || cfl <= 0.0) {
return 1.0; }
39 const double courant = fixed_dt * cfl_rate;
41 if (courant <= limit * (1.0 + 1.e-10)) {
return 1.0; }
42 return limit / courant;
double FixedDtCFLLimitValue(double cfl)
Definition: ERF_FixedDtCFLLimit.H:16
Referenced by ERF::CheckFixedDtCFLLimit().
◆ FixedDtSameCells()
| bool FixedDtSameCells |
( |
const amrex::BoxArray & |
a, |
|
|
const amrex::BoxArray & |
b |
|
) |
| |
|
inline |
Whether two sets of grids cover the same cells, whatever their box layout. A level whose grids only change layout (re-chopped by a new amr.max_grid_size or rank count, as a restart may do) keeps the CFL check of a fixed dt it had, so the dt does not depend on the layout and a restart takes the steps the uninterrupted run takes (erf-model/ERF#5238, #5228).
- Parameters
-
| [in] | a | grids the CFL limit was last checked on |
| [in] | b | current grids |
57 if (a == b) {
return true; }
59 return a.numPts() == b.numPts() && (a.empty() || a.contains(b,
true));
Referenced by ERF::CheckFixedDtCFLLimit(), and ERF::CheckFixedDtCFLLimitAfterRegrid().