All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Ewoms::BlackOilModel< TypeTag > Class Template Reference

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

#include <blackoilmodel.hh>

Inheritance diagram for Ewoms::BlackOilModel< TypeTag >:
Ewoms::MultiPhaseBaseModel< TypeTag >

Public Member Functions

 BlackOilModel (Simulator &simulator)
 
void finishInit ()
 Apply the initial conditions to the model. More...
 
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 OPM_UNUSED) const
 Returns the relative weight of an equation. More...
 
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...
 
Scalar maxOilSaturation (unsigned globalDofIdx) const
 Returns an elements maximum oil phase saturation observed during the simulation. More...
 
void setMaxOilSaturation (const Scalar value, unsigned globalDofIdx)
 Sets an elements maximum oil phase saturation observed during the simulation (used for restarting from UNRST-files).
 
void updateMaxOilSaturations ()
 Update the maximum oil saturation observed during the simulation for all elements. More...
 
template<class Context >
void supplementInitialSolution_ (PrimaryVariables &priVars, const Context &context, unsigned dofIdx, unsigned timeIdx)
 
void registerOutputModules_ ()
 
- Public Member Functions inherited from Ewoms::MultiPhaseBaseModel< TypeTag >
 MultiPhaseBaseModel (Simulator &simulator)
 
void finishInit ()
 Apply the initial conditions to the model. More...
 
bool phaseIsConsidered (unsigned phaseIdx OPM_UNUSED) 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...
 
void registerOutputModules_ ()
 

Static Public Member Functions

static void registerParameters ()
 Register all run-time parameters for the immiscible model.
 
static std::string name ()
 
- Static Public Member Functions inherited from Ewoms::MultiPhaseBaseModel< TypeTag >
static void registerParameters ()
 Register all run-time parameters for the immiscible model.
 

Detailed Description

template<class TypeTag>
class Ewoms::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 sufficint 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

* SET_TYPE_PROP(MyProblemTypeTag, FluxModule, Ewoms::ForchheimerFluxModule<TypeTag>);
*

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 Function Documentation

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

Deserializes the state of the model.

Template Parameters
RestarterThe type of the serializer class
Parameters
resThe serializer object
template<class TypeTag >
template<class DofEntity >
void Ewoms::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
template<class TypeTag >
std::string Ewoms::BlackOilModel< TypeTag >::eqName ( int  eqIdx) const
inline

Given an equation index, return a human readable name.

Parameters
eqIdxThe index of the conservation equation of interest.
template<class TypeTag >
Scalar Ewoms::BlackOilModel< TypeTag >::eqWeight ( unsigned  globalDofIdx,
unsigned eqIdx  OPM_UNUSED 
) const
inline

Returns the relative weight of an equation.

Parameters
globalVertexIdxThe global index of the vertex
eqIdxThe index of the equation
template<class TypeTag >
void Ewoms::BlackOilModel< TypeTag >::finishInit ( )
inline

Apply the initial conditions to the model.

template<class TypeTag >
Scalar Ewoms::BlackOilModel< TypeTag >::maxOilSaturation ( unsigned  globalDofIdx) const
inline

Returns an elements maximum oil phase saturation observed during the simulation.

This is a bit of a hack from the conceptional point of view, but it is required to match the results of the 'flow' and ECLIPSE 100 simulators.

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

template<class TypeTag >
std::string Ewoms::BlackOilModel< TypeTag >::primaryVarName ( int  pvIdx) const
inline

Given an primary variable index, return a human readable name.

Parameters
pvIdxThe index of the primary variable of interest.
template<class TypeTag >
Scalar Ewoms::BlackOilModel< TypeTag >::primaryVarWeight ( unsigned  globalDofIdx,
unsigned  pvIdx 
) const
inline

Returns the relative weight of a primary variable for calculating relative errors.

Parameters
globalDofIdxThe global index of the degree of freedom
pvIdxThe index of the primary variable
template<class TypeTag >
template<class DofEntity >
void Ewoms::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
template<class TypeTag >
void Ewoms::BlackOilModel< TypeTag >::updateMaxOilSaturations ( )
inline

Update the maximum oil saturation observed during the simulation for all elements.

This method must be called manually by the problem because depending on the exact simulation it sometimes needs to be called after a time step or before an episode starts.


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