Skip to content

Commit

Permalink
add error check on pressure matching for Manifold EOS (#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
baperry2 authored Dec 13, 2024
1 parent 55ef5eb commit 94f2784
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
1 change: 1 addition & 0 deletions Source/PeleLMeX.H
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ public:
* parameters.
*/
void checkRunParams();
void checkSetupParams();

//-----------------------------------------------------------------------------
// REGRID / LOAD BALANCE
Expand Down
32 changes: 25 additions & 7 deletions Source/PeleLMeX_Setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ PeleLM::Setup()

// Initialize active control
initActiveControl();

// Check setup parameters
checkSetupParams();
}

void
Expand Down Expand Up @@ -748,6 +751,18 @@ PeleLM::readParameters()
}
#endif

// -----------------------------------------
// External Sources
// -----------------------------------------
m_user_defined_ext_sources = false;
m_ext_sources_SDC = false; // TODO: add capability to update ext_srcs in SDC
pp.query("user_defined_ext_sources", m_user_defined_ext_sources);
}

void
PeleLM::checkSetupParams()
{
BL_PROFILE("PeleLMeX::checkSetupParams()");
// Ensure unsupported physics is not used with manifiold models
if (pele::physics::PhysicsType::eos_type::identifier() == "Manifold") {
if (m_closed_chamber != 0) {
Expand All @@ -772,15 +787,18 @@ PeleLM::readParameters()
#endif
#ifdef PELE_USE_EFIELD
amrex::Abort("Efield models are not yet supported for Manifold EOS");
#endif
#ifdef USE_MANIFOLD_EOS
if (
std::abs(
(0.1 * eos_parms.host_parm().Pnom_cgs - prob_parm->P_mean) /
prob_parm->P_mean) > 1e-6) {
amrex::Abort("For Manifold EOS, pressure in manifold model "
"(manifold.nominal_pressure_cgs) and pressure in PeleLMeX "
"(prob.Pmean) must match");
}
#endif
}

// -----------------------------------------
// External Sources
// -----------------------------------------
m_user_defined_ext_sources = false;
m_ext_sources_SDC = false; // TODO: add capability to update ext_srcs in SDC
pp.query("user_defined_ext_sources", m_user_defined_ext_sources);
}

void
Expand Down

0 comments on commit 94f2784

Please sign in to comment.