Skip to content

Commit

Permalink
add mass validity checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tjb-ltk committed Dec 14, 2024
1 parent b5cec3e commit bc3c427
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() <<
Expand All @@ -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,
Expand Down

0 comments on commit bc3c427

Please sign in to comment.