3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Types | Public Member Functions | Protected Member Functions | List of all members
Dumux::ImmiscibleFlash< Scalar, FluidSystem > Class Template Reference

Determines the pressures and saturations of all fluid phases given the total mass of all components. More...

#include <dumux/material/constraintsolvers/immiscibleflash.hh>

Description

template<class Scalar, class FluidSystem>
class Dumux::ImmiscibleFlash< Scalar, FluidSystem >

Determines the pressures and saturations of all fluid phases given the total mass of all components.

In a N-phase, N-component context, we have the following unknowns if assuming immiscibility:

This sums up to 2*N unknowns. On the equations side of things, we have:

this also sums up to 2*N. We include the capillary pressures and the sum of the saturations explicitly. This means that we only solve for the first pressure and N-1 saturations.

If a fluid phase is incompressible, the pressure cannot determined by this, though. In this case the original pressure is kept, and the saturation of the phase is calculated by dividing the global molarity of the component by the phase density.

Public Types

using ComponentVector = Dune::FieldVector< Scalar, numComponents >
 

Public Member Functions

 ImmiscibleFlash (int wettingPhaseIdx=0)
 Contruct a new flash. More...
 
template<class FluidState >
void guessInitial (FluidState &fluidState, ParameterCache &paramCache, const ComponentVector &globalMolarities)
 Guess initial values for all quantities. More...
 
template<class MaterialLaw , class FluidState >
void solve (FluidState &fluidState, ParameterCache &paramCache, const MaterialLaw &material, const ComponentVector &globalMolarities)
 Calculates the chemical equilibrium from the component fugacities in a phase. More...
 

Protected Member Functions

template<class FluidState >
void printFluidState_ (const FluidState &fs)
 
template<class MaterialLaw , class FluidState >
void linearize_ (Matrix &J, Vector &b, FluidState &fluidState, ParameterCache &paramCache, const MaterialLaw &material, const ComponentVector &globalMolarities)
 
template<class FluidState >
void calculateDefect_ (Vector &b, const FluidState &fluidStateEval, const FluidState &fluidState, const ComponentVector &globalMolarities)
 
template<class MaterialLaw , class FluidState >
Scalar update_ (FluidState &fluidState, ParameterCache &paramCache, const MaterialLaw &material, const Vector &deltaX)
 
template<class MaterialLaw , class FluidState >
void completeFluidState_ (FluidState &fluidState, ParameterCache &paramCache, const MaterialLaw &material)
 
bool isPressureIdx_ (int pvIdx)
 
bool isSaturationIdx_ (int pvIdx)
 
template<class FluidState >
Scalar getQuantity_ (const FluidState &fs, int pvIdx)
 
template<class MaterialLaw , class FluidState >
void setQuantity_ (FluidState &fs, ParameterCache &paramCache, const MaterialLaw &material, int pvIdx, Scalar value)
 
template<class FluidState >
void setQuantityRaw_ (FluidState &fs, int pvIdx, Scalar value)
 
template<class FluidState >
Scalar quantityWeight_ (const FluidState &fs, int pvIdx)
 

Member Typedef Documentation

◆ ComponentVector

template<class Scalar , class FluidSystem >
using Dumux::ImmiscibleFlash< Scalar, FluidSystem >::ComponentVector = Dune::FieldVector<Scalar, numComponents>

Constructor & Destructor Documentation

◆ ImmiscibleFlash()

template<class Scalar , class FluidSystem >
Dumux::ImmiscibleFlash< Scalar, FluidSystem >::ImmiscibleFlash ( int  wettingPhaseIdx = 0)
inlineexplicit

Contruct a new flash.

Parameters
wettingPhaseIdxthe phase index of the wetting phase

Member Function Documentation

◆ calculateDefect_()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::calculateDefect_ ( Vector &  b,
const FluidState &  fluidStateEval,
const FluidState &  fluidState,
const ComponentVector globalMolarities 
)
inlineprotected

◆ completeFluidState_()

template<class Scalar , class FluidSystem >
template<class MaterialLaw , class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::completeFluidState_ ( FluidState &  fluidState,
ParameterCache &  paramCache,
const MaterialLaw &  material 
)
inlineprotected

◆ getQuantity_()

template<class Scalar , class FluidSystem >
template<class FluidState >
Scalar Dumux::ImmiscibleFlash< Scalar, FluidSystem >::getQuantity_ ( const FluidState &  fs,
int  pvIdx 
)
inlineprotected

◆ guessInitial()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::guessInitial ( FluidState &  fluidState,
ParameterCache &  paramCache,
const ComponentVector globalMolarities 
)
inline

Guess initial values for all quantities.

Parameters
fluidStateThermodynamic state of the fluids
paramCacheContainer for cache parameters
globalMolarities

◆ isPressureIdx_()

template<class Scalar , class FluidSystem >
bool Dumux::ImmiscibleFlash< Scalar, FluidSystem >::isPressureIdx_ ( int  pvIdx)
inlineprotected

◆ isSaturationIdx_()

template<class Scalar , class FluidSystem >
bool Dumux::ImmiscibleFlash< Scalar, FluidSystem >::isSaturationIdx_ ( int  pvIdx)
inlineprotected

◆ linearize_()

template<class Scalar , class FluidSystem >
template<class MaterialLaw , class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::linearize_ ( Matrix &  J,
Vector &  b,
FluidState &  fluidState,
ParameterCache &  paramCache,
const MaterialLaw &  material,
const ComponentVector globalMolarities 
)
inlineprotected

◆ printFluidState_()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::printFluidState_ ( const FluidState &  fs)
inlineprotected

◆ quantityWeight_()

template<class Scalar , class FluidSystem >
template<class FluidState >
Scalar Dumux::ImmiscibleFlash< Scalar, FluidSystem >::quantityWeight_ ( const FluidState &  fs,
int  pvIdx 
)
inlineprotected

◆ setQuantity_()

template<class Scalar , class FluidSystem >
template<class MaterialLaw , class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::setQuantity_ ( FluidState &  fs,
ParameterCache &  paramCache,
const MaterialLaw &  material,
int  pvIdx,
Scalar  value 
)
inlineprotected

◆ setQuantityRaw_()

template<class Scalar , class FluidSystem >
template<class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::setQuantityRaw_ ( FluidState &  fs,
int  pvIdx,
Scalar  value 
)
inlineprotected

◆ solve()

template<class Scalar , class FluidSystem >
template<class MaterialLaw , class FluidState >
void Dumux::ImmiscibleFlash< Scalar, FluidSystem >::solve ( FluidState &  fluidState,
ParameterCache &  paramCache,
const MaterialLaw &  material,
const ComponentVector globalMolarities 
)
inline

Calculates the chemical equilibrium from the component fugacities in a phase.

Parameters
fluidStateThermodynamic state of the fluids
paramCacheContainer for cache parameters
globalMolarities
materialThe material law object

The phase's fugacities must already be set.

◆ update_()

template<class Scalar , class FluidSystem >
template<class MaterialLaw , class FluidState >
Scalar Dumux::ImmiscibleFlash< Scalar, FluidSystem >::update_ ( FluidState &  fluidState,
ParameterCache &  paramCache,
const MaterialLaw &  material,
const Vector &  deltaX 
)
inlineprotected

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