Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add erf.substepping_cfl param #2024

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,12 @@ List of Parameters
| **erf.no_substepping** | Should we turn off | int (0 or 1) | 0 |
| | substepping in time? | | |
+----------------------------+----------------------+----------------+-------------------+
| **erf.cfl** | CFL number for | Real > 0 and | 0.8 |
| | hydro | <= 1 | |
| | | | |
| | | | |
| **erf.cfl** | CFL number used to | Real > 0 and | 0.8 |
| | compute level 0 dt | <= 1 | |
+----------------------------+----------------------+----------------+-------------------+
| **erf.substepping_cfl** | CFL number used to | Real > 0 and | 1.0 |
| | compute the number | <= 1 | |
| | of substeps | | |
+----------------------------+----------------------+----------------+-------------------+
| **erf.fixed_dt** | set level 0 dt | Real > 0 | unused if not |
| | as this value | | set |
Expand Down
1 change: 1 addition & 0 deletions Source/ERF.H
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ private:

// Time step controls
static amrex::Real cfl;
static amrex::Real sub_cfl;
static amrex::Real init_shrink;
static amrex::Real change_max;

Expand Down
2 changes: 2 additions & 0 deletions Source/ERF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SolverChoice ERF::solverChoice;

// Time step control
Real ERF::cfl = 0.8;
Real ERF::sub_cfl = 1.0;
Real ERF::init_shrink = 1.0;
Real ERF::change_max = 1.1;
int ERF::fixed_mri_dt_ratio = 0;
Expand Down Expand Up @@ -1455,6 +1456,7 @@ ERF::ReadParameters ()

// Time step controls
pp.query("cfl", cfl);
pp.query("substepping_cfl", sub_cfl);
pp.query("init_shrink", init_shrink);
pp.query("change_max", change_max);

Expand Down
5 changes: 3 additions & 2 deletions Source/TimeIntegration/ERF_ComputeTimestep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ ERF::estTimeStep (int level, long& dt_fast_ratio) const
if (fixed_dt[level] > 0. && fixed_fast_dt[level] > 0.) {
dt_fast_ratio = static_cast<long>( fixed_dt[level] / fixed_fast_dt[level] );
} else if (fixed_dt[level] > 0.) {
// Max CFL_c = 1.0 for substeps, but we enforce a min of 4 substeps
auto dt_sub_max = (estdt_comp/cfl);
// Max CFL_c = 1.0 for substeps by default, but we enforce a min of 4 substeps
auto dt_sub_max = (estdt_comp/cfl * sub_cfl);
Print() << "fixed_dt="<<fixed_dt[level] << " dt_sub_max="<<dt_sub_max << std::endl;
dt_fast_ratio = static_cast<long>( std::max(fixed_dt[level]/dt_sub_max,4.) );
}

Expand Down
Loading