version 3.10-dev
Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem > Class Template Reference

Represents all relevant thermodynamic quantities of a multi-phase fluid system assuming immiscibility and thermodynamic equilibrium.

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

Public Types

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

Public Member Functions

 IsothermalImmiscibleFluidState ()=default
 default constructor More...
 
template<class FluidState , typename std::enable_if_t<!std::is_same< FluidState, IsothermalImmiscibleFluidState >::value, int > = 0>
 IsothermalImmiscibleFluidState (const FluidState &fs)
 copy constructor from arbitrary fluid state More...
 
 IsothermalImmiscibleFluidState (const IsothermalImmiscibleFluidState &fs)=default
 
 IsothermalImmiscibleFluidState (IsothermalImmiscibleFluidState &&fs)=default
 
IsothermalImmiscibleFluidStateoperator= (const IsothermalImmiscibleFluidState &fs)=default
 
IsothermalImmiscibleFluidStateoperator= (IsothermalImmiscibleFluidState &&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_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[-]}\). More...
 
Scalar moleFraction (int phaseIdx, int compIdx) const
 Returns the molar fraction \(x^\kappa_\alpha\) of the component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[-]}\). More...
 
Scalar massFraction (int phaseIdx, int compIdx) const
 Returns the mass fraction \(X^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[-]}\). More...
 
Scalar averageMolarMass (int phaseIdx) const
 The average molar mass \(\overline M_\alpha\) of phase \(\alpha\) in \(\mathrm{[kg/mol]}\). More...
 
Scalar molarity (int phaseIdx, int compIdx) const
 The molar concentration \(c^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[mol/m^3]}\). More...
 
Scalar fugacity (int phaseIdx, int compIdx) const
 The fugacity \(f^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[Pa]}\). More...
 
Scalar fugacityCoefficient (int phaseIdx, int compIdx) const
 The fugacity coefficient \(\Phi^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[-]}\). More...
 
Scalar molarVolume (int phaseIdx) const
 The molar volume \(v_{mol,\alpha}\) of a fluid phase \(\alpha\) in \(\mathrm{[m^3/mol]}\). More...
 
Scalar density (int phaseIdx) const
 The mass density \(\rho_\alpha\) of the fluid phase \(\alpha\) in \(\mathrm{[kg/m^3]}\). More...
 
Scalar molarDensity (int phaseIdx) const
 The molar density \(\rho_{mol,\alpha}\) of a fluid phase \(\alpha\) in \(\mathrm{[mol/m^3]}\). More...
 
Scalar temperature (int phaseIdx) const
 The temperature of a fluid phase \(\mathrm{[K]}\). More...
 
Scalar temperature () const
 The temperature within the domain \(\mathrm{[K]}\). More...
 
Scalar pressure (int phaseIdx) const
 The pressure \(p_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[Pa]}\). More...
 
Scalar enthalpy (int phaseIdx) const
 The specific enthalpy \(h_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[J/kg]}\) This is not defined for an isothermal fluidstate. More...
 
Scalar internalEnergy (int phaseIdx) const
 The specific internal energy \(u_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[J/kg]}\). More...
 
Scalar viscosity (int phaseIdx) const
 The dynamic viscosity \(\mu_\alpha\) of fluid phase \(\alpha\) in \(\mathrm{[Pa s]}\). 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 \(\mathrm{[K]]}\) of a fluid phase. More...
 
void setPressure (int phaseIdx, Scalar value)
 Set the fluid pressure of a phase \(\mathrm{[Pa]}\). More...
 
void setSaturation (int phaseIdx, Scalar value)
 Set the saturation of a phase \(\mathrm{[-]}\). More...
 
void setDensity (int phaseIdx, Scalar value)
 Set the density of a phase \(\mathrm{[kg/m^3]}\). More...
 
void setMolarDensity (int phaseIdx, Scalar value)
 Set the molar density of a phase \(\mathrm{[kg/m^3]}\). More...
 
void setViscosity (int phaseIdx, Scalar value)
 Set the dynamic viscosity of a phase \(\mathrm{[Pa s]}\). 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

Scalar pressure_ [numPhases] = {}
 
Scalar saturation_ [numPhases] = {}
 
Scalar density_ [numPhases] = {}
 
Scalar molarDensity_ [numPhases] = {}
 
Scalar viscosity_ [numPhases] = {}
 
Scalar temperature_ = 0.0
 
int wPhaseIdx_ {0}
 

Member Typedef Documentation

◆ Scalar

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

Constructor & Destructor Documentation

◆ IsothermalImmiscibleFluidState() [1/4]

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

◆ IsothermalImmiscibleFluidState() [2/4]

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

◆ IsothermalImmiscibleFluidState() [3/4]

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

