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>
55template <
class TypeTag>
60namespace Opm::Properties {
66struct Richards {
using InheritsFrom = std::tuple<MultiPhaseBaseModel>; };
71template<
class TypeTag>
73{
static constexpr int value = 0; };
76template<
class TypeTag>
89template<
class TypeTag>
94template<
class TypeTag>
99template<
class TypeTag>
104template<
class TypeTag>
109template<
class TypeTag>
114template<
class TypeTag>
119template<
class TypeTag>
124template<
class TypeTag>
129template<
class TypeTag>
134template<
class TypeTag>
139template<
class TypeTag>
153template<
class TypeTag>
160 using type = LiquidPhase<Scalar, NullComponent<Scalar>>;
171template<
class TypeTag>
178 using type = GasPhase<Scalar, NullComponent<Scalar>>;
190template<
class TypeTag>
199 using type = TwoPhaseImmiscibleFluidSystem<Scalar, WettingFluid, NonWettingFluid>;
264template <
class TypeTag>
266 :
public MultiPhaseBaseModel<TypeTag>
268 using ParentType = MultiPhaseBaseModel<TypeTag>;
276 static const unsigned numPhases = FluidSystem::numPhases;
277 static const unsigned numComponents = FluidSystem::numComponents;
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");
296 explicit RichardsModel(Simulator& simulator)
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_{};
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition multiphasebasemodel.hh:197
Implements a boundary vector for the fully implicit Richards model.
Definition richardsboundaryratevector.hh:49
Intensive quantities required by the Richards model.
Definition richardsintensivequantities.hh:54
Element-wise calculation of the residual for the Richards model.
Definition richardslocalresidual.hh:47
This model implements a variant of the Richards equation for quasi-twophase flow.
Definition richardsmodel.hh:267
void updateBegin()
Called by the update() method before it tries to apply the newton method.
Definition richardsmodel.hh:377
bool phaseIsConsidered(unsigned phaseIdx) const
Definition richardsmodel.hh:396
Scalar eqWeight(unsigned, unsigned eqIdx) const
Returns the relative weight of an equation.
Definition richardsmodel.hh:366
std::string eqName(unsigned eqIdx) const
Given an equation index, return a human readable name.
Definition richardsmodel.hh:338
std::string primaryVarName(unsigned pvIdx) const
Given an primary variable index, return a human readable name.
Definition richardsmodel.hh:322
static void registerParameters()
Register all run-time parameters for the model.
Definition richardsmodel.hh:308
static std::string name()
Definition richardsmodel.hh:316
Scalar primaryVarWeight(unsigned, unsigned pvIdx) const
Returns the relative weight of a primary variable for calculating relative errors.
Definition richardsmodel.hh:354
A Richards model specific Newton method.
Definition richardsnewtonmethod.hh:50
Represents the primary variables used in the Richards model.
Definition richardsprimaryvariables.hh:53
Implements a vector representing mass, molar or volumetric rates.
Definition richardsratevector.hh:54
A base class for fully-implicit multi-phase porous-media flow models which assume multiple fluid phas...
The generic type tag for problems using the immiscible multi-phase model.
Definition blackoilmodel.hh:82
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
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
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240
MultiPhaseBaseExtensiveQuantities< TypeTag > RichardsExtensiveQuantities
Calculates and stores the data which is required to calculate the flux of fluid over a face of a fini...
Definition richardsextensivequantities.hh:43
Implements a boundary vector for the fully implicit Richards model.
Calculates and stores the data which is required to calculate the flux of fluid over a face of a fini...
Indices for the primary variables/conservation equations of the Richards model.
Intensive quantities required by the Richards model.
Element-wise calculation of the residual for the Richards model.
A Richards model specific Newton method.
Represents the primary variables used in the Richards model.
Contains the property declarations for the Richards model.
Implements a vector representing mass, molar or volumetric rates.
Type of object for specifying boundary conditions.
Definition fvbaseproperties.hh:119
Data required to calculate a flux over a face.
Definition fvbaseproperties.hh:153
The fluid systems including the information about the phases.
Definition multiphasebaseproperties.hh:79
Index of the component which constitutes the gas.
Definition richardsproperties.hh:61
Index of the fluid which represents the non-wetting phase.
Definition richardsproperties.hh:53
Enumerations used by the model.
Definition multiphasebaseproperties.hh:51
The secondary variables within a sub-control volume.
Definition fvbaseproperties.hh:133
Index of the component which constitutes the liquid.
Definition richardsproperties.hh:57
Index of the fluid which represents the wetting phase.
Definition richardsproperties.hh:49
The type of the local residual function.
Definition fvbaseproperties.hh:94
The type of the model.
Definition basicproperties.hh:92
Specifies the type of the actual Newton method.
Definition newtonmethodproperties.hh:32
The fluid used as the non-wetting phase (by default, we set the fluid system to the immiscible one,...
Definition richardsproperties.hh:45
A vector of primary variables within a sub-control volume.
Definition fvbaseproperties.hh:130
Vector containing volumetric or areal rates of quantities.
Definition fvbaseproperties.hh:116
The type tag for problems discretized using the Richards model.
Definition richardsmodel.hh:66
The fluid used as the wetting phase (by default, we set the fluid system to the immiscible one,...
Definition richardsproperties.hh:40
Indices for the primary variables/conservation equations of the Richards model.
Definition richardsindices.hh:39