20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_SINGLEPHASEWELL_HPP_
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_WELLS_SINGLEPHASEWELL_HPP_
23 #include "physicsSolvers/fluidFlow/wells/WellControls.hpp"
25 #include "constitutive/fluid/singlefluid/SingleFluidLayouts.hpp"
30 namespace dataRepository
35 namespace constitutive
37 class SingleFluidBase;
40 namespace singlePhaseStatistics
42 class StatsAggregator;
45 class WellElementSubRegion;
56 using DerivOffset = constitutive::singlefluid::DerivativeOffsetC< 1 >;
63 Group *
const parent );
103 virtual void initializeWellPostInitialConditionsPreSubGroups(
WellElementSubRegion & subRegion )
override;
105 virtual bool isCompositional()
const override {
return false; }
163 calculateLocalWellResidualNorm(
real64 const & time_n,
172 calculateWellResidualNorm(
real64 const & time_n,
194 real64 & minPresScalingFactor,
195 real64 & minTempScalingFactor,
210 real64 const scalingFactor,
223 real64 const scalingFactor,
229 virtual void applyWellBoundaryConditions(
real64 const time_n,
240 virtual void implicitStepSetup(
real64 const & time_n,
243 string const & meshBodyName,
248 implicitStepComplete(
real64 const & time,
252 virtual void printRates(
real64 const & time_n,
256 virtual real64 updateSubRegionState(
real64 const time_n,
263 virtual string wellElementDofName()
const override {
return viewKeyStruct::dofFieldString(); }
265 virtual string resElementDofName()
const override;
267 virtual localIndex numFluidComponents()
const override {
return 0; }
269 virtual localIndex numFluidPhases()
const override {
return 1; }
314 static constexpr
char const * dofFieldString() {
return "wellVars"; }
325 virtual void resetShutInControlState()
override;
333 struct ReferenceConditions
340 std::unique_ptr< singlePhaseStatistics::StatsAggregator > m_reservoirStatsAggregator;
350 void precomputeReferenceConditions(
real64 time_n,
363 virtual void validateWellConstraints(
real64 const & time_n,
#define GEOS_UNUSED_PARAM(X)
Mark an unused argument and silence compiler warnings.
The DoFManager is responsible for allocating global dofs, constructing sparsity patterns,...
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
A buffer to count and store element ids during kernel execution. This facilitates the reporting mecha...
The class is used to manage mesh body.
Class facilitating the representation of a multi-level discretization of a MeshBody.
virtual ~SinglePhaseWell() override
default destructor
virtual void initializePostInitialConditionsPreSubGroups() override
Called by InitializePostInitialConditions() prior to initializing sub-Groups.
SinglePhaseWell(const string &name, Group *const parent)
main constructor for Group Objects
virtual real64 updateWellState(MeshBody const &meshBody, ElementRegionManager const &elemManager, WellElementSubRegion &subRegion) override
Recompute all dependent quantities from primary variables (including constitutive models)
SinglePhaseWell(SinglePhaseWell &&)=delete
default move constructor
SinglePhaseWell & operator=(SinglePhaseWell const &)=delete
deleted assignment operator
SinglePhaseWell(SinglePhaseWell const &)=delete
deleted copy constructor
void calculateReferenceElementRates(WellElementSubRegion &subRegion)
Calculate well rates at the reference element.
virtual void updateFluidModel(WellElementSubRegion &subRegion) const
Update fluid constitutive model state.
integer m_allowNegativePressure
flag if negative pressure is allowed
void updateSeparator(ElementRegionManager const &elemManager, WellElementSubRegion &subRegion)
Update separator model state.
SinglePhaseWell & operator=(SinglePhaseWell &&)=delete
deleted move operator
virtual void updateBHPForConstraint(WellElementSubRegion &subRegion)
Recompute the BHP pressure that is used in the well constraints.
virtual void postRestartInitialization() override
Performs initialization required after reading from a restart file.
SinglePhaseWell()=delete
deleted default constructor
This class describes the controls used to operate a well.
This class describes a collection of local well elements and perforations.
virtual bool checkWellSystemSolution(WellElementSubRegion &subRegion, DofManager const &dofManager, arrayView1d< real64 const > const &localSolution, real64 const scalingFactor, real64 &minPressure, real64 &minDensity, real64 &minTotalDensity, ElementsReporterBuffer &negPressureIds, ElementsReporterBuffer &negDensityIds, ElementsReporterBuffer &negTotalDensityIds) override
real64 scalingForLocalSystemSolution(WellElementSubRegion &subRegion, DofManager const &dofManager, real64 &maxDeltaPres, real64 &maxDeltaTemp, real64 &minPresScalingFactor, real64 &minTempScalingFactor, arrayView1d< real64 const > const &localSolution)
Compute the Newton update scaling factor of one well, with the quantities reported in the log.
virtual void resetStateToBeginningOfStep(DomainPartition &domain, string const &meshBodyName, ElementRegionManager const &elemManager, WellElementSubRegion &subRegion) override
Reset the well state to the beginning of the time step.
virtual void applyWellSystemSolution(DofManager const &dofManager, arrayView1d< real64 const > const &localSolution, real64 const scalingFactor, real64 const dt, DomainPartition &domain, MeshLevel &mesh, WellElementSubRegion &subRegion) override
virtual void assembleWellAccumulationTerms(real64 const &time, real64 const &dt, WellElementSubRegion &subRegion, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
assembles the accumulation term for an individual well
virtual void assembleWellConstraintTerms(real64 const &time_n, real64 const &dt, WellElementSubRegion const &subRegion, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
assembles the well constraint terms for an individual well
virtual void computeWellPerforationRates(real64 const &time_n, real64 const &GEOS_UNUSED_PARAM(dt), ElementRegionManager &elemManager, WellElementSubRegion &subRegion) override
Recompute the perforation rates for all the wells.
virtual void initializeWell(DomainPartition &domain, Group &meshBodies, string const &meshBodyName, MeshLevel &mesh, WellElementSubRegion &subRegion, real64 const &time_n) override
Initialize well for the beginning of a simulation or restart.
virtual void assembleWellPressureRelations(real64 const &time_n, real64 const &dt, WellElementSubRegion const &subRegion, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
assembles the well constraint terms for an individual well
virtual void assembleWellFluxTerms(real64 const &time, real64 const &dt, WellElementSubRegion const &subRegion, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
double real64
64-bit floating point type.
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
LvArray::CRSMatrixView< T, COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
int integer
Signed integer type.
Array< T, 1 > array1d
Alias for 1D array.
Struct to serve as a container for variable strings and keys.