12#ifndef DUMUX_LIQUID_PHASE_HH
13#define DUMUX_LIQUID_PHASE_HH
18#include <dune/common/exceptions.hh>
25namespace FluidSystems {
31template <
class Scalar,
class ComponentT>
33:
public Base<Scalar, OnePLiquid<Scalar, ComponentT> >
72 {
return Component::name(); }
78 {
return Component::name(); }
89 static constexpr bool isGas(
int phaseIdx = 0)
113 {
return Component::liquidIsCompressible(); }
119 {
return Component::liquidViscosityIsConstant(); }
131 {
return Component::molarMass(); }
137 {
return Component::criticalTemperature(); }
143 {
return Component::criticalPressure(); }
149 {
return Component::tripleTemperature(); }
155 {
return Component::triplePressure(); }
162 {
return Component::vaporPressure(T); }
172 template <
class Flu
idState>
176 return density(fluidState.temperature(phaseIdx),
177 fluidState.pressure(phaseIdx));
182 template <
class Flu
idState>
186 fluidState.pressure(phaseIdx));
215 template <
class Flu
idState>
219 return enthalpy(fluidState.temperature(phaseIdx),
220 fluidState.pressure(phaseIdx));
241 template <
class Flu
idState>
245 return viscosity(fluidState.temperature(phaseIdx),
246 fluidState.pressure(phaseIdx));
251 template <
class Flu
idState>
256 assert(0 <= phaseIdx && phaseIdx <
numPhases);
259 if (phaseIdx == compIdx)
265 return std::numeric_limits<Scalar>::infinity();
270 template <
class Flu
idState>
275 DUNE_THROW(Dune::InvalidStateException,
"Not applicable: Diffusion coefficients");
280 template <
class Flu
idState>
286 DUNE_THROW(Dune::InvalidStateException,
"Not applicable: Binary diffusion coefficients");
299 template <
class Flu
idState>
304 fluidState.pressure(phaseIdx));
317 template <
class Flu
idState>
322 fluidState.pressure(phaseIdx));
Fluid system base class.
Definition: fluidsystems/base.hh:33
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:36
A liquid phase consisting of a single component.
Definition: 1pliquid.hh:34
static constexpr int numComponents
Number of components in the fluid system.
Definition: 1pliquid.hh:44
static constexpr bool isCompressible(int phaseIdx=0)
Returns true if the fluid is assumed to be compressible.
Definition: 1pliquid.hh:112
static const Scalar enthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy the pure component as a liquid.
Definition: 1pliquid.hh:210
static Scalar molarDensity(const FluidState &fluidState, const int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: 1pliquid.hh:183
static Scalar enthalpy(const FluidState &fluidState, const int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: 1pliquid.hh:216
static std::string phaseName(int phaseIdx=0)
Return the human readable name of a fluid phase.
Definition: 1pliquid.hh:63
static constexpr bool isGas(int phaseIdx=0)
Returns whether the fluid is a liquid.
Definition: 1pliquid.hh:89
static constexpr bool isIdealGas(int phaseIdx=0)
Returns true if the fluid is assumed to be an ideal gas.
Definition: 1pliquid.hh:124
static constexpr bool isIdealMixture(int phaseIdx=0)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: 1pliquid.hh:106
static void init()
Initialize the fluid system's static parameters generically.
Definition: 1pliquid.hh:52
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: 1pliquid.hh:271
static Scalar molarMass(int compIdx=0)
The mass in of one mole of the component.
Definition: 1pliquid.hh:130
static Scalar triplePressure(int compIdx=0)
Returns the pressure at the component's triple point.
Definition: 1pliquid.hh:154
static Scalar criticalPressure(int compIdx=0)
Returns the critical pressure of the component.
Definition: 1pliquid.hh:142
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: 1pliquid.hh:300
static Scalar density(const FluidState &fluidState, const int phaseIdx)
Calculate the density of a fluid phase.
Definition: 1pliquid.hh:173
static std::string name()
A human readable name for the component.
Definition: 1pliquid.hh:77
static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIIdx, int compJIdx)
Given a phase's composition, temperature and pressure, return the binary diffusion coefficient for c...
Definition: 1pliquid.hh:281
static constexpr bool isMiscible()
There is only one phase, so not mass transfer between phases can occur.
Definition: 1pliquid.hh:83
static Scalar viscosity(const FluidState &fluidState, const int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: 1pliquid.hh:242
static Scalar density(Scalar temperature, Scalar pressure)
The density of the component at a given pressure and temperature.
Definition: 1pliquid.hh:167
static Scalar pressure(Scalar temperature, Scalar density)
The pressure of the component at a given density and temperature.
Definition: 1pliquid.hh:202
static Scalar thermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of the fluid .
Definition: 1pliquid.hh:294
static Scalar vaporPressure(Scalar T)
The vapor pressure in of the component at a given temperature.
Definition: 1pliquid.hh:161
static Scalar heatCapacity(const FluidState &fluidState, const int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: 1pliquid.hh:318
static const Scalar internalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy the pure component as a liquid.
Definition: 1pliquid.hh:228
static Scalar viscosity(Scalar temperature, Scalar pressure)
The dynamic liquid viscosity of the pure component.
Definition: 1pliquid.hh:236
static Scalar heatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the fluid .
Definition: 1pliquid.hh:312
static Scalar tripleTemperature(int compIdx=0)
Returns the temperature at the component's triple point.
Definition: 1pliquid.hh:148
static constexpr int comp0Idx
index of the only component
Definition: 1pliquid.hh:47
static Scalar criticalTemperature(int compIdx=0)
Returns the critical temperature of the component.
Definition: 1pliquid.hh:136
static constexpr int phase0Idx
index of the only phase
Definition: 1pliquid.hh:46
static Scalar molarDensity(Scalar temperature, Scalar pressure)
The density of the component at a given pressure and temperature.
Definition: 1pliquid.hh:194
static constexpr bool viscosityIsConstant(int phaseIdx=0)
Returns true if the fluid viscosity is constant.
Definition: 1pliquid.hh:118
ComponentT Component
Definition: 1pliquid.hh:40
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the fugacity coefficient of an individual component in a fluid phase.
Definition: 1pliquid.hh:252
static std::string componentName(int compIdx=0)
A human readable name for the component.
Definition: 1pliquid.hh:71
static constexpr int numPhases
Number of phases in the fluid system.
Definition: 1pliquid.hh:43
The a parameter cache which does nothing.
Definition: nullparametercache.hh:22
Component traits, i.e. information extracted from components.
A collection of input/output field names for common physical quantities.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string liquidPhase() noexcept
I/O name of liquid phase.
Definition: name.hh:107
Component traits, i.e. information extracted from components.
Definition: componenttraits.hh:31