From bc3c42724d10e059fc0db66e1aa156a4baa31543 Mon Sep 17 00:00:00 2001 From: Tom Byer <149726499+tjb-ltk@users.noreply.github.com> Date: Fri, 13 Dec 2024 16:24:03 -0800 Subject: [PATCH] add mass validity checks --- .../fluidFlow/wells/CompositionalMultiphaseWell.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index dab39097ae..2fbe33d71b 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -454,6 +454,7 @@ void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n WellControls::Control const currentControl = wellControls.getControl(); real64 const & targetTotalRate = wellControls.getTargetTotalRate( time_n + dt ); real64 const & targetPhaseRate = wellControls.getTargetPhaseRate( time_n + dt ); + real64 const & targetMassRate = wellControls.getTargetMassRate( time_n + dt ); GEOS_THROW_IF( wellControls.isInjector() && currentControl == WellControls::Control::PHASEVOLRATE, "WellControls " << wellControls.getDataContext() << @@ -472,6 +473,18 @@ void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n "WellControls " << wellControls.getDataContext() << ": Target phase rate cannot be used for injectors", InputError ); + GEOS_THROW_IF( wellControls.isProducer() && !isZero( targetTotalRate ), + "WellControls " << wellControls.getDataContext() << + ": Target total rate cannot be used for producers", + InputError ); + GEOS_THROW_IF( wellControls.isProducer() && !isZero( targetMassRate ), + "WellControls " << wellControls.getDataContext() << + ": Target mass rate cannot be used for producers", + InputError ); + GEOS_THROW_IF( !m_useMass && !isZero( targetMassRate ), + "WellControls " << wellControls.getDataContext() << + ": Target mass rate cannot with m_useMass=0", + InputError ); // The user always provides positive rates, but these rates are later multiplied by -1 internally for producers GEOS_THROW_IF( wellControls.isProducer() && targetPhaseRate > 0.0,