Opm::BlackOilModel< TypeTag > Class Template Reference

A fully-implicit black-oil flow model. More...

#include <blackoilmodel.hh>

Inheritance diagram for Opm::BlackOilModel< TypeTag >:
Inheritance graph

Public Types

using Indices = GetPropType< TypeTag, Properties::Indices >
 
using FluidSystem = GetPropType< TypeTag, Properties::FluidSystem >
 
using PrimaryVariables = GetPropType< TypeTag, Properties::PrimaryVariables >
 
using LocalResidual = GetPropType< TypeTag, Properties::LocalResidual >
 

Public Member Functions

 BlackOilModel (Simulator &simulator)
 
std::string primaryVarName (int pvIdx) const
 Given an primary variable index, return a human readable name. More...
 
std::string eqName (int eqIdx) const
 Given an equation index, return a human readable name. More...
 
Scalar primaryVarWeight (unsigned globalDofIdx, unsigned pvIdx) const
 Returns the relative weight of a primary variable for calculating relative errors. More...
 
Scalar eqWeight (unsigned globalDofIdx, unsigned eqIdx) const
 Returns the relative weight of an equation. More...
 
void setEqWeight (unsigned eqIdx, Scalar value)
 
template<class DofEntity >
void serializeEntity (std::ostream &outstream, const DofEntity &dof)
 Write the current solution for a degree of freedom to a restart file. More...
 
template<class DofEntity >
void deserializeEntity (std::istream &instream, const DofEntity &dof)
 Reads the current solution variables for a degree of freedom from a restart file. More...
 
template<class Restarter >
void deserialize (Restarter &res)
 Deserializes the state of the model. More...
 
template<class Context >
void supplementInitialSolution_ (PrimaryVariables &priVars, const Context &context, unsigned dofIdx, unsigned timeIdx)
 
void registerOutputModules_ ()
 
bool phaseIsConsidered (unsigned) const
 Returns true iff a fluid phase is used by the model. More...
 
void globalPhaseStorage (EqVector &storage, unsigned phaseIdx)
 Compute the total storage inside one phase of all conservation quantities. More...
 

Static Public Member Functions

static void registerParameters ()
 Register all run-time parameters for the immiscible model. More...
 
static std::string name ()
 

Detailed Description

template<class TypeTag>
class Opm::BlackOilModel< TypeTag >

A fully-implicit black-oil flow model.

The black-oil model is a three-phase, three-component model widely used for oil reservoir simulation. The phases are denoted by lower index $\alpha \in \{ w, g, o \}$ ("water", "gas" and "oil") and the components by upper index $\kappa \in \{ W, G, O \}$ ("Water", "Gas" and "Oil"). The model assumes partial miscibility:

  • Water and the gas phases are immisicible and are assumed to be only composed of the water and gas components respectively-
  • The oil phase is assumed to be a mixture of the gas and the oil components.

The densities of the phases are determined by so-called formation volume factors:

\[
   B_\alpha := \frac{\varrho_\alpha(1\,\text{bar})}{\varrho_\alpha(p_\alpha)}
   \]

Since the gas and water phases are assumed to be immiscible, this is sufficient to calculate their density. For the formation volume factor of the the oil phase $B_o$ determines the density of saturated oil, i.e. the density of the oil phase if some gas phase is present.

The composition of the oil phase is given by the gas dissolution factor $R_s$, which defined as the volume of gas at atmospheric pressure that is dissolved in a given amount of oil at reservoir pressure:

\[
   R_s := \frac{\varrho_{o}^G}{\varrho_o^O}\;.
   \]

This allows to calculate all quantities required for the mass-conservation equations for each component, i.e.

\[
   \sum_\alpha \frac{\partial\;\phi c_\alpha^\kappa S_\alpha }{\partial t}
   - \sum_\alpha \mathrm{div} \left\{ c_\alpha^\kappa \mathbf{v}_\alpha \right\}
   - q^\kappa = 0 \;,
   \]

where $\mathrm{v}_\alpha$ is the filter velocity of the phase $\alpha$.

By default $\mathrm{v}_\alpha$ is determined by using the standard multi-phase Darcy approach, i.e.

\[ \mathbf{v}_\alpha = - \frac{k_{r\alpha}}{\mu_\alpha} \mathbf{K}
 *\left(\mathbf{grad}\, p_\alpha - \varrho_{\alpha} \mathbf{g} \right) \;, \]

although the actual approach which is used can be specified via the FluxModule property. For example, the velocity model can by changed to the Forchheimer approach by

template<class TypeTag>
struct FluxModule<TypeTag, TTag::MyProblemTypeTag> { using type = Opm::ForchheimerFluxModule<TypeTag>; };
Specifies a flux module which uses the Forchheimer relation.
Definition: forchheimerfluxmodule.hh:62

The primary variables used by this model are:

  • The pressure of the phase with the lowest index
  • The two saturations of the phases with the lowest indices

