Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > Class Template Reference

A fluid system for two-phase models assuming immiscibility and thermodynamic equilibrium. More...

#include <TwoPhaseImmiscibleFluidSystem.hpp>

Inheritance diagram for Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >:
Inheritance graph

Classes

struct  ParameterCache
 

Public Types

typedef Scalar Scalar
 The type used for scalar quantities. More...
 

Static Public Member Functions

static const char * phaseName (unsigned phaseIdx)
 Return the human readable name of a fluid phase. More...
 
static bool isLiquid (unsigned phaseIdx)
 Return whether a phase is liquid. More...
 
static bool isCompressible (unsigned phaseIdx)
 Returns true if and only if a fluid phase is assumed to be compressible. More...
 
static bool isIdealGas (unsigned phaseIdx)
 Returns true if and only if a fluid phase is assumed to be an ideal gas. More...
 
static bool isIdealMixture (unsigned)
 Returns true if and only if a fluid phase is assumed to be an ideal mixture. More...
 
static const char * componentName (unsigned compIdx)
 Return the human readable name of a component. More...
 
static Scalar molarMass (unsigned compIdx)
 Return the molar mass of a component in [kg/mol]. More...
 
static Scalar criticalTemperature (unsigned compIdx)
 Critical temperature of a component [K]. More...
 
static Scalar criticalPressure (unsigned compIdx)
 Critical pressure of a component [Pa]. More...
 
static Scalar acentricFactor (unsigned compIdx)
 The acentric factor of a component []. More...
 
static void init ()
 Initialize the fluid system's static parameters. More...
 
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval density (const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
 Calculate the density [kg/m^3] of a fluid phase. More...
 
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval viscosity (const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
 Calculate the dynamic viscosity of a fluid phase [Pa*s]. More...
 
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval fugacityCoefficient (const FluidState &, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx, unsigned compIdx)
 Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase. More...
 
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval enthalpy (const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
 Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg]. More...
 
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval thermalConductivity (const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
 Thermal conductivity of a fluid phase [W/(m K)]. More...
 
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval heatCapacity (const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
 Specific isobaric heat capacity of a fluid phase [J/kg]. More...
 
static LhsEval density (const FluidState &, const ParamCache &, unsigned)
 Calculate the density [kg/m^3] of a fluid phase. More...
 
static LhsEval fugacityCoefficient (const FluidState &, ParamCache &, unsigned, unsigned)
 Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase. More...
 
static LhsEval viscosity (const FluidState &, ParamCache &, unsigned)
 Calculate the dynamic viscosity of a fluid phase [Pa*s]. More...
 
static LhsEval diffusionCoefficient (const FluidState &, ParamCache &, unsigned, unsigned)
 Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol^2 * s / (kg*m^3)]. More...
 
static LhsEval enthalpy (const FluidState &, ParamCache &, unsigned)
 Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg]. More...
 
static LhsEval thermalConductivity (const FluidState &, ParamCache &, unsigned)
 Thermal conductivity of a fluid phase [W/(m K)]. More...
 
static LhsEval heatCapacity (const FluidState &, ParamCache &, unsigned)
 Specific isobaric heat capacity of a fluid phase [J/kg]. More...
 
static unsigned phaseIsActive (unsigned)
 Returns whether a fluid phase is active. More...
 

Static Public Attributes

static const int numPhases = 2
 Number of fluid phases in the fluid system. More...
 
static const int wettingPhaseIdx = 0
 Index of the wetting phase. More...
 
static const int nonWettingPhaseIdx = 1
 Index of the non-wetting phase. More...
 
static const int numComponents = 2
 Number of chemical species in the fluid system. More...
 
static const int wettingCompIdx = 0
 Index of the wetting phase's component. More...
 
static const int nonWettingCompIdx = 1
 Index of the non-wetting phase's component. More...
 

Detailed Description

template<class Scalar, class WettingPhase, class NonwettingPhase>
class Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >

A fluid system for two-phase models assuming immiscibility and thermodynamic equilibrium.

The wetting and the non-wetting phase can be defined individually via Opm::LiquidPhase<Component> and Opm::GasPhase<Component>. These phases consist of one pure component. With the help of this adapter class, the phase properties can be accessed. This is suitable for pure two-phase systems without compositional effects.

Member Typedef Documentation

◆ Scalar

typedef Scalar Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::Scalar
inherited

The type used for scalar quantities.

Member Function Documentation

◆ acentricFactor()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static Scalar Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::acentricFactor ( unsigned  compIdx)
inlinestatic

◆ componentName()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static const char * Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::componentName ( unsigned  compIdx)
inlinestatic

◆ criticalPressure()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static Scalar Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::criticalPressure ( unsigned  compIdx)
inlinestatic

◆ criticalTemperature()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static Scalar Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::criticalTemperature ( unsigned  compIdx)
inlinestatic

◆ density() [1/2]

static LhsEval Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::density ( const FluidState &  ,
const ParamCache &  ,
unsigned   
)
inlinestaticinherited

Calculate the density [kg/m^3] of a fluid phase.

◆ density() [2/2]

template<class Scalar , class WettingPhase , class NonwettingPhase >
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::density ( const FluidState &  fluidState,
const ParameterCache< ParamCacheEval > &  ,
unsigned  phaseIdx 
)
inlinestatic

◆ diffusionCoefficient()

static LhsEval Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::diffusionCoefficient ( const FluidState &  ,
ParamCache &  ,
unsigned  ,
unsigned   
)
inlinestaticinherited

Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol^2 * s / (kg*m^3)].

Molecular diffusion of a compoent $\kappa$ is caused by a gradient of the mole fraction and follows the law

\[ J = - D \mathbf{grad} x^\kappa_\alpha \]

where $x_\alpha^\kappa$ is the component's mole fraction in phase $\alpha$, $D$ is the diffusion coefficient and $J$ is the diffusive flux.

◆ enthalpy() [1/2]

static LhsEval Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::enthalpy ( const FluidState &  ,
ParamCache &  ,
unsigned   
)
inlinestaticinherited

Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg].

◆ enthalpy() [2/2]

template<class Scalar , class WettingPhase , class NonwettingPhase >
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::enthalpy ( const FluidState &  fluidState,
const ParameterCache< ParamCacheEval > &  ,
unsigned  phaseIdx 
)
inlinestatic

Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg].

References Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::numPhases, and Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::wettingPhaseIdx.

◆ fugacityCoefficient() [1/2]

template<class Scalar , class WettingPhase , class NonwettingPhase >
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::fugacityCoefficient ( const FluidState &  ,
const ParameterCache< ParamCacheEval > &  ,
unsigned  phaseIdx,
unsigned  compIdx 
)
inlinestatic

Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase.

The fugacity coefficient $\phi_\kappa$ is connected to the fugacity $f_\kappa$ and the component's molarity $x_\kappa$ by means of the relation

\[ f_\kappa = \phi_\kappa\,x_{\kappa} \]

References Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::numComponents, and Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::numPhases.

◆ fugacityCoefficient() [2/2]

static LhsEval Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::fugacityCoefficient ( const FluidState &  ,
ParamCache &  ,
unsigned  ,
unsigned   
)
inlinestaticinherited

Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase.

The fugacity coefficient $\phi_\kappa$ is connected to the fugacity $f_\kappa$ and the component's molarity $x_\kappa$ by means of the relation

\[ f_\kappa = \phi_\kappa\,x_{\kappa} \]

◆ heatCapacity() [1/2]

static LhsEval Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::heatCapacity ( const FluidState &  ,
ParamCache &  ,
unsigned   
)
inlinestaticinherited

Specific isobaric heat capacity of a fluid phase [J/kg].

◆ heatCapacity() [2/2]

