From fcb5f397aca9032410050da03d45985148cd91a3 Mon Sep 17 00:00:00 2001 From: Philipp Grete Date: Sun, 10 Nov 2024 12:47:59 +0100 Subject: [PATCH] Ensure c_h is present --- src/hydro/hydro.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/hydro/hydro.cpp b/src/hydro/hydro.cpp index 4e2e5eec..5720346c 100644 --- a/src/hydro/hydro.cpp +++ b/src/hydro/hydro.cpp @@ -217,14 +217,17 @@ std::shared_ptr Initialize(ParameterInput *pin) { auto glmmhd_alpha = pin->GetOrAddReal("hydro", "glmmhd_alpha", 0.1); pkg->AddParam("glmmhd_alpha", glmmhd_alpha); calc_c_h = true; - pkg->AddParam( - "c_h", 0.0, Params::Mutability::Restart); // hyperbolic divergence cleaning speed } else { PARTHENON_FAIL("AthenaPK hydro: Unknown fluid method."); } pkg->AddParam<>("fluid", fluid); pkg->AddParam<>("nhydro", nhydro); pkg->AddParam<>("calc_c_h", calc_c_h); + // Following params should (currently) be present independent of solver because + // they're all used in the main loop. + // TODO(pgrete) think about which approach (selective versus always is preferable) + pkg->AddParam( + "c_h", 0.0, Params::Mutability::Restart); // hyperbolic divergence cleaning speed // global minimum dx (used to calc c_h) pkg->AddParam("mindx", std::numeric_limits::max(), Params::Mutability::Restart);