version 3.11-dev
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Dumux::CompositionalFluidState< ScalarType, FluidSystem > Class Template Reference

Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assuming thermodynamic equilibrium.

#include <dumux/material/fluidstates/compositional.hh>

Public Types

using Scalar = ScalarType
 export the scalar type More...
 

Public Member Functions

 CompositionalFluidState ()=default
 default constructor More...
 
template<class FluidState , typename std::enable_if_t<!std::is_same< FluidState, CompositionalFluidState >::value, int > = 0>
 CompositionalFluidState (const FluidState &fs)
 copy constructor from arbitrary fluid state More...
 
 CompositionalFluidState (const CompositionalFluidState &fs)=default
 
 CompositionalFluidState (CompositionalFluidState &&fs)=default
 
CompositionalFluidStateoperator= (const CompositionalFluidState &fs)=default
 
CompositionalFluidStateoperator= (CompositionalFluidState &&fs)=default
 
int wettingPhase () const
 Returns the index of the most wetting phase in the fluid-solid configuration (for porous medium systems). More...
 
Scalar saturation (int phaseIdx) const
 Returns the saturation Sα of a fluid phase α in []. More...
 
Scalar moleFraction (int phaseIdx, int compIdx) const
 Returns the molar fraction xακ of the component κ in fluid phase α in []. More...
 
Scalar massFraction (int phaseIdx, int compIdx) const
 Returns the mass fraction Xακ of component κ in fluid phase α in []. More...
 
Scalar phaseMassFraction (int phaseIdx) const
 Returns the phase mass fraction, i.e. phase mass per total mass [kg/kg]. More...
 
Scalar averageMolarMass (int phaseIdx) const
 The average molar mass Mα of phase α in [kg/mol]. More...
 
Scalar molarity (int phaseIdx, int compIdx) const
 The molar concentration cακ of component κ in fluid phase α in [mol/m3]. More...
 
Scalar fugacity (int phaseIdx, int compIdx) const
 The fugacity fακ of component κ in fluid phase α in [Pa]. More...
 
Scalar fugacityCoefficient (int phaseIdx, int compIdx) const
 The fugacity coefficient Φακ of component κ in fluid phase α in []. More...
 
Scalar molarVolume (int phaseIdx) const
 The molar volume vmol,α of a fluid phase α in [m3/mol]. More...
 
Scalar density (int phaseIdx) const
 The mass density ρα of the fluid phase α in [kg/m3]. More...
 
Scalar molarDensity (int phaseIdx) const
 The molar density ρα of the fluid phase α in [mol/m3]. More...
 
Scalar temperature (int phaseIdx) const
 The absolute temperature Tα of a fluid phase α in [K]. More...
 
Scalar pressure (int phaseIdx) const
 The pressure pα of a fluid phase α in [Pa]. More...
 
Scalar partialPressure (int phaseIdx, int compIdx) const
 The partial pressure of a component in a phase [Pa]. More...
 
Scalar enthalpy (int phaseIdx) const
 The specific enthalpy hα of a fluid phase α in [J/kg]. More...
 
Scalar internalEnergy (int phaseIdx) const
 The specific internal energy uα of a fluid phase α in [J/kg]. More...
 
Scalar viscosity (int phaseIdx) const
 The dynamic viscosity μα of fluid phase α in [Pas]. More...
 
Scalar temperature () const
 The temperature within the domain [K]. More...
 
Scalar fugacity (int compIdx) const
 The fugacity of a component [Pa]. More...
 
template<class FluidState >
void assign (const FluidState &fs)
 Retrieve all parameters from an arbitrary fluid state. More...
 
void setTemperature (Scalar value)
 Set the temperature [K] of all phases. More...
 
void setTemperature (const int phaseIdx, const Scalar value)
 Set the temperature [K] of a specific phase. This is not implemented in this fluidstate. More...
 
void setPressure (int phaseIdx, Scalar value)
 Set the fluid pressure of a phase [Pa]. More...
 
void setSaturation (int phaseIdx, Scalar value)
 Set the saturation of a phase []. More...
 
void setMoleFraction (int phaseIdx, int compIdx, Scalar value)
 Set the mole fraction of a component in a phase [] and update the average molar mass [kg/mol] according to the current composition of the phase. More...
 
void setMassFraction (int phaseIdx, int compIdx, Scalar value)
 Set the mass fraction of a component in a phase [] and update the average molar mass [kg/mol] according to the current composition of the phase. More...
 
void setFugacityCoefficient (int phaseIdx, int compIdx, Scalar value)
 Set the fugacity coefficient Φακ of component κ in fluid phase α in []. More...
 
void setDensity (int phaseIdx, Scalar value)
 Set the density of a phase [kg/m3]. More...
 
void setMolarDensity (int phaseIdx, Scalar value)
 Set the molar density of a phase [mol/m3]. More...
 
void setEnthalpy (int phaseIdx, Scalar value)
 Set the specific enthalpy of a phase [J/kg]. More...
 
void setViscosity (int phaseIdx, Scalar value)
 Set the dynamic viscosity of a phase [Pas]. More...
 
