28 #ifndef EWOMS_RICHARDS_MODEL_HH
29 #define EWOMS_RICHARDS_MODEL_HH
31 #include <opm/material/densead/Math.hpp>
45 #include <opm/material/components/NullComponent.hpp>
46 #include <opm/material/fluidsystems/LiquidPhase.hpp>
47 #include <opm/material/fluidsystems/GasPhase.hpp>
48 #include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp>
49 #include <opm/common/Unused.hpp>
55 template <
class TypeTag>
60 namespace Properties {
129 typedef Opm::LiquidPhase<Scalar, Opm::NullComponent<Scalar> > type;
146 typedef Opm::GasPhase<Scalar, Opm::NullComponent<Scalar> > type;
162 typedef typename
GET_PROP_TYPE(TypeTag, WettingFluid) WettingFluid;
163 typedef typename
GET_PROP_TYPE(TypeTag, NonWettingFluid) NonWettingFluid;
166 typedef Opm::FluidSystems::TwoPhaseImmiscible<Scalar, WettingFluid, NonWettingFluid> type;
231 template <
class TypeTag>
240 typedef typename
GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
243 static const
unsigned numPhases = FluidSystem::numPhases;
244 static const
unsigned numComponents = FluidSystem::numComponents;
246 static const
unsigned liquidPhaseIdx =
GET_PROP_VALUE(TypeTag, LiquidPhaseIndex);
247 static const
unsigned gasPhaseIdx =
GET_PROP_VALUE(TypeTag, GasPhaseIndex);
249 static const
unsigned liquidCompIdx =
GET_PROP_VALUE(TypeTag, LiquidComponentIndex);
250 static const
unsigned gasCompIdx =
GET_PROP_VALUE(TypeTag, GasComponentIndex);
254 static_assert(numPhases == 2,
255 "Exactly two fluids are required for this model");
256 static_assert(numComponents == 2,
257 "Exactly two components are required for this model");
258 static_assert(liquidPhaseIdx != gasPhaseIdx,
259 "The liquid and the gas phases must be different");
260 static_assert(liquidCompIdx != gasCompIdx,
261 "The liquid and the gas components must be different");
265 : ParentType(simulator)
269 assert(FluidSystem::isLiquid(liquidPhaseIdx));
270 assert(!FluidSystem::isLiquid(gasPhaseIdx));
278 ParentType::registerParameters();
285 {
return "richards"; }
292 std::ostringstream oss;
293 if (pvIdx == Indices::pressureWIdx)
294 oss <<
"pressure_" << FluidSystem::phaseName(liquidPhaseIdx);
306 std::ostringstream oss;
307 if (eqIdx == Indices::contiEqIdx)
308 oss <<
"continuity_" << FluidSystem::phaseName(liquidPhaseIdx);
320 if (Indices::pressureWIdx == pvIdx) {
321 return 10 / referencePressure_;
330 Scalar
eqWeight(
unsigned globalDofIdx OPM_UNUSED,
unsigned OPM_OPTIM_UNUSED eqIdx)
const
332 unsigned OPM_OPTIM_UNUSED compIdx = eqIdx - Indices::contiEqIdx;
333 assert(0 <= compIdx && compIdx <= FluidSystem::numPhases);
344 ParentType::updateBegin();
349 for (
unsigned dofIdx = 0; dofIdx < this->numGridDof(); ++ dofIdx) {
350 if (this->isLocalDof(dofIdx)) {
352 this->solution(0)[dofIdx][Indices::pressureWIdx];
362 {
return phaseIdx == liquidPhaseIdx; }
364 void registerOutputModules_()
366 ParentType::registerOutputModules_();
369 mutable Scalar referencePressure_;
Scalar primaryVarWeight(unsigned globalDofIdx OPM_UNUSED, unsigned pvIdx) const
Returns the relative weight of a primary variable for calculating relative errors.
Definition: richardsmodel.hh:318
Intensive quantities required by the Richards model.
A Richards model specific Newton method.
Definition: richardsnewtonmethod.hh:46
Calculates and stores the data which is required to calculate the flux of fluid over a face of a fini...
Definition: richardsextensivequantities.hh:45
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
static std::string name()
Definition: richardsmodel.hh:284
Element-wise calculation of the residual for the Richards model.
#define NEW_TYPE_TAG(...)
Define a new type tag.
Definition: propertysystem.hh:169
This model implements a variant of the Richards equation for quasi-twophase flow. ...
Definition: richardsmodel.hh:56
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:486
#define INHERITS_FROM(...)
Syntactic sugar for NEW_TYPE_TAG.
Definition: propertysystem.hh:230
#define SET_INT_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant integer value.
Definition: propertysystem.hh:345
Implements a vector representing mass, molar or volumetric rates.
A Richards model specific Newton method.
Intensive quantities required by the Richards model.
Definition: richardsintensivequantities.hh:47
Implements a vector representing mass, molar or volumetric rates.
Definition: richardsratevector.hh:49
Represents the primary variables used in the Richards model.
Definition: richardsprimaryvariables.hh:53
Contains the property declarations for the Richards model.
The multi-dimensional Newton method.
Definition: newtonmethod.hh:56
Implements a boundary vector for the fully implicit Richards model.
bool phaseIsConsidered(unsigned phaseIdx) const
Definition: richardsmodel.hh:361
#define SET_PROP(EffTypeTagName, PropTagName)
Set a property for a specific type tag.
Definition: propertysystem.hh:297
Element-wise calculation of the residual for the Richards model.
Definition: richardslocalresidual.hh:42
Implements a boundary vector for the fully implicit Richards model.
Definition: richardsboundaryratevector.hh:44
std::string primaryVarName(unsigned pvIdx) const
Given an primary variable index, return a human readable name.
Definition: richardsmodel.hh:290
void updateBegin()
Called by the update() method before it tries to apply the newton method.
Definition: richardsmodel.hh:342
Calculates and stores the data which is required to calculate the flux of fluid over a face of a fini...
Represents the primary variables used in the Richards model.
std::string eqName(unsigned eqIdx) const
Given an equation index, return a human readable name.
Definition: richardsmodel.hh:304
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
Definition: multiphasebasemodel.hh:47
Scalar eqWeight(unsigned globalDofIdx OPM_UNUSED, unsigned OPM_OPTIM_UNUSED eqIdx) const
Returns the relative weight of an equation.
Definition: richardsmodel.hh:330
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:75
static void registerParameters()
Register all run-time parameters for the model.
Definition: richardsmodel.hh:276
Indices for the primary variables/conservation equations of the Richards model.
#define SET_TYPE_PROP(EffTypeTagName, PropTagName,...)
Set a property which defines a type.
Definition: propertysystem.hh:377
Indices for the primary variables/conservation equations of the Richards model.
Definition: richardsindices.hh:38