From fdb8336ada0abd169b2103eaf0d4be318e1d1700 Mon Sep 17 00:00:00 2001 From: "Aaron M. Lattanzi" <103702284+AMLattanzi@users.noreply.github.com> Date: Mon, 9 Dec 2024 09:38:44 -0800 Subject: [PATCH] Base number of substeps on a theoretical max. (#2007) * Base number of substeps on a theoretical max. * Update based upon slack convo. * Make failing tests use 6 substeps. --- Source/TimeIntegration/ERF_ComputeTimestep.cpp | 4 +++- Tests/test_files/ABL_InflowFile/ABL_InflowFile.i | 1 + .../MSF_Sub_IsentropicVortexAdv/MSF_Sub_IsentropicVortexAdv.i | 3 ++- Tests/test_files/TaylorGreenAdvecting/TaylorGreenAdvecting.i | 2 +- .../TaylorGreenAdvectingDiffusing.i | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Source/TimeIntegration/ERF_ComputeTimestep.cpp b/Source/TimeIntegration/ERF_ComputeTimestep.cpp index 28131b92a..96f37c1e4 100644 --- a/Source/TimeIntegration/ERF_ComputeTimestep.cpp +++ b/Source/TimeIntegration/ERF_ComputeTimestep.cpp @@ -201,7 +201,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( fixed_dt[level] / fixed_fast_dt[level] ); } else if (fixed_dt[level] > 0.) { - dt_fast_ratio = static_cast( 6 ); + // Max CFL_c = 1.0 for substeps, but we enforce a min of 4 substeps + auto dt_sub_max = (estdt_comp/cfl); + dt_fast_ratio = static_cast( std::max(fixed_dt[level]/dt_sub_max,4.) ); } // Force time step ratio to be an even value diff --git a/Tests/test_files/ABL_InflowFile/ABL_InflowFile.i b/Tests/test_files/ABL_InflowFile/ABL_InflowFile.i index c75440cc7..4dbd8ea80 100644 --- a/Tests/test_files/ABL_InflowFile/ABL_InflowFile.i +++ b/Tests/test_files/ABL_InflowFile/ABL_InflowFile.i @@ -28,6 +28,7 @@ zhi.type = "SlipWall" # TIME STEP CONTROL erf.fixed_dt = 0.1 # fixed time step depending on grid resolution +erf.fixed_mri_dt_ratio = 6 # DIAGNOSTICS & VERBOSITY erf.sum_interval = 1 # timesteps between computing mass diff --git a/Tests/test_files/MSF_Sub_IsentropicVortexAdv/MSF_Sub_IsentropicVortexAdv.i b/Tests/test_files/MSF_Sub_IsentropicVortexAdv/MSF_Sub_IsentropicVortexAdv.i index ce102ecca..46763bf72 100644 --- a/Tests/test_files/MSF_Sub_IsentropicVortexAdv/MSF_Sub_IsentropicVortexAdv.i +++ b/Tests/test_files/MSF_Sub_IsentropicVortexAdv/MSF_Sub_IsentropicVortexAdv.i @@ -20,7 +20,8 @@ zhi.type = "SlipWall" # TIME STEP CONTROL erf.substepping_type = Implicit erf.fixed_dt = 0.0003 - +erf.fixed_mri_dt_ratio = 6 + # DIAGNOSTICS & VERBOSITY erf.sum_interval = 1 # timesteps between computing mass erf.v = 1 # verbosity in ERF.cpp diff --git a/Tests/test_files/TaylorGreenAdvecting/TaylorGreenAdvecting.i b/Tests/test_files/TaylorGreenAdvecting/TaylorGreenAdvecting.i index 49ba19cff..c9e553a21 100644 --- a/Tests/test_files/TaylorGreenAdvecting/TaylorGreenAdvecting.i +++ b/Tests/test_files/TaylorGreenAdvecting/TaylorGreenAdvecting.i @@ -15,7 +15,7 @@ zhi.type = "SlipWall" # TIME STEP CONTROL erf.fixed_dt = 0.16 # fixed time step -erf.mri_fixed_dt_ratio = 4 +erf.fixed_mri_dt_ratio = 6 # DIAGNOSTICS & VERBOSITY erf.sum_interval = 1 # timesteps between computing mass diff --git a/Tests/test_files/TaylorGreenAdvectingDiffusing/TaylorGreenAdvectingDiffusing.i b/Tests/test_files/TaylorGreenAdvectingDiffusing/TaylorGreenAdvectingDiffusing.i index fc44afc6b..81f64b4b7 100644 --- a/Tests/test_files/TaylorGreenAdvectingDiffusing/TaylorGreenAdvectingDiffusing.i +++ b/Tests/test_files/TaylorGreenAdvectingDiffusing/TaylorGreenAdvectingDiffusing.i @@ -15,7 +15,7 @@ zhi.type = "SlipWall" # TIME STEP CONTROL erf.fixed_dt = .16 # fixed time step -erf.mri_fixed_dt_ratio = 4 +erf.fixed_mri_dt_ratio = 6 # DIAGNOSTICS & VERBOSITY erf.sum_interval = 1 # timesteps between computing mass