Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assuming thermodynamic equilibrium. More...
#include <dumux/material/fluidstates/compositional.hh>
Represents all relevant thermodynamic quantities of a multi-phase, multi-component fluid system assuming thermodynamic equilibrium.
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 | |
CompositionalFluidState & | operator= (const CompositionalFluidState &fs)=default |
CompositionalFluidState & | operator= (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_\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 | phaseMassFraction (int phaseIdx) const |
Returns the phase mass fraction, i.e. phase mass per total mass \(\mathrm{[kg/kg]}\). 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_\alpha\) of the fluid phase \(\alpha\) in \(\mathrm{[mol/m^3]}\). More... | |
Scalar | temperature (int phaseIdx) const |
The absolute temperature \(T_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[K]}\). More... | |
Scalar | pressure (int phaseIdx) const |
The pressure \(p_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[Pa]}\). More... | |
Scalar | partialPressure (int phaseIdx, int compIdx) const |
The partial pressure of a component in a phase \(\mathrm{[Pa]}\). More... | |
Scalar | enthalpy (int phaseIdx) const |
The specific enthalpy \(h_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[J/kg]}\). 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... | |
Scalar | temperature () const |
The temperature within the domain \(\mathrm{[K]}\). More... | |
Scalar | fugacity (int compIdx) const |
The fugacity of a component \(\mathrm{[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 \(\mathrm{[K]}\) of all phases. More... | |
void | setTemperature (const int phaseIdx, const Scalar value) |
Set the temperature \(\mathrm{[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 \(\mathrm{[Pa]}\). More... | |
void | setSaturation (int phaseIdx, Scalar value) |
Set the saturation of a phase \(\mathrm{[-]}\). More... | |
void | setMoleFraction (int phaseIdx, int compIdx, Scalar value) |
Set the mole fraction of a component in a phase \(\mathrm{[-]}\) and update the average molar mass \(\mathrm{[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 \(\mathrm{[-]}\) and update the average molar mass \(\mathrm{[kg/mol]}\) according to the current composition of the phase. More... | |
template<class FluidState > | |
void | setRelativeHumidity (FluidState &fluidState, int phaseIdx, int compIdx, Scalar value) |
Set the relative humidity of a component in a phase \(\mathrm{[-]}\) and update the average molar mass \(\mathrm{[kg/mol]}\) according to the current composition of the phase. More... | |
void | setFugacityCoefficient (int phaseIdx, int compIdx, Scalar value) |
Set the fugacity coefficient \(\Phi^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\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{[mol / m^3]}\). More... | |
void | setEnthalpy (int phaseIdx, Scalar value) |
Set the specific enthalpy of a phase \(\mathrm{[J/kg]}\). 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 | |
std::array< std::array< Scalar, numComponents >, numPhases > | moleFraction_ = {} |
zero-initialize all data members with braces syntax More... | |
std::array< std::array< Scalar, numComponents >, numPhases > | fugacityCoefficient_ = {} |
std::array< Scalar, numPhases > | averageMolarMass_ = {} |
std::array< Scalar, numPhases > | sumMoleFractions_ = {} |
std::array< Scalar, numPhases > | pressure_ = {} |
std::array< Scalar, numPhases > | saturation_ = {} |
std::array< Scalar, numPhases > | density_ = {} |
std::array< Scalar, numPhases > | molarDensity_ = {} |
std::array< Scalar, numPhases > | enthalpy_ = {} |
std::array< Scalar, numPhases > | viscosity_ = {} |
std::array< Scalar, numPhases > | temperature_ = {} |
int | wPhaseIdx_ {0} |
using Dumux::CompositionalFluidState< ScalarType, FluidSystem >::Scalar = ScalarType |
export the scalar type
|
default |
default constructor
|
inline |
copy constructor from arbitrary fluid state
|
default |
|
default |
|
inline |
Retrieve all parameters from an arbitrary fluid state.
|
inline |
The average molar mass \(\overline M_\alpha\) of phase \(\alpha\) in \(\mathrm{[kg/mol]}\).
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}\]
|
inline |
The mass density \(\rho_\alpha\) of the fluid phase \(\alpha\) in \(\mathrm{[kg/m^3]}\).
|
inline |
The specific enthalpy \(h_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[J/kg]}\).
|
inline |
The fugacity of a component \(\mathrm{[Pa]}\).
This assumes chemical equilibrium.
|
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 [61] . 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\]
|
inline |
The fugacity coefficient \(\Phi^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[-]}\).
|
inline |
The specific internal energy \(u_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[J/kg]}\).
The specific internal energy is defined by the relation:
\[u_\alpha = h_\alpha - \frac{p_\alpha}{\rho_\alpha}\]
|
inline |
Returns the mass fraction \(X^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[-]}\).
The mass fraction \(X^\kappa_\alpha\) 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^\kappa_\alpha = x^\kappa_\alpha \frac{M^\kappa}{\overline M_\alpha}\;,\]
where \(M^\kappa\) is the molar mass of component \(\kappa\) and \(\overline M_\alpha\) is the mean molar mass of a molecule of phase \(\alpha\).
phaseIdx | the index of the phase |
compIdx | the index of the component |
|
inline |
The molar density \(\rho_\alpha\) of the fluid phase \(\alpha\) in \(\mathrm{[mol/m^3]}\).
|
inline |
The molar concentration \(c^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[mol/m^3]}\).
This quantity is usually called "molar concentration" or just "concentration", but there are many other (though less common) measures for concentration.
|
inline |
The molar volume \(v_{mol,\alpha}\) of a fluid phase \(\alpha\) in \(\mathrm{[m^3/mol]}\).
This quantity is the inverse of the molar density.
|
inline |
Returns the molar fraction \(x^\kappa_\alpha\) of the component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[-]}\).
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\).
phaseIdx | the index of the phase |
compIdx | the index of the component |
|
default |
|
default |
|
inline |
The partial pressure of a component in a phase \(\mathrm{[Pa]}\).
|
inline |
Returns the phase mass fraction, i.e. phase mass per total mass \(\mathrm{[kg/kg]}\).
phaseIdx | the index of the phase |
|
inline |
The pressure \(p_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[Pa]}\).
|
inline |
Returns the saturation \(S_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[-]}\).
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}}\]
phaseIdx | the index of the phase |
|
inline |
Set the density of a phase \(\mathrm{[kg / m^3]}\).
|
inline |
Set the specific enthalpy of a phase \(\mathrm{[J/kg]}\).
|
inline |
Set the fugacity coefficient \(\Phi^\kappa_\alpha\) of component \(\kappa\) in fluid phase \(\alpha\) in \(\mathrm{[-]}\).
|
inline |
Set the mass fraction of a component in a phase \(\mathrm{[-]}\) and update the average molar mass \(\mathrm{[kg/mol]}\) according to the current composition of the phase.
|
inline |
Set the molar density of a phase \(\mathrm{[mol / m^3]}\).
|
inline |
Set the mole fraction of a component in a phase \(\mathrm{[-]}\) and update the average molar mass \(\mathrm{[kg/mol]}\) according to the current composition of the phase.
|
inline |
Set the fluid pressure of a phase \(\mathrm{[Pa]}\).
|
inline |
Set the relative humidity of a component in a phase \(\mathrm{[-]}\) and update the average molar mass \(\mathrm{[kg/mol]}\) according to the current composition of the phase.
|
inline |
Set the saturation of a phase \(\mathrm{[-]}\).
|
inline |
Set the temperature \(\mathrm{[K]}\) of a specific phase. This is not implemented in this fluidstate.
|
inline |
Set the temperature \(\mathrm{[K]}\) of all phases.
|
inline |
Set the dynamic viscosity of a phase \(\mathrm{[Pa s]}\).
|
inline |
Set the index of the most wetting phase.
|
inline |
The temperature within the domain \(\mathrm{[K]}\).
|
inline |
The absolute temperature \(T_\alpha\) of a fluid phase \(\alpha\) in \(\mathrm{[K]}\).
|
inline |
The dynamic viscosity \(\mu_\alpha\) of fluid phase \(\alpha\) in \(\mathrm{[Pa s]}\).
|
inline |
Returns the index of the most wetting phase in the fluid-solid configuration (for porous medium systems).
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
zero-initialize all data members with braces syntax
|
staticconstexpr |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |