ptflash/flashmodel.hh File Reference
#include <opm/material/densead/Math.hpp>
#include "flashproperties.hh"
#include "flashprimaryvariables.hh"
#include "flashlocalresidual.hh"
#include <opm/models/flash/flashratevector.hh>
#include <opm/models/flash/flashboundaryratevector.hh>
#include "flashintensivequantities.hh"
#include <opm/models/flash/flashextensivequantities.hh>
#include "flashindices.hh"
#include "flashnewtonmethod.hh"
#include <opm/models/common/multiphasebasemodel.hh>
#include <opm/models/common/energymodule.hh>
#include <opm/models/io/vtkcompositionmodule.hh>
#include <opm/models/io/vtkenergymodule.hh>
#include <opm/models/io/vtkdiffusionmodule.hh>
#include <opm/models/io/vtkptflashmodule.hh>
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/constraintsolvers/PTFlash.hpp>
#include <sstream>
#include <string>
Include dependency graph for ptflash/flashmodel.hh:

Go to the source code of this file.

Classes

struct  Opm::Properties::TTag::FlashModel
 The type tag for the isothermal single phase problems. More...
 
struct  Opm::Properties::LocalResidual< TypeTag, TTag::FlashModel >
 Use the FlashLocalResidual function for the flash model. More...
 
struct  Opm::Properties::NewtonMethod< TypeTag, TTag::FlashModel >
 Use the PT flash specific newton method for the flash model. More...
 
struct  Opm::Properties::FlashSolver< TypeTag, TTag::FlashModel >
 Use the NCP flash solver by default. More...
 
struct  Opm::Properties::FlashTolerance< TypeTag, TTag::FlashModel >
 Let the flash solver choose its tolerance by default. More...
 
struct  Opm::Properties::FlashVerbosity< TypeTag, TTag::FlashModel >
 
struct  Opm::Properties::FlashTwoPhaseMethod< TypeTag, TTag::FlashModel >
 
struct  Opm::Properties::Model< TypeTag, TTag::FlashModel >
 the Model property More...
 
struct  Opm::Properties::PrimaryVariables< TypeTag, TTag::FlashModel >
 the PrimaryVariables property More...
 
struct  Opm::Properties::RateVector< TypeTag, TTag::FlashModel >
 the RateVector property More...
 
struct  Opm::Properties::BoundaryRateVector< TypeTag, TTag::FlashModel >
 the BoundaryRateVector property More...
 
struct  Opm::Properties::IntensiveQuantities< TypeTag, TTag::FlashModel >
 the IntensiveQuantities property More...
 
struct  Opm::Properties::ExtensiveQuantities< TypeTag, TTag::FlashModel >
 the ExtensiveQuantities property More...
 
struct  Opm::Properties::Indices< TypeTag, TTag::FlashModel >
 The indices required by the flash-baseed isothermal compositional model. More...
 
struct  Opm::Properties::EnableIntensiveQuantityCache< TypeTag, TTag::FlashModel >
 
struct  Opm::Properties::EnableThermodynamicHints< TypeTag, TTag::FlashModel >
 
struct  Opm::Properties::EnableDiffusion< TypeTag, TTag::FlashModel >
 
struct  Opm::Properties::EnableEnergy< TypeTag, TTag::FlashModel >
 Disable the energy equation by default. More...
 
class  Opm::FlashModel< TypeTag >
 A compositional multi-phase model based on flash-calculations. More...
 

Namespaces

namespace  Opm
 
namespace  Opm::Properties
 
namespace  Opm::Properties::TTag
 The generic type tag for problems using the immiscible multi-phase model.
 

Detailed Description

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

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 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.

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

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

\[
   \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, 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.