28 #ifndef EWOMS_IMMISCIBLE_MODEL_HH 29 #define EWOMS_IMMISCIBLE_MODEL_HH 31 #include <opm/material/densead/Math.hpp> 44 #include <opm/material/components/NullComponent.hpp> 45 #include <opm/material/fluidsystems/GasPhase.hpp> 46 #include <opm/material/fluidsystems/LiquidPhase.hpp> 47 #include <opm/material/fluidsystems/SinglePhaseFluidSystem.hpp> 48 #include <opm/material/fluidsystems/TwoPhaseImmiscibleFluidSystem.hpp> 54 template <
class TypeTag>
59 namespace Properties {
105 typedef Opm::FluidSystems::SinglePhase<Scalar , Fluid> type;
108 SET_PROP(ImmiscibleSinglePhaseModel, Fluid)
114 typedef Opm::LiquidPhase<Scalar, Opm::NullComponent<Scalar> > type;
119 SET_BOOL_PROP(ImmiscibleSinglePhaseModel, VtkWriteSaturations,
false);
120 SET_BOOL_PROP(ImmiscibleSinglePhaseModel, VtkWriteMobilities,
false);
121 SET_BOOL_PROP(ImmiscibleSinglePhaseModel, VtkWriteRelativePermeabilities,
false);
126 SET_PROP(ImmiscibleTwoPhaseModel, WettingPhase)
132 typedef Opm::LiquidPhase<Scalar, Opm::NullComponent<Scalar> > type;
135 SET_PROP(ImmiscibleTwoPhaseModel, NonwettingPhase)
141 typedef Opm::LiquidPhase<Scalar, Opm::NullComponent<Scalar> > type;
144 SET_PROP(ImmiscibleTwoPhaseModel, FluidSystem)
148 typedef typename GET_PROP_TYPE(TypeTag, WettingPhase) WettingPhase;
149 typedef typename GET_PROP_TYPE(TypeTag, NonwettingPhase) NonwettingPhase;
152 typedef Opm::FluidSystems::TwoPhaseImmiscible<Scalar, WettingPhase,
153 NonwettingPhase> type;
194 template <
class TypeTag>
195 class ImmiscibleModel
199 typedef typename GET_PROP_TYPE(TypeTag, Model) Implementation;
200 typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
202 typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
203 typedef typename GET_PROP_TYPE(TypeTag, Indices) Indices;
204 typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem;
206 enum { numComponents = FluidSystem::numComponents };
215 ImmiscibleModel(Simulator& simulator)
216 : ParentType(simulator)
234 {
return "immiscible"; }
242 if (!(s = EnergyModule::primaryVarName(pvIdx)).empty())
245 std::ostringstream oss;
247 if (pvIdx == Indices::pressure0Idx) {
248 oss <<
"pressure_" << FluidSystem::phaseName(0);
250 else if (Indices::saturation0Idx <= pvIdx
251 && pvIdx < Indices::saturation0Idx + numPhases - 1) {
252 unsigned phaseIdx = pvIdx - Indices::saturation0Idx;
253 oss <<
"saturation_" << FluidSystem::phaseName(phaseIdx);
267 if (!(s = EnergyModule::eqName(eqIdx)).empty())
270 std::ostringstream oss;
272 if (Indices::conti0EqIdx <= eqIdx && eqIdx < Indices::conti0EqIdx + numComponents)
273 oss <<
"conti_" << FluidSystem::phaseName(eqIdx - Indices::conti0EqIdx);
285 ParentType::updateBegin();
290 size_t nDof = this->numTotalDof();
291 for (
unsigned dofIdx = 0; dofIdx < nDof; ++ dofIdx) {
292 if (this->isLocalDof(dofIdx)) {
294 this->solution(0)[dofIdx][Indices::pressure0Idx];
305 assert(referencePressure_ > 0);
307 Scalar tmp = EnergyModule::primaryVarWeight(asImp_(), globalDofIdx, pvIdx);
311 if (Indices::pressure0Idx == pvIdx) {
312 return 10 / referencePressure_;
320 Scalar
eqWeight(
unsigned globalDofIdx,
unsigned eqIdx)
const 322 Scalar tmp = EnergyModule::eqWeight(asImp_(), globalDofIdx, eqIdx);
328 unsigned compIdx = eqIdx - Indices::conti0EqIdx;
329 assert(0 <= compIdx && compIdx <= numPhases);
336 void registerOutputModules_()
338 ParentType::registerOutputModules_();
345 const Implementation& asImp_()
const 346 {
return *
static_cast<const Implementation *
>(
this); }
348 mutable Scalar referencePressure_;
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition: immisciblemodel.hh:222
A fully-implicit multi-phase flow model which assumes immiscibility of the phases.
Definition: immisciblemodel.hh:55
#define SET_BOOL_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant boolean value.
Definition: propertysystem.hh:361
Contains the quantities which are are constant within a finite volume for the immiscible multi-phase ...
Contains the quantities which are are constant within a finite volume for the immiscible multi-phase ...
Definition: immiscibleintensivequantities.hh:50
Definition: baseauxiliarymodule.hh:37
static void registerParameters()
Register all run-time parameters for the Vtk output module.
Definition: vtkenergymodule.hh:101
Implements a vector representing rates of conserved quantities.
void updateBegin()
Called by the update() method before it tries to apply the newton method.
Definition: immisciblemodel.hh:283
Provides the auxiliary methods required for consideration of the energy equation. ...
Definition: energymodule.hh:59
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
Implements a vector representing rates of conserved quantities.
Definition: immiscibleratevector.hh:48
Contains the classes required to consider energy as a conservation quantity in a multi-phase module...
The indices for the isothermal multi-phase model.
#define NEW_TYPE_TAG(...)
Define a new type tag.
Definition: propertysystem.hh:169
The indices for the isothermal multi-phase model.
Definition: immiscibleindices.hh:42
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:486
Implements a boundary vector for the fully implicit multi-phase model which assumes immiscibility...
Definition: immiscibleboundaryratevector.hh:45
#define INHERITS_FROM(...)
Syntactic sugar for NEW_TYPE_TAG.
Definition: propertysystem.hh:230
VTK output module for quantities which make sense for models which assume thermal equilibrium...
Scalar primaryVarWeight(unsigned globalDofIdx, unsigned pvIdx) const
Definition: immisciblemodel.hh:303
std::string primaryVarName(unsigned pvIdx) const
Given an primary variable index, return a human readable name.
Definition: immisciblemodel.hh:239
Scalar eqWeight(unsigned globalDofIdx, unsigned eqIdx) const
Definition: immisciblemodel.hh:320
This class provides the data all quantities that are required to calculate the fluxes of the fluid ph...
Definition: immiscibleextensivequantities.hh:49
#define SET_PROP(EffTypeTagName, PropTagName)
Set a property for a specific type tag.
Definition: propertysystem.hh:297
std::string eqName(unsigned eqIdx) const
Given an equation index, return a human readable name.
Definition: immisciblemodel.hh:264
This class provides the data all quantities that are required to calculate the fluxes of the fluid ph...
static void registerParameters()
Register all run-time parameters for the immiscible model.
Definition: multiphasebasemodel.hh:147
static std::string name()
Definition: immisciblemodel.hh:233
Defines the properties required for the immiscible multi-phase model.
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
VTK output module for quantities which make sense for models which assume thermal equilibrium...
Definition: vtkenergymodule.hh:73
#define SET_TYPE_PROP(EffTypeTagName, PropTagName,...)
Set a property which defines a type.
Definition: propertysystem.hh:377
Represents the primary variables used by the immiscible multi-phase, model.
Represents the primary variables used by the immiscible multi-phase, model.
Definition: immiscibleprimaryvariables.hh:54
Implements a boundary vector for the fully implicit multi-phase model which assumes immiscibility...
Calculates the local residual of the immiscible multi-phase model.
Definition: immisciblelocalresidual.hh:45
Calculates the local residual of the immiscible multi-phase model.