diff --git a/Exec/science/flame_wave/ci-benchmarks/job_info_params.txt b/Exec/science/flame_wave/ci-benchmarks/job_info_params.txt index 127b5bcb64..252b98a482 100644 --- a/Exec/science/flame_wave/ci-benchmarks/job_info_params.txt +++ b/Exec/science/flame_wave/ci-benchmarks/job_info_params.txt @@ -54,9 +54,9 @@ castro.plm_limiter = 2 castro.hybrid_riemann = 0 castro.riemann_solver = 0 - castro.cg_maxiter = 12 - castro.cg_tol = 1e-05 - castro.cg_blend = 2 + castro.riemann_shock_maxiter = 12 + castro.riemann_pstar_tol = 1e-05 + castro.riemann_cg_blend = 2 castro.use_flattening = 1 castro.transverse_use_eos = 0 castro.transverse_reset_density = 1 diff --git a/Exec/science/wdmerger/inputs b/Exec/science/wdmerger/inputs index 5def509a0d..f9b22104b2 100644 --- a/Exec/science/wdmerger/inputs +++ b/Exec/science/wdmerger/inputs @@ -188,7 +188,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor b/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor index 2ff2712602..a7028d1544 100644 --- a/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor +++ b/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor @@ -200,7 +200,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_simp_sdc b/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_simp_sdc index db97ad3dac..6316753695 100644 --- a/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_simp_sdc +++ b/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_simp_sdc @@ -206,7 +206,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_strang b/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_strang index a57a028d0d..b56d9ba2a5 100644 --- a/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_strang +++ b/Exec/science/wdmerger/tests/he_double_det/inputs_pakmor_strang @@ -206,7 +206,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Exec/science/wdmerger/tests/he_double_det/inputs_scaling b/Exec/science/wdmerger/tests/he_double_det/inputs_scaling index 03c95c1636..990c81fd2a 100644 --- a/Exec/science/wdmerger/tests/he_double_det/inputs_scaling +++ b/Exec/science/wdmerger/tests/he_double_det/inputs_scaling @@ -203,7 +203,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Exec/science/wdmerger/tests/wdmerger_collision/inputs_2d_collision b/Exec/science/wdmerger/tests/wdmerger_collision/inputs_2d_collision index 8a2bca0293..60a7db22d6 100644 --- a/Exec/science/wdmerger/tests/wdmerger_collision/inputs_2d_collision +++ b/Exec/science/wdmerger/tests/wdmerger_collision/inputs_2d_collision @@ -153,7 +153,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Exec/science/wdmerger/tests/wdmerger_collision_1D/inputs b/Exec/science/wdmerger/tests/wdmerger_collision_1D/inputs index 6dcabf249c..9f40085682 100644 --- a/Exec/science/wdmerger/tests/wdmerger_collision_1D/inputs +++ b/Exec/science/wdmerger/tests/wdmerger_collision_1D/inputs @@ -142,7 +142,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Exec/science/wdmerger/tests/wdmerger_retry/inputs_test_wdmerger_retry b/Exec/science/wdmerger/tests/wdmerger_retry/inputs_test_wdmerger_retry index 0d63ab606c..a6eef171b3 100644 --- a/Exec/science/wdmerger/tests/wdmerger_retry/inputs_test_wdmerger_retry +++ b/Exec/science/wdmerger/tests/wdmerger_retry/inputs_test_wdmerger_retry @@ -133,7 +133,7 @@ castro.riemann_solver = 0 # For the CG Riemann solver, we need to tell the solver not to quit when # the iterations don't converge, but instead to do additional bisection iteration. -castro.cg_blend = 2 +castro.riemann_cg_blend = 2 # Use a lagged predictor estimate of the source terms in the hydro castro.source_term_predictor = 1 diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index d79f4d4935..f478f8402d 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -392,12 +392,12 @@ Castro::read_params () #endif if (riemann_solver == 1) { - if (cg_maxiter > HISTORY_SIZE) { - amrex::Error("error in riemanncg: cg_maxiter > HISTORY_SIZE"); + if (riemann_shock_maxiter > HISTORY_SIZE) { + amrex::Error("riemann_shock_maxiter > HISTORY_SIZE"); } - if (cg_blend == 2 && cg_maxiter < 5) { - amrex::Error("Error: need cg_maxiter >= 5 to do a bisection search on secant iteration failure."); + if (riemann_cg_blend == 2 && riemann_shock_maxiter < 5) { + amrex::Error("Error: need riemann_shock_maxiter >= 5 to do a bisection search on secant iteration failure."); } } #endif diff --git a/Source/driver/_cpp_parameters b/Source/driver/_cpp_parameters index a342478def..f5cdc29bd3 100644 --- a/Source/driver/_cpp_parameters +++ b/Source/driver/_cpp_parameters @@ -114,20 +114,19 @@ hybrid_riemann bool 0 # 2: HLLC riemann_solver int 0 -# for the Colella \& Glaz Riemann solver, the maximum number -# of iterations to take when solving for the star state -cg_maxiter int 12 +# maximum number of iterations to used in the Riemann solver +# when solving for the star state +riemann_shock_maxiter int 12 -# for the Colella \& Glaz Riemann solver, the tolerance to -# demand in finding the star state -cg_tol Real 1.0e-5 +# tolerance to use when finding the star stat +riemann_pstar_tol Real 1.0e-5 # for the Colella \& Glaz Riemann solver, what to do if # we do not converge to a solution for the star state. # 0 = do nothing; print iterations and exit # 1 = revert to the original guess for p-star -# 2 = do a bisection search for another 2 * cg_maxiter iterations. -cg_blend int 2 +# 2 = do a bisection search for another 2 * riemann_shock_maxiter iterations. +riemann_cg_blend int 2 # flatten the reconstructed profiles around shocks to prevent them # from becoming too thin diff --git a/Source/hydro/riemann_2shock_solvers.H b/Source/hydro/riemann_2shock_solvers.H index 208e9878e0..f81b495f29 100644 --- a/Source/hydro/riemann_2shock_solvers.H +++ b/Source/hydro/riemann_2shock_solvers.H @@ -58,7 +58,7 @@ namespace TwoShock { const amrex::Real ur, const amrex::Real pr, const amrex::Real taur, const amrex::Real gamer, const amrex::Real clsqr, const amrex::Real gdot, const amrex::Real gmin, const amrex::Real gmax, - const int lcg_maxiter, const amrex::Real lcg_tol, + const int lriemann_shock_maxiter, const amrex::Real lriemann_pstar_tol, amrex::Real& pstar, amrex::Real& gamstar, bool& converged, amrex::GpuArray& pstar_hist_extra) { @@ -106,7 +106,7 @@ namespace TwoShock { converged = false; amrex::Real pstar_c = 0.0; - for (int iter = 0; iter < PSTAR_BISECT_FACTOR*lcg_maxiter; iter++) { + for (int iter = 0; iter < PSTAR_BISECT_FACTOR * lriemann_shock_maxiter; iter++) { pstar_c = 0.5_rt * (pstar_lo + pstar_hi); pstar_hist_extra[iter] = pstar_c; @@ -125,7 +125,7 @@ namespace TwoShock { amrex::Real f_c = ustar_l - ustar_r; - if ( 0.5_rt * std::abs(pstar_lo - pstar_hi) < lcg_tol * pstar_c ) { + if ( 0.5_rt * std::abs(pstar_lo - pstar_hi) < lriemann_pstar_tol * pstar_c ) { converged = true; break; } @@ -239,7 +239,7 @@ namespace TwoShock { bool converged = false; int iter = 0; - while ((iter < cg_maxiter && !converged) || iter < 2) { + while ((iter < riemann_shock_maxiter && !converged) || iter < 2) { wsqge(ql.p, taul, gamel, gdot, gamstar, gmin, gmax, clsql, pstar, wlsq); @@ -281,7 +281,7 @@ namespace TwoShock { pstar = amrex::max(pstar, small_pres); amrex::Real err = std::abs(pstar - pstar_old); - if (err < cg_tol*pstar) { + if (err < riemann_pstar_tol * pstar) { converged = true; } @@ -300,11 +300,11 @@ namespace TwoShock { if (!converged) { - if (cg_blend == 0) { + if (riemann_cg_blend == 0) { #ifndef AMREX_USE_GPU std::cout << "pstar history: " << std::endl; - for (int iter_l=0; iter_l < cg_maxiter; iter_l++) { + for (int iter_l=0; iter_l < riemann_shock_maxiter; iter_l++) { std::cout << iter_l << " " << pstar_hist[iter_l] << std::endl; } @@ -316,11 +316,11 @@ namespace TwoShock { amrex::Error("ERROR: non-convergence in the Riemann solver"); #endif - } else if (cg_blend == 1) { + } else if (riemann_cg_blend == 1) { pstar = ql.p + ( (qr.p - ql.p) - wr * (qr.un - ql.un) ) * wl / (wl + wr); - } else if (cg_blend == 2) { + } else if (riemann_cg_blend == 2) { // we don't store the history if we are in CUDA, so // we can't do this @@ -328,7 +328,7 @@ namespace TwoShock { // first try to find a reasonable bounds amrex::Real pstarl = 1.e200; amrex::Real pstaru = -1.e200; - for (int n = cg_maxiter-6; n < cg_maxiter; n++) { + for (int n = riemann_shock_maxiter-6; n < riemann_shock_maxiter; n++) { pstarl = amrex::min(pstarl, pstar_hist[n]); pstaru = amrex::max(pstaru, pstar_hist[n]); } @@ -342,17 +342,17 @@ namespace TwoShock { ql.un, ql.p, taul, gamel, clsql, qr.un, qr.p, taur, gamer, clsqr, gdot, gmin, gmax, - cg_maxiter, cg_tol, + riemann_shock_maxiter, riemann_pstar_tol, pstar, gamstar, converged, pstar_hist_extra); if (!converged) { std::cout << "pstar history: " << std::endl; - for (int iter_l = 0; iter_l < cg_maxiter; iter_l++) { + for (int iter_l = 0; iter_l < riemann_shock_maxiter; iter_l++) { std::cout << iter_l << " " << pstar_hist[iter_l] << std::endl; } std::cout << "pstar extra history: " << std::endl; - for (int iter_l = 0; iter_l < PSTAR_BISECT_FACTOR*cg_maxiter; iter_l++) { + for (int iter_l = 0; iter_l < PSTAR_BISECT_FACTOR * riemann_shock_maxiter; iter_l++) { std::cout << iter_l << " " << pstar_hist_extra[iter_l] << std::endl; } @@ -368,7 +368,7 @@ namespace TwoShock { } else { #ifndef AMREX_USE_GPU - amrex::Error("ERROR: unrecognized cg_blend option."); + amrex::Error("ERROR: unrecognized riemann_cg_blend option."); #endif }