28 #ifndef EWOMS_RICHARDS_MODEL_HH 29 #define EWOMS_RICHARDS_MODEL_HH 31 #include <opm/material/components/NullComponent.hpp> 32 #include <opm/material/densead/Math.hpp> 33 #include <opm/material/fluidsystems/LiquidPhase.hpp> 34 #include <opm/material/fluidsystems/GasPhase.hpp> 35 #include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp> 55 template <
class TypeTag>
66 struct Richards {
using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
71 template<
class TypeTag>
73 {
static constexpr
int value = 0; };
76 template<
class TypeTag>
78 {
static constexpr
int value = 1 - getPropValue<TypeTag, Properties::LiquidPhaseIndex>(); };
89 template<
class TypeTag>
91 {
static constexpr
int value = getPropValue<TypeTag, Properties::LiquidPhaseIndex>(); };
94 template<
class TypeTag>
96 {
static constexpr
int value = 1 - getPropValue<TypeTag, Properties::LiquidComponentIndex>(); };
99 template<
class TypeTag>
104 template<
class TypeTag>
105 struct Model<TypeTag, TTag::Richards>
109 template<
class TypeTag>
114 template<
class TypeTag>
119 template<
class TypeTag>
124 template<
class TypeTag>
129 template<
class TypeTag>
134 template<
class TypeTag>
139 template<
class TypeTag>
153 template<
class TypeTag>
160 using type = LiquidPhase<Scalar, NullComponent<Scalar>>;
171 template<
class TypeTag>
178 using type = GasPhase<Scalar, NullComponent<Scalar>>;
190 template<
class TypeTag>
199 using type = TwoPhaseImmiscibleFluidSystem<Scalar, WettingFluid, NonWettingFluid>;
264 template <
class TypeTag>
276 static const unsigned numPhases = FluidSystem::numPhases;
277 static const unsigned numComponents = FluidSystem::numComponents;
279 static const unsigned liquidPhaseIdx = getPropValue<TypeTag, Properties::LiquidPhaseIndex>();
280 static const unsigned gasPhaseIdx = getPropValue<TypeTag, Properties::GasPhaseIndex>();
282 static const unsigned liquidCompIdx = getPropValue<TypeTag, Properties::LiquidComponentIndex>();
283 static const unsigned gasCompIdx = getPropValue<TypeTag, Properties::GasComponentIndex>();
286 static_assert(numPhases == 2,
287 "Exactly two fluids are required for this model");
288 static_assert(numComponents == 2,
289 "Exactly two components are required for this model");
290 static_assert(liquidPhaseIdx != gasPhaseIdx,
291 "The liquid and the gas phases must be different");
292 static_assert(liquidCompIdx != gasCompIdx,
293 "The liquid and the gas components must be different");
297 : ParentType(simulator)
301 assert(FluidSystem::isLiquid(liquidPhaseIdx));
302 assert(!FluidSystem::isLiquid(gasPhaseIdx));
317 {
return "richards"; }
324 std::ostringstream oss;
325 if (pvIdx == Indices::pressureWIdx) {
326 oss <<
"pressure_" << FluidSystem::phaseName(liquidPhaseIdx);
340 std::ostringstream oss;
341 if (eqIdx == Indices::contiEqIdx) {
342 oss <<
"continuity_" << FluidSystem::phaseName(liquidPhaseIdx);
356 if (Indices::pressureWIdx == pvIdx) {
357 return 10 / referencePressure_;
366 Scalar
eqWeight(
unsigned, [[maybe_unused]]
unsigned eqIdx)
const 368 assert((eqIdx - Indices::contiEqIdx) <= FluidSystem::numPhases);
379 ParentType::updateBegin();
384 for (
unsigned dofIdx = 0; dofIdx < this->numGridDof(); ++ dofIdx) {
385 if (this->isLocalDof(dofIdx)) {
387 this->solution(0)[dofIdx][Indices::pressureWIdx];
397 {
return phaseIdx == liquidPhaseIdx; }
399 void registerOutputModules_()
400 { ParentType::registerOutputModules_(); }
402 Scalar referencePressure_{};
Index of the fluid which represents the non-wetting phase.
Definition: richardsproperties.hh:53
Index of the component which constitutes the liquid.
Definition: richardsproperties.hh:57
static void registerParameters()
Register all run-time parameters for the model.
Definition: richardsmodel.hh:308
static std::string name()
Definition: richardsmodel.hh:316
Intensive quantities required by the Richards model.
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(...))
Definition: propertysystem.hh:233
The type of the local residual function.
Definition: fvbaseproperties.hh:94
Specifies the type of the actual Newton method.
Definition: fvbaseproblem.hh:54
Element-wise calculation of the residual for the Richards model.
Definition: richardslocalresidual.hh:46
This model implements a variant of the Richards equation for quasi-twophase flow. ...
Definition: richardsmodel.hh:56
Enumerations used by the model.
Definition: multiphasebaseproperties.hh:51
Represents the primary variables used in the Richards model.
Definition: richardsprimaryvariables.hh:52
The type tag for problems discretized using the Richards model.
Definition: richardsmodel.hh:66
Element-wise calculation of the residual for the Richards model.
The fluid used as the wetting phase (by default, we set the fluid system to the immiscible one...
Definition: richardsproperties.hh:40
The fluid used as the non-wetting phase (by default, we set the fluid system to the immiscible one...
Definition: richardsproperties.hh:45
Scalar eqWeight(unsigned, [[maybe_unused]] unsigned eqIdx) const
Returns the relative weight of an equation.
Definition: richardsmodel.hh:366
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Implements a vector representing mass, molar or volumetric rates.
std::string eqName(unsigned eqIdx) const
Given an equation index, return a human readable name.
Definition: richardsmodel.hh:338
Vector containing volumetric or areal rates of quantities.
Definition: fvbaseproperties.hh:116
Implements a boundary vector for the fully implicit Richards model.
Definition: richardsboundaryratevector.hh:48
Type of object for specifying boundary conditions.
Definition: fvbaseproperties.hh:119
The fluid systems including the information about the phases.
Definition: multiphasebaseproperties.hh:79
A Richards model specific Newton method.
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition: multiphasebasemodel.hh:197
void updateBegin()
Called by the update() method before it tries to apply the newton method.
Definition: richardsmodel.hh:377
Data required to calculate a flux over a face.
Definition: fvbaseproperties.hh:153
A Richards model specific Newton method.
Definition: richardsnewtonmethod.hh:49
Contains the property declarations for the Richards model.
Implements a boundary vector for the fully implicit Richards model.
The secondary variables within a sub-control volume.
Definition: fvbaseproperties.hh:133
Index of the component which constitutes the gas.
Definition: richardsproperties.hh:61
This class calculates the pressure potential gradients and the filter velocities for multi-phase flow...
Definition: multiphasebaseextensivequantities.hh:50
The type of the model.
Definition: basicproperties.hh:92
std::string primaryVarName(unsigned pvIdx) const
Given an primary variable index, return a human readable name.
Definition: richardsmodel.hh:322
Calculates and stores the data which is required to calculate the flux of fluid over a face of a fini...
Intensive quantities required by the Richards model.
Definition: richardsintensivequantities.hh:51
Scalar primaryVarWeight(unsigned, unsigned pvIdx) const
Returns the relative weight of a primary variable for calculating relative errors.
Definition: richardsmodel.hh:354
Represents the primary variables used in the Richards model.
Implements a vector representing mass, molar or volumetric rates.
Definition: richardsratevector.hh:51
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
bool phaseIsConsidered(unsigned phaseIdx) const
Definition: richardsmodel.hh:396
Indices for the primary variables/conservation equations of the Richards model.
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:83
Definition: blackoilmodel.hh:80
Indices for the primary variables/conservation equations of the Richards model.
Definition: richardsindices.hh:38
A vector of primary variables within a sub-control volume.
Definition: fvbaseproperties.hh:130
Index of the fluid which represents the wetting phase.
Definition: richardsproperties.hh:49
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
Definition: multiphasebasemodel.hh:57