void setWettingPhase (int phaseIdx)
 Set the index of the most wetting phase. More...
 

Static Public Attributes

static constexpr int numPhases = FluidSystem::numPhases
 
static constexpr int numComponents = FluidSystem::numComponents
 

Protected Attributes

std::array< std::array< Scalar, numComponents >, numPhasesmoleFraction_ = {}
 zero-initialize all data members with braces syntax More...
 
std::array< std::array< Scalar, numComponents >, numPhasesfugacityCoefficient_ = {}
 
std::array< Scalar, numPhasesaverageMolarMass_ = {}
 
std::array< Scalar, numPhasessumMoleFractions_ = {}
 
std::array< Scalar, numPhasespressure_ = {}
 
std::array< Scalar, numPhasessaturation_ = {}
 
std::array< Scalar, numPhasesdensity_ = {}
 
std::array< Scalar, numPhasesmolarDensity_ = {}
 
std::array< Scalar, numPhasesenthalpy_ = {}
 
std::array< Scalar, numPhasesviscosity_ = {}
 
std::array< Scalar, numPhasestemperature_ = {}
 
int wPhaseIdx_ {0}
 

Member Typedef Documentation

◆ Scalar

template<class ScalarType , class FluidSystem >
using Dumux::CompositionalFluidState< ScalarType, FluidSystem >::Scalar = ScalarType

Constructor & Destructor Documentation

◆ CompositionalFluidState() [1/4]

template<class ScalarType , class FluidSystem >
Dumux::CompositionalFluidState< ScalarType, FluidSystem >::CompositionalFluidState ( )
default

◆ CompositionalFluidState() [2/4]

template<class ScalarType , class FluidSystem >
template<class FluidState , typename std::enable_if_t<!std::is_same< FluidState, CompositionalFluidState >::value, int > = 0>
Dumux::CompositionalFluidState< ScalarType, FluidSystem >::CompositionalFluidState ( const FluidState &  fs)
inlineexplicit

◆ CompositionalFluidState() [3/4]

template<class ScalarType , class FluidSystem >
Dumux::CompositionalFluidState< ScalarType, FluidSystem >::CompositionalFluidState ( const CompositionalFluidState< ScalarType, FluidSystem > &  fs)
default

◆ CompositionalFluidState() [4/4]

template<class ScalarType , class FluidSystem >
Dumux::CompositionalFluidState< ScalarType, FluidSystem >::CompositionalFluidState ( CompositionalFluidState< ScalarType, FluidSystem > &&  fs)
default

Member Function Documentation

◆ assign()

template<class ScalarType , class FluidSystem >
template<class FluidState >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::assign ( const FluidState &  fs)
inline
Note
If the other fluid state object is inconsistent with the thermodynamic equilibrium, the result of this method is undefined.

◆ averageMolarMass()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::averageMolarMass ( int  phaseIdx) const
inline

The average molar mass is the mean mass of a mole of the fluid at current composition. It is defined as the sum of the component's molar masses weighted by the current mole fraction:

Mα=κMκxακ

◆ density()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::density ( int  phaseIdx) const
inline

◆ enthalpy()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::enthalpy ( int  phaseIdx) const
inline

◆ fugacity() [1/2]

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::fugacity ( int  compIdx) const
inline

This assumes chemical equilibrium.

◆ fugacity() [2/2]

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::fugacity ( int  phaseIdx,
int  compIdx 
) const
inline

The fugacity is defined as: fακ:=Φακxακpα, where Φακ is the fugacity coefficient [76] . The physical meaning of fugacity becomes clear from the equation:

fακ=pαexp{ζακRTα},

where ζακ represents the κ's chemical potential in phase α, R stands for the ideal gas constant, and Tα for the absolute temperature of phase α. Assuming thermal equilibrium, there is a one-to-one mapping between a component's chemical potential ζακ and its fugacity fακ. In this case chemical equilibrium can thus be expressed by:

fκ:=fακ=fβκα,β

◆ fugacityCoefficient()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::fugacityCoefficient ( int  phaseIdx,
int  compIdx 
) const
inline

◆ internalEnergy()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::internalEnergy ( int  phaseIdx) const
inline

The specific internal energy is defined by the relation:

uα=hαpαρα

◆ massFraction()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::massFraction ( int  phaseIdx,
int  compIdx 
) const
inline

The mass fraction Xακ is defined as the weight of all molecules of a component divided by the total mass of the fluid phase. It is related with the component's mole fraction by means of the relation

Xακ=xακMκMα,

where Mκ is the molar mass of component κ and Mα is the mean molar mass of a molecule of phase α.

Parameters
phaseIdxthe index of the phase
compIdxthe index of the component

◆ molarDensity()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::molarDensity ( int  phaseIdx) const
inline

◆ molarity()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::molarity ( int  phaseIdx,
int  compIdx 
) const
inline

This quantity is usually called "molar concentration" or just "concentration", but there are many other (though less common) measures for concentration.

http://en.wikipedia.org/wiki/Concentration

◆ molarVolume()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::molarVolume ( int  phaseIdx) const
inline

