From 5841a0249b1a515842e232ca7f24058d65fed510 Mon Sep 17 00:00:00 2001 From: Philipp Grete Date: Wed, 7 Aug 2024 18:01:42 +0200 Subject: [PATCH] Add boost factor --- src/hydro/hydro.cpp | 3 +++ src/hydro/srcterms/tabular_cooling.cpp | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hydro/hydro.cpp b/src/hydro/hydro.cpp index 985c7b15..cf152aeb 100644 --- a/src/hydro/hydro.cpp +++ b/src/hydro/hydro.cpp @@ -723,6 +723,9 @@ std::shared_ptr Initialize(ParameterInput *pin) { } pkg->AddParam<>("heating/type", heating_str); + const auto heating_boost = pin->GetOrAddReal("heating", "boost", 1.0); + pkg->AddParam<>("heating/boost", heating_boost); + auto scratch_level = pin->GetOrAddInteger("hydro", "scratch_level", 0); pkg->AddParam("scratch_level", scratch_level); diff --git a/src/hydro/srcterms/tabular_cooling.cpp b/src/hydro/srcterms/tabular_cooling.cpp index 086b5dd3..6d79f952 100644 --- a/src/hydro/srcterms/tabular_cooling.cpp +++ b/src/hydro/srcterms/tabular_cooling.cpp @@ -611,6 +611,7 @@ void TabularCooling::TownsendSrcTerm(parthenon::MeshData *md, "Given MPI reduction need to handle one MeshData container " "per rank (i.e., pack_size=-1)."); + const auto heating_boost = hydro_pkg->Param("heating/boost"); // this this is becoming more complex (or in other parts of the code), introduce enum // classes int heating_type = -1; @@ -636,11 +637,11 @@ void TabularCooling::TownsendSrcTerm(parthenon::MeshData *md, if (heating_type == 1) { // TODO(pgrete) this indirectly is 1/dv * deltaE * dV/V // but V = 1 for standard turb driver and dv is cancelled - cons(IEN, k, j, i) -= total_deltaE; + cons(IEN, k, j, i) -= heating_boost * total_deltaE; } else if (heating_type == 2) { // TODO(pgrete) this indirectly is 1/dv * deltaE * m/M // but M = 1 for standard turb driver - cons(IEN, k, j, i) -= rho * total_deltaE; + cons(IEN, k, j, i) -= heating_boost * rho * total_deltaE; } // TODO(pgrete) with potentially more EOS, a separate get_pressure (or similar) // function could be useful.