flashmodel.hh File Reference

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

#include <opm/material/localad/Math.hpp>
#include "flashproperties.hh"
#include "flashprimaryvariables.hh"
#include "flashlocalresidual.hh"
#include "flashratevector.hh"
#include "flashboundaryratevector.hh"
#include "flashintensivequantities.hh"
#include "flashextensivequantities.hh"
#include "flashindices.hh"
#include <ewoms/models/common/multiphasebasemodel.hh>
#include <ewoms/models/common/energymodule.hh>
#include <ewoms/io/vtkcompositionmodule.hh>
#include <ewoms/io/vtkenergymodule.hh>
#include <ewoms/io/vtkdiffusionmodule.hh>
#include <opm/material/fluidmatrixinteractions/NullMaterial.hpp>
#include <opm/material/fluidmatrixinteractions/MaterialTraits.hpp>
#include <opm/material/constraintsolvers/NcpFlash.hpp>
#include <sstream>
#include <string>
Include dependency graph for flashmodel.hh:

Go to the source code of this file.

Classes

class  Ewoms::FlashModel< TypeTag >
 A compositional multi-phase model based on flash-calculations. More...
 
class  Ewoms::FlashModel< TypeTag >
 A compositional multi-phase model based on flash-calculations. More...
 

Namespaces

 Ewoms
 
 Ewoms::Properties
 

Functions

 Ewoms::Properties::NEW_TYPE_TAG (FlashModel, INHERITS_FROM(MultiPhaseBaseModel, VtkComposition, VtkEnergy, VtkDiffusion))
 The type tag for the isothermal single phase problems. More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, LocalResidual, Ewoms::FlashLocalResidual< TypeTag >)
 Use the FlashLocalResidual function for the flash model. More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, FlashSolver, Opm::NcpFlash< typename GET_PROP_TYPE(TypeTag, Scalar), typename GET_PROP_TYPE(TypeTag, FluidSystem)>)
 Use the NCP flash solver by default. More...
 
 Ewoms::Properties::SET_SCALAR_PROP (FlashModel, FlashTolerance, 0.0)
 Let the flash solver choose its tolerance by default. More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, Model, Ewoms::FlashModel< TypeTag >)
 the Model property More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, PrimaryVariables, Ewoms::FlashPrimaryVariables< TypeTag >)
 the PrimaryVariables property More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, RateVector, Ewoms::FlashRateVector< TypeTag >)
 the RateVector property More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, BoundaryRateVector, Ewoms::FlashBoundaryRateVector< TypeTag >)
 the BoundaryRateVector property More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, IntensiveQuantities, Ewoms::FlashIntensiveQuantities< TypeTag >)
 the IntensiveQuantities property More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, ExtensiveQuantities, Ewoms::FlashExtensiveQuantities< TypeTag >)
 the ExtensiveQuantities property More...
 
 Ewoms::Properties::SET_TYPE_PROP (FlashModel, Indices, Ewoms::FlashIndices< TypeTag, 0 >)
 The indices required by the flash-baseed isothermal compositional model. More...
 
 Ewoms::Properties::SET_BOOL_PROP (FlashModel, EnableIntensiveQuantityCache, true)
 
 Ewoms::Properties::SET_BOOL_PROP (FlashModel, EnableThermodynamicHints, true)
 
 Ewoms::Properties::SET_BOOL_PROP (FlashModel, EnableDiffusion, false)
 
 Ewoms::Properties::SET_BOOL_PROP (FlashModel, EnableEnergy, false)
 Disable the energy equation by default. More...
 

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

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.