This quantity is the inverse of the molar density.

◆ moleFraction()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::moleFraction ( int  phaseIdx,
int  compIdx 
) const
inline

The molar fraction xακ is defined as the ratio of the number of molecules of component κ and the total number of molecules of the phase α.

Parameters
phaseIdxthe index of the phase
compIdxthe index of the component

◆ operator=() [1/2]

template<class ScalarType , class FluidSystem >
CompositionalFluidState & Dumux::CompositionalFluidState< ScalarType, FluidSystem >::operator= ( CompositionalFluidState< ScalarType, FluidSystem > &&  fs)
default

◆ operator=() [2/2]

template<class ScalarType , class FluidSystem >
CompositionalFluidState & Dumux::CompositionalFluidState< ScalarType, FluidSystem >::operator= ( const CompositionalFluidState< ScalarType, FluidSystem > &  fs)
default

◆ partialPressure()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::partialPressure ( int  phaseIdx,
int  compIdx 
) const
inline

◆ phaseMassFraction()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::phaseMassFraction ( int  phaseIdx) const
inline
Parameters
phaseIdxthe index of the phase

◆ pressure()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::pressure ( int  phaseIdx) const
inline

◆ saturation()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::saturation ( int  phaseIdx) const
inline

The saturation is defined as the pore space occupied by the fluid divided by the total pore space:

Sα:=ϕVαϕV

Parameters
phaseIdxthe index of the phase

◆ setDensity()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setDensity ( int  phaseIdx,
Scalar  value 
)
inline

◆ setEnthalpy()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setEnthalpy ( int  phaseIdx,
Scalar  value 
)
inline

◆ setFugacityCoefficient()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setFugacityCoefficient ( int  phaseIdx,
int  compIdx,
Scalar  value 
)
inline

◆ setMassFraction()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setMassFraction ( int  phaseIdx,
int  compIdx,
Scalar  value 
)
inline

◆ setMolarDensity()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setMolarDensity ( int  phaseIdx,
Scalar  value 
)
inline

◆ setMoleFraction()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setMoleFraction ( int  phaseIdx,
int  compIdx,
Scalar  value 
)
inline

◆ setPressure()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setPressure ( int  phaseIdx,
Scalar  value 
)
inline

◆ setSaturation()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setSaturation ( int  phaseIdx,
Scalar  value 
)
inline

◆ setTemperature() [1/2]

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setTemperature ( const int  phaseIdx,
const Scalar  value 
)
inline

◆ setTemperature() [2/2]

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setTemperature ( Scalar  value)
inline

◆ setViscosity()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setViscosity ( int  phaseIdx,
Scalar  value 
)
inline

◆ setWettingPhase()

template<class ScalarType , class FluidSystem >
void Dumux::CompositionalFluidState< ScalarType, FluidSystem >::setWettingPhase ( int  phaseIdx)
inline

◆ temperature() [1/2]

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::temperature ( ) const
inline

◆ temperature() [2/2]

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::temperature ( int  phaseIdx) const
inline

◆ viscosity()

template<class ScalarType , class FluidSystem >
Scalar Dumux::CompositionalFluidState< ScalarType, FluidSystem >::viscosity ( int  phaseIdx) const
inline

◆ wettingPhase()

template<class ScalarType , class FluidSystem >
int Dumux::CompositionalFluidState< ScalarType, FluidSystem >::wettingPhase ( ) const
inline

Member Data Documentation

◆ averageMolarMass_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::averageMolarMass_ = {}
protected

◆ density_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::density_ = {}
protected

◆ enthalpy_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::enthalpy_ = {}
protected

◆ fugacityCoefficient_

template<class ScalarType , class FluidSystem >
std::array<std::array<Scalar, numComponents>, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::fugacityCoefficient_ = {}
protected

◆ molarDensity_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::molarDensity_ = {}
protected

◆ moleFraction_

template<class ScalarType , class FluidSystem >
std::array<std::array<Scalar, numComponents>, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::moleFraction_ = {}
protected

◆ numComponents

template<class ScalarType , class FluidSystem >
constexpr int Dumux::CompositionalFluidState< ScalarType, FluidSystem >::numComponents = FluidSystem::numComponents
staticconstexpr

◆ numPhases

template<class ScalarType , class FluidSystem >
constexpr int Dumux::CompositionalFluidState< ScalarType, FluidSystem >::numPhases = FluidSystem::numPhases
staticconstexpr

◆ pressure_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::pressure_ = {}
protected

◆ saturation_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::saturation_ = {}
protected

◆ sumMoleFractions_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::sumMoleFractions_ = {}
protected

◆ temperature_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::temperature_ = {}
protected

◆ viscosity_

template<class ScalarType , class FluidSystem >
std::array<Scalar, numPhases> Dumux::CompositionalFluidState< ScalarType, FluidSystem >::viscosity_ = {}
protected

◆ wPhaseIdx_

template<class ScalarType , class FluidSystem >
int Dumux::CompositionalFluidState< ScalarType, FluidSystem >::wPhaseIdx_ {0}
protected

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