26 #ifndef EWOMS_RICHARDS_MODEL_HH
27 #define EWOMS_RICHARDS_MODEL_HH
29 #include <opm/material/localad/Math.hpp>
43 #include <opm/material/components/NullComponent.hpp>
44 #include <opm/material/fluidsystems/LiquidPhase.hpp>
45 #include <opm/material/fluidsystems/GasPhase.hpp>
46 #include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp>
48 #include <dune/common/unused.hh>
54 template <
class TypeTag>
59 namespace Properties {
128 typedef Opm::LiquidPhase<Scalar, Opm::NullComponent<Scalar> > type;
145 typedef Opm::GasPhase<Scalar, Opm::NullComponent<Scalar> > type;
161 typedef typename GET_PROP_TYPE(TypeTag, WettingFluid) WettingFluid;
162 typedef typename GET_PROP_TYPE(TypeTag, NonWettingFluid) NonWettingFluid;
165 typedef Opm::FluidSystems::TwoPhaseImmiscible<Scalar, WettingFluid, NonWettingFluid> type;
230 template <
class TypeTag>
232 :
public MultiPhaseBaseModel<TypeTag>
234 typedef MultiPhaseBaseModel<TypeTag> ParentType;
236 typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
238 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
239 typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
240 typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
242 static const
int numPhases = FluidSystem::numPhases;
243 static const
int numComponents = FluidSystem::numComponents;
245 static const
int liquidPhaseIdx =
GET_PROP_VALUE(TypeTag, LiquidPhaseIndex);
246 static const
int gasPhaseIdx =
GET_PROP_VALUE(TypeTag, GasPhaseIndex);
248 static const
int liquidCompIdx =
GET_PROP_VALUE(TypeTag, LiquidComponentIndex);
249 static const
int gasCompIdx =
GET_PROP_VALUE(TypeTag, GasComponentIndex);
253 static_assert(numPhases == 2,
254 "Exactly two fluids are required for this model");
255 static_assert(numComponents == 2,
256 "Exactly two components are required for this model");
257 static_assert(liquidPhaseIdx != gasPhaseIdx,
258 "The liquid and the gas phases must be different");
259 static_assert(liquidCompIdx != gasCompIdx,
260 "The liquid and the gas components must be different");
263 RichardsModel(Simulator &simulator)
264 : ParentType(simulator)
268 assert(FluidSystem::isLiquid(liquidPhaseIdx));
269 assert(!FluidSystem::isLiquid(gasPhaseIdx));
283 static std::string name()
284 {
return "richards"; }
289 std::string primaryVarName(
int pvIdx)
const
291 std::ostringstream oss;
292 if (pvIdx == Indices::pressureWIdx)
293 oss <<
"pressure_" << FluidSystem::phaseName(liquidPhaseIdx);
303 std::string eqName(
int eqIdx)
const
305 std::ostringstream oss;
306 if (eqIdx == Indices::contiEqIdx)
307 oss <<
"continuity_" << FluidSystem::phaseName(liquidPhaseIdx);
317 Scalar primaryVarWeight(
int globalDofIdx,
int pvIdx)
const
319 if (Indices::pressureWIdx == pvIdx) {
320 return 10 / referencePressure_;
329 Scalar eqWeight(
int globalDofIdx,
int eqIdx)
const
331 int DUNE_UNUSED compIdx = eqIdx - Indices::contiEqIdx;
332 assert(0 <= compIdx && compIdx <= FluidSystem::numPhases);
343 ParentType::updateBegin();
348 for (
size_t dofIdx = 0; dofIdx < this->numGridDof(); ++ dofIdx) {
349 if (this->isLocalDof(dofIdx)) {
351 this->solution(0)[dofIdx][Indices::pressureWIdx];
361 {
return phaseIdx == liquidPhaseIdx; }
368 mutable Scalar referencePressure_;
void registerOutputModules_()
Definition: multiphasebasemodel.hh:244
Implements a boundary vector for the fully implicit Richards model.
A Richards model specific Newton method.
The multi-dimensional Newton method.
Definition: newtonmethod.hh:54
Element-wise calculation of the residual for the Richards model.
Definition: richardslocalresidual.hh:40
bool phaseIsConsidered(int phaseIdx) const
Returns true iff a fluid phase is used by the model.
Definition: multiphasebasemodel.hh:180
Implements a boundary vector for the fully implicit Richards model.
Definition: richardsboundaryratevector.hh:42
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:468
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
Definition: multiphasebasemodel.hh:45
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:485
Implements a vector representing mass, molar or volumetric rates.
Definition: richardsratevector.hh:47
SET_PROP(NumericModel, ParameterTree)
Set the ParameterTree property.
Definition: basicproperties.hh:117
Implements a vector representing mass, molar or volumetric rates.
SET_INT_PROP(NumericModel, GridGlobalRefinements, 0)
Indices for the primary variables/conservation equations of the Richards model.
Intensive quantities required by the Richards model.
SET_TYPE_PROP(NumericModel, Scalar, double)
Set the default type of scalar values to double.
Calculates and stores the data which is required to calculate the flux of fluid over a face of a fini...
Element-wise calculation of the residual for the Richards model.
Intensive quantities required by the Richards model.
Definition: richardsintensivequantities.hh:45
Definition: baseauxiliarymodule.hh:35
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition: multiphasebasemodel.hh:145
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
Represents the primary variables used in the Richards model.
Definition: richardsprimaryvariables.hh:49
A Richards model specific Newton method.
Definition: richardsnewtonmethod.hh:43
This model implements a variant of the Richards equation for quasi-twophase flow. ...
Definition: richardsmodel.hh:55
Indices for the primary variables/conservation equations of the Richards model.
Definition: richardsindices.hh:36
Calculates and stores the data which is required to calculate the flux of fluid over a face of a fini...
Definition: richardsextensivequantities.hh:43
#define INHERITS_FROM(...)
Syntactic sugar for NEW_TYPE_TAG.
Definition: propertysystem.hh:229
Represents the primary variables used in the Richards model.
Contains the property declarations for the Richards model.