Skip to content

Commit

Permalink
Add boost factor
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Aug 7, 2024
1 parent 73c176b commit 5841a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/hydro/hydro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@ std::shared_ptr<StateDescriptor> 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);

Expand Down
5 changes: 3 additions & 2 deletions src/hydro/srcterms/tabular_cooling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ void TabularCooling::TownsendSrcTerm(parthenon::MeshData<parthenon::Real> *md,
"Given MPI reduction need to handle one MeshData container "
"per rank (i.e., pack_size=-1).");

const auto heating_boost = hydro_pkg->Param<Real>("heating/boost");
// this this is becoming more complex (or in other parts of the code), introduce enum
// classes
int heating_type = -1;
Expand All @@ -636,11 +637,11 @@ void TabularCooling::TownsendSrcTerm(parthenon::MeshData<parthenon::Real> *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.
Expand Down

0 comments on commit 5841a02

Please sign in to comment.