Ewoms::BlackOilModel< TypeTag > Class Template Reference

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

#include <blackoilmodel.hh>

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

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 (int globalDofIdx, int pvIdx) const
 Returns the relative weight of a primary variable for calculating relative errors. More...
 
Scalar eqWeight (int globalDofIdx, int eqIdx) const
 Returns the relative weight of an equation. More...
 
void updateBegin ()
 Called by the update() method before it tries to apply the newton method. This is primary a hook which the actual model can overload. More...
 
void switchPrimaryVars_ ()
 
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, int dofIdx, int timeIdx)
 
void registerOutputModules_ ()
 
bool phaseIsConsidered (int phaseIdx) const
 Returns true iff a fluid phase is used by the model. More...
 
void globalPhaseStorage (EqVector &storage, int 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 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

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

Constructor & Destructor Documentation

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

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 ( int  globalDofIdx,
int  eqIdx 
) 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.

References Ewoms::MultiPhaseBaseModel< TypeTag >::finishInit().

template<class TypeTag >
void Ewoms::MultiPhaseBaseModel< TypeTag >::globalPhaseStorage ( EqVector &  storage,
int  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 Ewoms::ThreadedEntityIterator< GridView, codim >::beginParallel(), Ewoms::ThreadedEntityIterator< GridView, codim >::increment(), Ewoms::ThreadedEntityIterator< GridView, codim >::isFinished(), Ewoms::ThreadManager< TypeTag >::threadId(), and OmpMutex::unlock().

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

template<class TypeTag >
bool Ewoms::MultiPhaseBaseModel< TypeTag >::phaseIsConsidered ( int  phaseIdx) const
inlineinherited

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

Parameters
phaseIdxThe index of the fluid phase in question
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 ( int  globalDofIdx,
int  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 >
void Ewoms::BlackOilModel< TypeTag >::registerOutputModules_ ( )
inline
template<class TypeTag >
static void Ewoms::BlackOilModel< TypeTag >::registerParameters ( )
inlinestatic
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 >
template<class Context >
void Ewoms::BlackOilModel< TypeTag >::supplementInitialSolution_ ( PrimaryVariables &  priVars,
const Context &  context,
int  dofIdx,
int  timeIdx 
)
inline
template<class TypeTag >
void Ewoms::BlackOilModel< TypeTag >::switchPrimaryVars_ ( )
inline
template<class TypeTag >
void Ewoms::BlackOilModel< TypeTag >::updateBegin ( )
inline

Called by the update() method before it tries to apply the newton method. This is primary a hook which the actual model can overload.


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