From 94f27844dadb6d648a80f956da05543ab8212b62 Mon Sep 17 00:00:00 2001 From: Bruce Perry Date: Fri, 13 Dec 2024 16:07:26 -0700 Subject: [PATCH] add error check on pressure matching for Manifold EOS (#448) --- Source/PeleLMeX.H | 1 + Source/PeleLMeX_Setup.cpp | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/Source/PeleLMeX.H b/Source/PeleLMeX.H index 8f07e385..975d352e 100644 --- a/Source/PeleLMeX.H +++ b/Source/PeleLMeX.H @@ -316,6 +316,7 @@ public: * parameters. */ void checkRunParams(); + void checkSetupParams(); //----------------------------------------------------------------------------- // REGRID / LOAD BALANCE diff --git a/Source/PeleLMeX_Setup.cpp b/Source/PeleLMeX_Setup.cpp index 292030ce..d77a4dc5 100644 --- a/Source/PeleLMeX_Setup.cpp +++ b/Source/PeleLMeX_Setup.cpp @@ -209,6 +209,9 @@ PeleLM::Setup() // Initialize active control initActiveControl(); + + // Check setup parameters + checkSetupParams(); } void @@ -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) { @@ -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