template<class Scalar , class WettingPhase , class NonwettingPhase >
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::heatCapacity ( const FluidState &  fluidState,
const ParameterCache< ParamCacheEval > &  ,
unsigned  phaseIdx 
)
inlinestatic

◆ init()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static void Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::init ( )
inlinestatic

Initialize the fluid system's static parameters.

◆ isCompressible()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static bool Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::isCompressible ( unsigned  phaseIdx)
inlinestatic

Returns true if and only if a fluid phase is assumed to be compressible.

Compressible means that the partial derivative of the density to the fluid pressure is always larger than zero.

References Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::wettingPhaseIdx.

◆ isIdealGas()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static bool Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::isIdealGas ( unsigned  phaseIdx)
inlinestatic

Returns true if and only if a fluid phase is assumed to be an ideal gas.

References Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::wettingPhaseIdx.

◆ isIdealMixture()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static bool Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::isIdealMixture ( unsigned  )
inlinestatic

Returns true if and only if a fluid phase is assumed to be an ideal mixture.

We define an ideal mixture as a fluid phase where the fugacity coefficients of all components times the pressure of the phase are independent on the fluid composition. This assumption is true if Henry's law and Rault's law apply. If you are unsure what this function should return, it is safe to return false. The only damage done will be (slightly) increased computation times in some cases.

◆ isLiquid()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static bool Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::isLiquid ( unsigned  phaseIdx)
inlinestatic

◆ molarMass()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static Scalar Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::molarMass ( unsigned  compIdx)
inlinestatic

Return the molar mass of a component in [kg/mol].

References Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::wettingCompIdx.

◆ phaseIsActive()

static unsigned Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::phaseIsActive ( unsigned  )
inlinestaticinherited

Returns whether a fluid phase is active.

◆ phaseName()

template<class Scalar , class WettingPhase , class NonwettingPhase >
static const char * Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::phaseName ( unsigned  phaseIdx)
inlinestatic

Return the human readable name of a fluid phase.

References Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::numPhases.

◆ thermalConductivity() [1/2]

static LhsEval Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::thermalConductivity ( const FluidState &  ,
ParamCache &  ,
unsigned   
)
inlinestaticinherited

Thermal conductivity of a fluid phase [W/(m K)].

◆ thermalConductivity() [2/2]

template<class Scalar , class WettingPhase , class NonwettingPhase >
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::thermalConductivity ( const FluidState &  fluidState,
const ParameterCache< ParamCacheEval > &  ,
unsigned  phaseIdx 
)
inlinestatic

◆ viscosity() [1/2]

static LhsEval Opm::BaseFluidSystem< Scalar , TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase > >::viscosity ( const FluidState &  ,
ParamCache &  ,
unsigned   
)
inlinestaticinherited

Calculate the dynamic viscosity of a fluid phase [Pa*s].

◆ viscosity() [2/2]

template<class Scalar , class WettingPhase , class NonwettingPhase >
template<class FluidState , class LhsEval = typename FluidState::Scalar, class ParamCacheEval = LhsEval>
static LhsEval Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::viscosity ( const FluidState &  fluidState,
const ParameterCache< ParamCacheEval > &  ,
unsigned  phaseIdx 
)
inlinestatic

Member Data Documentation

◆ nonWettingCompIdx

template<class Scalar , class WettingPhase , class NonwettingPhase >
const int Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::nonWettingCompIdx = 1
static

Index of the non-wetting phase's component.

◆ nonWettingPhaseIdx

template<class Scalar , class WettingPhase , class NonwettingPhase >
const int Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::nonWettingPhaseIdx = 1
static

Index of the non-wetting phase.

◆ numComponents

template<class Scalar , class WettingPhase , class NonwettingPhase >
const int Opm::TwoPhaseImmiscibleFluidSystem< Scalar, WettingPhase, NonwettingPhase >::numComponents = 2
static

◆ numPhases

◆ wettingCompIdx

◆ wettingPhaseIdx


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