Ewoms::FlashModel< TypeTag > Class Template Reference

A compositional multi-phase model based on flash-calculations. More...

#include <flashmodel.hh>

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

Public Member Functions

 FlashModel (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 (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 registerOutputModules_ ()
 
void finishInit ()
 Apply the initial conditions to the model. More...
 
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::FlashModel< TypeTag >

A compositional multi-phase model based on flash-calculations.

This model assumes a flow of $M \geq 1$ fluid phases $\alpha$, each of which is assumed to be a mixture $N \geq M$ chemical species (denoted by the upper index $\kappa$).

By default, the standard multi-phase Darcy approach is used to determine the velocity, 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 core of the model is the conservation mass of each component by means of the equation

\[ \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 \;. \]

To determine the quanties that occur in the equations above, this model uses flash calculations. A flash solver starts with the total mass or molar mass per volume for each component and, calculates the compositions, saturations and pressures of all phases at a given temperature. For this the flash solver has to use some model assumptions internally. (Often these are the same primary variable switching or NCP assumptions as used by the other fully implicit compositional multi-phase models provided by eWoms.)

Using flash calculations for the flow model has some disadvantages:

  • The accuracy of the flash solver needs to be sufficient to calculate the parital derivatives using numerical differentiation which are required for the Newton scheme.
  • Flash calculations tend to be quite computationally expensive and are often numerically unstable.

It is thus adviced to increase the target tolerance of the Newton scheme or a to use type for scalar values which exhibits higher precision than the standard double (e.g. quad) if this model ought to be used.

The model uses the following primary variables:

  • The total molar concentration of each component: $c^\kappa = \sum_\alpha S_\alpha x_\alpha^\kappa \rho_{mol, \alpha}$
  • The absolute temperature $T$ in Kelvins if the energy equation enabled.

Constructor & Destructor Documentation

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

Member Function Documentation

template<class TypeTag >
std::string Ewoms::FlashModel< 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::FlashModel< 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::MultiPhaseBaseModel< TypeTag >::finishInit ( )
inlineinherited

Apply the initial conditions to the model.

References EWOMS_GET_PARAM.

Referenced by Ewoms::BlackOilModel< TypeTag >::finishInit(), and Ewoms::NcpModel< 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::FlashModel< 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::FlashModel< 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::FlashModel< 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::FlashModel< TypeTag >::registerOutputModules_ ( )
inline

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