◆ IsothermalImmiscibleFluidState() [4/4]

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

Member Function Documentation

◆ assign()

template<class ScalarType , class FluidSystem >
template<class FluidState >
void Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::assign ( const FluidState &  fs)
inline
Parameters
fsFluidstate

◆ averageMolarMass()

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< 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:

\[\mathrm{ \overline M_\alpha = \sum_\kappa M^\kappa x_\alpha^\kappa}\]

Since this is an immiscible fluidstate we simply consider the molarMass of the pure component/phase.

◆ density()

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

◆ enthalpy()

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

◆ fugacity()

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

The fugacity \(f^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[Pa]}\).

The fugacity is defined as: \(f_\alpha^\kappa := \Phi^\kappa_\alpha x^\kappa_\alpha p_\alpha \;,\) where \(\Phi^\kappa_\alpha\) is the fugacity coefficient [72] . The physical meaning of fugacity becomes clear from the equation:

\[f_\alpha^\kappa = p_\alpha \exp\left\{\frac{\zeta^\kappa_\alpha}{R T_\alpha} \right\} \;,\]

where \(\zeta^\kappa_\alpha\) represents the \(\kappa\)'s chemical potential in phase \(\alpha\), \(R\) stands for the ideal gas constant, and \(T_\alpha\) for the absolute temperature of phase \(\alpha\). Assuming thermal equilibrium, there is a one-to-one mapping between a component's chemical potential \(\zeta^\kappa_\alpha\) and its fugacity \(f^\kappa_\alpha\). In this case chemical equilibrium can thus be expressed by:

\[f^\kappa := f^\kappa_\alpha = f^\kappa_\beta\quad\forall \alpha, \beta\]

To avoid numerical issues with code that assumes miscibility, we return a fugacity of 0 for components which do not mix with the specified phase. (Actually it is undefined, but for finite fugacity coefficients, the only way to get components completely out of a phase is 0 to feed it zero fugacity.) To avoid numerical issues with code that assumes miscibility, we return a fugacity of 0 for components which do not mix with the specified phase. (Actually it is undefined, but for finite fugacity coefficients, the only way to get components completely out of a phase is 0 to feed it zero fugacity.)

◆ fugacityCoefficient()

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

Since we assume immiscibility, the fugacity coefficients for the components which are not miscible with the phase is infinite. Beware that this will very likely break your code if you don't keep that in mind.

◆ internalEnergy()

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

The specific internal energy is defined by the relation:

\[u_\alpha = h_\alpha - \frac{p_\alpha}{\rho_\alpha}\]

This is not defined for an isothermal fluidstate.

◆ massFraction()

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

They are set either 1 or 0 in a phase since this is an immiscible fluidstate.

Parameters
phaseIdxthe index of the phase
compIdxthe index of the component

◆ molarDensity()

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

The molar density is defined by the mass density \(\rho_\alpha\) and the mean molar mass \(\overline M_\alpha\):

\[\rho_{mol,\alpha} = \frac{\rho_\alpha}{\overline M_\alpha} \;.\]

◆ molarity()

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< 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::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::molarVolume ( int  phaseIdx) const
inline

This quantity is the inverse of the molar density.

◆ moleFraction()

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

The molar fraction \(x^\kappa_\alpha\) is defined as the ratio of the number of molecules of component \(\kappa\) and the total number of molecules of the phase \(\alpha\). They are set either 1 or 0 in a phase since this is an immiscible fluidstate.

Parameters
phaseIdxthe index of the phase
compIdxthe index of the component

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ pressure()

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

◆ saturation()

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< 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_\alpha := \frac{\phi \mathcal{V}_\alpha}{\phi \mathcal{V}}\]

Parameters
phaseIdxthe index of the phase

◆ setDensity()

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

◆ setMolarDensity()

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

◆ setPressure()

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

◆ setSaturation()

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

◆ setTemperature()

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

◆ setViscosity()

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

◆ setWettingPhase()

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

◆ temperature() [1/2]

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

◆ temperature() [2/2]

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

◆ viscosity()

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

◆ wettingPhase()

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

Member Data Documentation

◆ density_

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::density_[numPhases] = {}
protected

◆ molarDensity_

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::molarDensity_[numPhases] = {}
protected

◆ numComponents

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

◆ numPhases

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

◆ pressure_

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::pressure_[numPhases] = {}
protected

◆ saturation_

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::saturation_[numPhases] = {}
protected

◆ temperature_

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::temperature_ = 0.0
protected

◆ viscosity_

template<class ScalarType , class FluidSystem >
Scalar Dumux::IsothermalImmiscibleFluidState< ScalarType, FluidSystem >::viscosity_[numPhases] = {}
protected

◆ wPhaseIdx_

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

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