20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_IMMISCIBLEMULTIPHASEFLOW_HPP_
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_IMMISCIBLEMULTIPHASEFLOW_HPP_
46 Group *
const parent );
71 static string catalogName() {
return "ImmiscibleMultiphaseFlow"; }
102 real64 const scalingFactor,
186 void applySourceFluxBC(
real64 const time,
218 static constexpr
char const * capPressureNamesString() {
return "capPressureNames"; }
219 static constexpr
char const * relPermNamesString() {
return "relPermNames"; }
220 static constexpr
char const * elemDofFieldString() {
return "elemDofField"; }
223 static constexpr
char const * gravityDensitySchemeString() {
return "gravityDensityScheme"; }
226 static constexpr
char const * solutionChangeScalingFactorString() {
return "solutionChangeScalingFactor"; }
227 static constexpr
char const * targetRelativePresChangeString() {
return "targetRelativePressureChangeInTimeStep"; }
228 static constexpr
char const * targetPhaseVolFracChangeString() {
return "targetPhaseVolFractionChangeInTimeStep"; }
231 static constexpr
char const * maxRelativePresChangeString() {
return "maxRelativePressureChange"; }
232 static constexpr
char const * useTotalMassEquationString() {
return "useTotalMassEquation"; }
238 virtual void postInputInitialization()
override;
273 template<
typename OBJECT_TYPE >
274 void applyFieldValue(
real64 const & time_n,
277 char const logMessage[],
278 string const fieldKey,
279 string const boundaryFieldKey )
const;
288 integer m_useTotalMassEquation;
294 real64 m_targetRelativePresChange;
297 real64 m_targetPhaseVolFracChange;
300 real64 m_solutionChangeScalingFactor;
311 real64 const time )
const;
317 template<
typename OBJECT_TYPE >
318 void ImmiscibleMultiphaseFlow::applyFieldValue(
real64 const & time_n,
321 char const logMessage[],
322 string const fieldKey,
323 string const boundaryFieldKey )
const
327 fsManager.
apply< OBJECT_TYPE >( time_n + dt,
331 string const & setName,
333 OBJECT_TYPE & targetGroup,
338 globalIndex const numTargetElems = MpiWrapper::sum< globalIndex >( lset.size() );
340 getName(), time_n+dt, fs.getCatalogName(), fs.getName(),
341 setName, targetGroup.getName(), fs.getScale(), numTargetElems ) );
345 fs.applyFieldValue< FieldSpecificationEqual,
346 parallelDevicePolicy<> >( lset,
#define GEOS_LOG_RANK_0(msg)
Log a message on screen on rank 0.
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...
void apply(real64 const time, MeshLevel &mesh, string const &fieldName, LAMBDA &&lambda) const
This function is the main driver for the field applications.
static FieldSpecificationManager & getInstance()
ImmiscibleMultiphaseFlow & operator=(ImmiscibleMultiphaseFlow &&)=delete
deleted move operator
virtual ~ImmiscibleMultiphaseFlow() override=default
default destructor
virtual void implicitStepComplete(real64 const &time, real64 const &dt, DomainPartition &domain) override
perform cleanup for implicit timestep
virtual void updateState(DomainPartition &domain) override final
Recompute all dependent quantities from primary variables (including constitutive models)
virtual void saveConvergedState(ElementSubRegionBase &subRegion) const override final
Utility function to save the converged state.
ImmiscibleMultiphaseFlow(ImmiscibleMultiphaseFlow const &)=delete
deleted copy constructor
virtual void initializePostInitialConditionsPreSubGroups() override
Called by InitializePostInitialConditions() prior to initializing sub-Groups.
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
void updatePhaseMass(ElementSubRegionBase &subRegion) const
Function to update fluid mass.
virtual real64 setNextDtBasedOnStateChange(real64 const ¤tDt, DomainPartition &domain) override
function to set the next time step size
virtual void implicitStepSetup(real64 const &time_n, real64 const &dt, DomainPartition &domain) override
function to perform setup for implicit timestep
ImmiscibleMultiphaseFlow(ImmiscibleMultiphaseFlow &&)=default
default move constructor
ImmiscibleMultiphaseFlow(const string &name, Group *const parent)
main constructor for Group Objects
void assembleAccumulationTerm(DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) const
assembles the accumulation and volume balance terms for all cells
virtual void applySystemSolution(DofManager const &dofManager, arrayView1d< real64 const > const &localSolution, real64 const scalingFactor, real64 const dt, DomainPartition &domain) override
Function to apply the solution vector to the state.
integer numFluidPhases() const
Getter for the number of fluid phases.
virtual void assembleFluxTerms(real64 const dt, DomainPartition const &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) const
assembles the flux terms for all cells
virtual real64 calculateResidualNorm(real64 const &time_n, real64 const &dt, DomainPartition const &domain, DofManager const &dofManager, arrayView1d< real64 const > const &localRhs) override
calculate the norm of the global system residual
static string catalogName()
name of the solver in the object catalog
void applyDirichletBC(real64 const time, real64 const dt, DofManager const &dofManager, DomainPartition &domain, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) const
Function to perform the Application of Dirichlet type BC's.
virtual void resetStateToBeginningOfStep(DomainPartition &domain) override
reset state of physics back to the beginning of the step.
virtual void assembleSystem(real64 const time_n, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
function to assemble the linear system matrix and rhs
string getCatalogName() const override
virtual void setupDofs(DomainPartition const &domain, DofManager &dofManager) const override
Populate degree-of-freedom manager with fields relevant to this solver.
ImmiscibleMultiphaseFlow()=delete
deleted default constructor
virtual void registerDataOnMesh(Group &meshBodies) override final
Register wrappers that contain data on the mesh objects.
virtual void applyBoundaryConditions(real64 const time_n, real64 const dt, DomainPartition &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
apply boundary condition to system
ImmiscibleMultiphaseFlow & operator=(ImmiscibleMultiphaseFlow const &)=delete
deleted assignment operator
Class facilitating the representation of a multi-level discretization of a MeshBody.
integer m_numNewtonIterations
The number of nonlinear iterations that have been exectued.
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
NonlinearSolverParameters m_nonlinearSolverParameters
Nonlinear solver parameters.
string const & getName() const
Get group name.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
stdVector< string > string_array
A 1-dimensional array of geos::string types.
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
double real64
64-bit floating point type.
std::int32_t integer
Signed integer type.
LvArray::SortedArrayView< T, localIndex, LvArray::ChaiBuffer > SortedArrayView
A sorted array view of local indices.
GravityDensityScheme
Options for density treatment in gravity.