Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for Hydrodynamic Clusters #92

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/pgen/cluster/agn_feedback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,6 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData<parthenon::Real> *md,
///////////////////////////////////////////////////////////////////

eos.ConsToPrim(cons, prim, nhydro, nscalars, k, j, i);
const Real old_specific_internal_e =
prim(IPR, k, j, i) / (prim(IDN, k, j, i) * (eos.GetGamma() - 1.));

cons(IDN, k, j, i) += jet_density;
cons(IM1, k, j, i) += jet_momentum * sign_jet * jet_axis_x;
Expand All @@ -379,12 +377,6 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData<parthenon::Real> *md,
}

eos.ConsToPrim(cons, prim, nhydro, nscalars, k, j, i);
const Real new_specific_internal_e =
prim(IPR, k, j, i) / (prim(IDN, k, j, i) * (eos.GetGamma() - 1.));
PARTHENON_REQUIRE(
new_specific_internal_e > jet_specific_internal_e ||
new_specific_internal_e > old_specific_internal_e,
"Kinetic injection leads to temperature below jet and existing gas");
}

// Apply velocity ceiling
Expand Down
3 changes: 2 additions & 1 deletion src/pgen/cluster/cluster_clips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void ApplyClusterClips(MeshData<Real> *md, const parthenon::SimTime &tm,
const Real vAceil2 = SQR(vAceil);
const Real gm1 = (hydro_pkg->Param<Real>("AdiabaticIndex") - 1.0);

const bool magnetic_fields = (hydro_pkg->Param<Fluid>("fluid") == Fluid::glmmhd);
Real added_dfloor_mass = 0.0, removed_vceil_energy = 0.0, added_vAceil_mass = 0.0,
removed_eceil_energy = 0.0;

Expand Down Expand Up @@ -123,7 +124,7 @@ void ApplyClusterClips(MeshData<Real> *md, const parthenon::SimTime &tm,
}
}

if (vAceil2 < std::numeric_limits<Real>::infinity()) {
if (magnetic_fields && vAceil2 < std::numeric_limits<Real>::infinity()) {
// Apply Alfven velocity ceiling by raising density
const Real rho = prim(IDN, k, j, i);
const Real B2 = (SQR(prim(IB1, k, j, i)) + SQR(prim(IB2, k, j, i)) +
Expand Down
Loading