Member Typedef Documentation

◆ FluidSystem

template<class TypeTag >
using Opm::BlackOilModel< TypeTag >::FluidSystem = GetPropType<TypeTag, Properties::FluidSystem>

◆ Indices

template<class TypeTag >
using Opm::BlackOilModel< TypeTag >::Indices = GetPropType<TypeTag, Properties::Indices>

◆ LocalResidual

template<class TypeTag >
using Opm::BlackOilModel< TypeTag >::LocalResidual = GetPropType<TypeTag, Properties::LocalResidual>

◆ PrimaryVariables

template<class TypeTag >
using Opm::BlackOilModel< TypeTag >::PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>

Constructor & Destructor Documentation

◆ BlackOilModel()

template<class TypeTag >
Opm::BlackOilModel< TypeTag >::BlackOilModel ( Simulator &  simulator)
inline

Member Function Documentation

◆ deserialize()

template<class TypeTag >
template<class Restarter >
void Opm::BlackOilModel< TypeTag >::deserialize ( Restarter &  res)
inline

Deserializes the state of the model.

Template Parameters
RestarterThe type of the serializer class
Parameters
resThe serializer object

◆ deserializeEntity()

template<class TypeTag >
template<class DofEntity >
void Opm::BlackOilModel< TypeTag >::deserializeEntity ( std::istream &  instream,
const DofEntity &  dof 
)
inline

Reads the current solution variables for a degree of freedom from a restart file.

Parameters
instreamThe stream from which the vertex data should be deserialized from
dofThe Dune entity which's data should be deserialized

References Opm::BlackOilEnergyModule< TypeTag, enableEnergyV >::deserializeEntity(), Opm::BlackOilExtboModule< TypeTag, enableExtboV >::deserializeEntity(), Opm::BlackOilPolymerModule< TypeTag, enablePolymerV >::deserializeEntity(), and Opm::BlackOilSolventModule< TypeTag, enableSolventV >::deserializeEntity().

◆ eqName()

◆ eqWeight()

template<class TypeTag >
Scalar Opm::BlackOilModel< TypeTag >::eqWeight ( unsigned  globalDofIdx,
unsigned  eqIdx 
) const
inline

Returns the relative weight of an equation.

Parameters
globalVertexIdxThe global index of the vertex
eqIdxThe index of the equation

◆ globalPhaseStorage()

template<class TypeTag >
void Opm::MultiPhaseBaseModel< TypeTag >::globalPhaseStorage ( EqVector &  storage,
unsigned  phaseIdx 
)
inlineinherited

Compute the total storage inside one phase of all conservation quantities.

Parameters
storageStores the total amount of each conserved quantity inside the domain.
phaseIdxThe index of the fluid phase of interest.

References Opm::ThreadedEntityIterator< GridView, codim >::beginParallel(), Opm::ThreadedEntityIterator< GridView, codim >::increment(), Opm::ThreadedEntityIterator< GridView, codim >::isFinished(), and Opm::ThreadManager< TypeTag >::threadId().

◆ name()

template<class TypeTag >
static std::string Opm::BlackOilModel< TypeTag >::name ( )
inlinestatic

◆ phaseIsConsidered()

template<class TypeTag >
bool Opm::MultiPhaseBaseModel< TypeTag >::phaseIsConsidered ( unsigned  ) const
inlineinherited

Returns true iff a fluid phase is used by the model.

Parameters
phaseIdxThe index of the fluid phase in question

◆ primaryVarName()

◆ primaryVarWeight()

◆ registerOutputModules_()

◆ registerParameters()

◆ serializeEntity()

template<class TypeTag >
template<class DofEntity >
void Opm::BlackOilModel< TypeTag >::serializeEntity ( std::ostream &  outstream,
const DofEntity &  dof 
)
inline

Write the current solution for a degree of freedom to a restart file.

Parameters
outstreamThe stream into which the vertex data should be serialized to
dofThe Dune entity which's data should be serialized

References Opm::BlackOilEnergyModule< TypeTag, enableEnergyV >::serializeEntity(), Opm::BlackOilExtboModule< TypeTag, enableExtboV >::serializeEntity(), Opm::BlackOilPolymerModule< TypeTag, enablePolymerV >::serializeEntity(), and Opm::BlackOilSolventModule< TypeTag, enableSolventV >::serializeEntity().

◆ setEqWeight()

template<class TypeTag >
void Opm::BlackOilModel< TypeTag >::setEqWeight ( unsigned  eqIdx,
Scalar  value 
)
inline

◆ supplementInitialSolution_()

template<class TypeTag >
template<class Context >
void Opm::BlackOilModel< TypeTag >::supplementInitialSolution_ ( PrimaryVariables priVars,
const Context &  context,
unsigned  dofIdx,
unsigned  timeIdx 
)
inline

The documentation for this class was generated from the following file: