Loading...
Searching...
No Matches
Opm::FlashModel< TypeTag > Class Template Reference

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

`#include <flashmodel.hh>`

Inheritance diagram for Opm::FlashModel< TypeTag >:

## Public Member Functions

| FlashModel (Simulator &simulator)
std::string | primaryVarName (unsigned pvIdx) const
| Given an primary variable index, return a human readable name.
std::string | eqName (unsigned eqIdx) const
| Given an equation index, return a human readable name.
Scalar | primaryVarWeight (unsigned globalDofIdx, unsigned pvIdx) const
| Returns the relative weight of a primary variable for calculating relative errors.
Scalar | eqWeight (unsigned globalDofIdx, unsigned eqIdx) const
| Returns the relative weight of an equation.
void | registerOutputModules_ ()
| FlashModel (Simulator &simulator)
std::string | primaryVarName (unsigned pvIdx) const
| Given an primary variable index, return a human readable name.
std::string | eqName (unsigned eqIdx) const
| Given an equation index, return a human readable name.
void | registerOutputModules_ ()
Public Member Functions inherited from Opm::MultiPhaseBaseModel< TypeTag >
| MultiPhaseBaseModel (Simulator &simulator)
bool | phaseIsConsidered (unsigned) const
| Returns true iff a fluid phase is used by the model.
void | globalPhaseStorage (EqVector &storage, unsigned phaseIdx)
| Compute the total storage inside one phase of all conservation quantities.
void | registerOutputModules_ ()

## Static Public Member Functions

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

## Detailed Description

template<class TypeTag>
class Opm::FlashModel< TypeTag >

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

This model assumes a flow of fluid phases , each of which is assumed to be a mixture chemical species (denoted by the upper index ).

By default, the standard multi-phase Darcy approach is used to determine the velocity, i.e.

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>; };
Opm::ForchheimerFluxModule
Specifies a flux module which uses the Forchheimer relation.
Definition forchheimerfluxmodule.hh:66

The core of the model is the conservation mass of each component by means of the equation

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:
- The absolute temperature $T$ in Kelvins if the energy equation enabled.

This model assumes a flow of fluid phases , each of which is assumed to be a mixture chemical species (denoted by the upper index ).

By default, the standard multi-phase Darcy approach is used to determine the velocity, i.e.

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>; };

The core of the model is the conservation mass of each component by means of the equation

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, saturation and pressures of all phases at a given temperature. For this the flash solver has to use some model assumptions internally. Here a constant pressure, constant temperature, two-phase flash calculation method is used.

## Member Function Documentation

## eqName() [1/2]

template<class TypeTag>

std::string Opm::FlashModel< TypeTag >::eqName | ( | unsigned | eqIdx | ) | const

inline

Given an equation index, return a human readable name.

Parameters

  eqIdx | The index of the conservation equation of interest.

## eqName() [2/2]

template<class TypeTag>

std::string Opm::FlashModel< TypeTag >::eqName | ( | unsigned | eqIdx | ) | const

inline

Given an equation index, return a human readable name.

Parameters

  eqIdx | The index of the conservation equation of interest.

## eqWeight()

template<class TypeTag>

Scalar Opm::FlashModel< TypeTag >::eqWeight | ( | unsigned | globalDofIdx,
|  | unsigned | eqIdx ) const

inline

Returns the relative weight of an equation.

Parameters

  globalVertexIdx | The global index of the vertex
  eqIdx | The index of the equation
  globalDofIdx | Global index
  eqIdx | Equation index

## name()

template<class TypeTag>

std::string Opm::FlashModel< TypeTag >::name | ( |  | ) |

inline static

## primaryVarName() [1/2]

template<class TypeTag>

std::string Opm::FlashModel< TypeTag >::primaryVarName | ( | unsigned | pvIdx | ) | const

inline

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

Parameters

  pvIdx | The index of the primary variable of interest.

## primaryVarName() [2/2]

template<class TypeTag>

std::string Opm::FlashModel< TypeTag >::primaryVarName | ( | unsigned | pvIdx | ) | const

inline

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

Parameters

  pvIdx | The index of the primary variable of interest.

## primaryVarWeight()

template<class TypeTag>

Scalar Opm::FlashModel< TypeTag >::primaryVarWeight | ( | unsigned | globalDofIdx,
|  | unsigned | pvIdx ) const

inline

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

Parameters

  globalDofIdx | The global index of the degree of freedom
  pvIdx | The index of the primary variable

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

- opm/models/flash/flashmodel.hh
- opm/models/ptflash/flashmodel.hh