From 432ccdddaf45a686bab47904f22b745fd9795c2b Mon Sep 17 00:00:00 2001 From: dkachuma Date: Tue, 20 Oct 2026 18:39:19 +0200 Subject: [PATCH 1/2] Move method to base class --- .../wells/CompositionalMultiphaseWell.cpp | 19 ++-------------- .../wells/CompositionalMultiphaseWell.hpp | 6 ++--- .../fluidFlow/wells/SinglePhaseWell.cpp | 22 ------------------- .../fluidFlow/wells/SinglePhaseWell.hpp | 13 ----------- .../fluidFlow/wells/WellControls.cpp | 19 ++++++++++++++++ .../fluidFlow/wells/WellControls.hpp | 2 +- 6 files changed, 25 insertions(+), 56 deletions(-) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp index 623660f0b90..ada4b73469a 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.cpp @@ -408,26 +408,11 @@ void CompositionalMultiphaseWell::validateFluidModel( } } - void CompositionalMultiphaseWell::validateWellConstraints( real64 const & time_n, - real64 const & GEOS_UNUSED_PARAM( dt ), + real64 const & dt, WellElementSubRegion const & subRegion ) { - GEOS_UNUSED_VAR( time_n ); - - if( !useSurfaceConditions() ) - { - bool const useSegmentValues = referenceReservoirRegion().empty(); - - static bool firstNoRefRegionMsg = true; - if( useSegmentValues && firstNoRefRegionMsg ) - { - GEOS_WARNING( WellControls::viewKeyStruct::referenceReservoirRegionString() << - " not set: well constraint fluid property calculations will use top segement pressure and temp ", - getDataContext() ); - firstNoRefRegionMsg = false; - } - } + WellControls::validateWellConstraints( time_n, dt, subRegion ); string const & fluidName = subRegion.getReference< string >( viewKeyStruct::fluidNamesString()); MultiFluidBase const & fluid = subRegion.getConstitutiveModel< MultiFluidBase >( fluidName ); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.hpp index de23fec8bfc..05ac08b0e34 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/CompositionalMultiphaseWell.hpp @@ -400,9 +400,9 @@ class CompositionalMultiphaseWell : public WellControls * @param subRegion the well subRegion * @param elemManager the element manager */ - virtual void validateWellConstraints( real64 const & time_n, - real64 const & dt, - WellElementSubRegion const & subRegion ) override; + void validateWellConstraints( real64 const & time_n, + real64 const & dt, + WellElementSubRegion const & subRegion ) override; /** * @brief Create well separator diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp index 7b50cd11d1c..b6f807af1ee 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.cpp @@ -188,28 +188,6 @@ string SinglePhaseWell::resElementDofName() const return SinglePhaseBase::viewKeyStruct::elemDofFieldString(); } -void SinglePhaseWell::validateWellConstraints( real64 const & time_n, - real64 const & GEOS_UNUSED_PARAM( dt ), - WellElementSubRegion const & subRegion ) -{ - GEOS_UNUSED_VAR( time_n ); - GEOS_UNUSED_VAR( subRegion ); - - if( useSurfaceConditions() ) - { - bool const useSegmentValues = referenceReservoirRegion().empty(); - - static bool firstNoRefRegionMsg = true; - if( useSegmentValues && firstNoRefRegionMsg ) - { - GEOS_WARNING( WellControls::viewKeyStruct::referenceReservoirRegionString() << - " not set: well constraint fluid property calculations will use top segement pressure and temp ", - getDataContext() ); - firstNoRefRegionMsg = false; - } - } -} - void SinglePhaseWell::initializeWellPostInitialConditionsPreSubGroups( WellElementSubRegion & subRegion ) { diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.hpp index 12d1697db8d..d6f835bfcf1 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/SinglePhaseWell.hpp @@ -335,19 +335,6 @@ class SinglePhaseWell : public WellControls ReferenceConditions getReferenceConditions( WellElementSubRegion const & subRegion ); - /** - * @brief Make sure that the well constraints are compatible - * @param time_n the time at the beginning of the time step - * @param dt the time step dt - * @param subRegion the well subRegion - */ - virtual void validateWellConstraints( real64 const & time_n, - real64 const & dt, - WellElementSubRegion const & subRegion - ) override; - - - /** * @brief Create well separator */ diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp index c55bcd2c2b7..c3c2333ad19 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp @@ -248,6 +248,25 @@ void WellControls::registerWellDataOnMesh( WellElementSubRegion & subRegion ) } } +void WellControls::validateWellConstraints( real64 const & GEOS_UNUSED_PARAM( time_n ), + real64 const & GEOS_UNUSED_PARAM( dt ), + WellElementSubRegion const & GEOS_UNUSED_PARAM( subRegion )) +{ + if( !useSurfaceConditions() ) + { + bool const useSegmentValues = referenceReservoirRegion().empty(); + + static bool firstNoRefRegionMsg = true; + if( useSegmentValues && firstNoRefRegionMsg ) + { + GEOS_WARNING( WellControls::viewKeyStruct::referenceReservoirRegionString() << + " not set: well constraint fluid property calculations will use top segement pressure and temp ", + getDataContext() ); + firstNoRefRegionMsg = false; + } + } +} + void WellControls::updateNumDofPerElement() { localIndex const numFlowComponents = numFluidComponents(); diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp index afadd22a724..a826d098d26 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp @@ -150,7 +150,7 @@ class WellControls : public dataRepository::Group virtual void validateWellConstraints( real64 const & time_n, real64 const & dt, - WellElementSubRegion const & subRegion ) = 0; + WellElementSubRegion const & subRegion ); virtual bool isCompositional() const = 0; /** From 3db683e1c4324651f6a3eb87a1cba2e3a89de715 Mon Sep 17 00:00:00 2001 From: dkachuma Date: Tue, 20 Oct 2026 18:48:11 +0200 Subject: [PATCH 2/2] Fix typo in message --- .../physicsSolvers/fluidFlow/wells/WellControls.cpp | 2 +- .../physicsSolvers/fluidFlow/wells/WellControls.hpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp index c3c2333ad19..477aad32534 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.cpp @@ -260,7 +260,7 @@ void WellControls::validateWellConstraints( real64 const & GEOS_UNUSED_PARAM( ti if( useSegmentValues && firstNoRefRegionMsg ) { GEOS_WARNING( WellControls::viewKeyStruct::referenceReservoirRegionString() << - " not set: well constraint fluid property calculations will use top segement pressure and temp ", + " not set: well constraint fluid property calculations will use the top segment pressure and temperature", getDataContext() ); firstNoRefRegionMsg = false; } diff --git a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp index a826d098d26..e32dfcf51cc 100644 --- a/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp +++ b/src/coreComponents/physicsSolvers/fluidFlow/wells/WellControls.hpp @@ -148,6 +148,12 @@ class WellControls : public dataRepository::Group */ /**@{*/ + /** + * @brief Make sure that the well constraints are compatible + * @param time_n the time at the beginning of the time step + * @param dt the time step dt + * @param subRegion the well subRegion + */ virtual void validateWellConstraints( real64 const & time_n, real64 const & dt, WellElementSubRegion const & subRegion );