From f9703e7476ab45f5101019efa0f49d603c804d08 Mon Sep 17 00:00:00 2001 From: Forrest Glines Date: Wed, 22 Nov 2023 16:19:21 -0500 Subject: [PATCH 1/4] Hydro fix in cluster_clips --- src/pgen/cluster/cluster_clips.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pgen/cluster/cluster_clips.cpp b/src/pgen/cluster/cluster_clips.cpp index 5aa86eea..3b11227f 100644 --- a/src/pgen/cluster/cluster_clips.cpp +++ b/src/pgen/cluster/cluster_clips.cpp @@ -70,6 +70,7 @@ void ApplyClusterClips(MeshData *md, const parthenon::SimTime &tm, const Real vAceil2 = SQR(vAceil); const Real gm1 = (hydro_pkg->Param("AdiabaticIndex") - 1.0); + const bool magnetic_fields = (hydro_pkg->Param("fluid") == Fluid::glmmhd); Real added_dfloor_mass = 0.0, removed_vceil_energy = 0.0, added_vAceil_mass = 0.0, removed_eceil_energy = 0.0; @@ -123,7 +124,7 @@ void ApplyClusterClips(MeshData *md, const parthenon::SimTime &tm, } } - if (vAceil2 < std::numeric_limits::infinity()) { + if (magnetic_fields && vAceil2 < std::numeric_limits::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)) + From 73cc819190dfac9e44f7aa444acf304279d53c46 Mon Sep 17 00:00:00 2001 From: Forrest Glines Date: Wed, 22 Nov 2023 17:16:11 -0500 Subject: [PATCH 2/4] Disable kinetic injection temperature assert --- src/pgen/cluster/agn_feedback.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/pgen/cluster/agn_feedback.cpp b/src/pgen/cluster/agn_feedback.cpp index bcf63c24..7ef1f848 100644 --- a/src/pgen/cluster/agn_feedback.cpp +++ b/src/pgen/cluster/agn_feedback.cpp @@ -361,8 +361,8 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData *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.)); + //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; @@ -379,12 +379,13 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData *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"); + //We're + //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 From 97a364658ec301e920742750b510c02bffe3418d Mon Sep 17 00:00:00 2001 From: par-hermes Date: Wed, 22 Nov 2023 22:20:08 +0000 Subject: [PATCH 3/4] cpp-py-formatter --- src/pgen/cluster/agn_feedback.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pgen/cluster/agn_feedback.cpp b/src/pgen/cluster/agn_feedback.cpp index 7ef1f848..40bc0123 100644 --- a/src/pgen/cluster/agn_feedback.cpp +++ b/src/pgen/cluster/agn_feedback.cpp @@ -361,7 +361,7 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData *md, /////////////////////////////////////////////////////////////////// eos.ConsToPrim(cons, prim, nhydro, nscalars, k, j, i); - //const Real old_specific_internal_e = + // 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; @@ -379,10 +379,10 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData *md, } eos.ConsToPrim(cons, prim, nhydro, nscalars, k, j, i); - //We're - //const Real new_specific_internal_e = + // We're + // const Real new_specific_internal_e = // prim(IPR, k, j, i) / (prim(IDN, k, j, i) * (eos.GetGamma() - 1.)); - //PARTHENON_REQUIRE( + // 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"); From f1aca4ba9c4dd2470c418c6253aae437b472d66a Mon Sep 17 00:00:00 2001 From: Forrest Glines Date: Wed, 22 Nov 2023 17:22:45 -0500 Subject: [PATCH 4/4] Remove commented out code --- src/pgen/cluster/agn_feedback.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/pgen/cluster/agn_feedback.cpp b/src/pgen/cluster/agn_feedback.cpp index 40bc0123..7523f663 100644 --- a/src/pgen/cluster/agn_feedback.cpp +++ b/src/pgen/cluster/agn_feedback.cpp @@ -361,8 +361,6 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData *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; @@ -379,13 +377,6 @@ void AGNFeedback::FeedbackSrcTerm(parthenon::MeshData *md, } eos.ConsToPrim(cons, prim, nhydro, nscalars, k, j, i); - // We're - // 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