24#ifndef DUMUX_LIQUID_TWOC_PHASE_HH
25#define DUMUX_LIQUID_TWOC_PHASE_HH
30#include <dune/common/exceptions.hh>
36namespace FluidSystems {
43template <
class Scalar,
class MainComponent,
class SecondComponent>
45:
public Base<Scalar, LiquidPhaseTwoC<Scalar, MainComponent, SecondComponent> >
94 {
return compIdx ? SecondComponent::name() : MainComponent::name(); }
100 {
return "LiquidPhaseTwoC"; }
105 static constexpr bool isGas(
int phaseIdx = 0)
129 {
return MainComponent::liquidIsCompressible(); }
141 {
return compIdx ? SecondComponent::molarMass() : MainComponent::molarMass(); }
147 {
return MainComponent::criticalTemperature(); }
153 {
return MainComponent::criticalPressure(); }
159 {
return MainComponent::tripleTemperature(); }
165 {
return MainComponent::triplePressure(); }
172 {
return MainComponent::vaporPressure(T); }
184 template <
class Flu
idState>
186 const int phaseIdx = 0)
188 const Scalar T = fluidState.temperature(phaseIdx);
189 const Scalar p = fluidState.pressure(phaseIdx);
194 const Scalar pureComponentMolarDensity = MainComponent::liquidMolarDensity(T, p);
196 return pureComponentMolarDensity
211 template <
class Flu
idState>
214 const Scalar T = fluidState.temperature(phaseIdx);
215 const Scalar p = fluidState.pressure(phaseIdx);
219 return MainComponent::liquidMolarDensity(T, p);
238 template <
class Flu
idState>
242 return enthalpy(fluidState.temperature(phaseIdx),
243 fluidState.pressure(phaseIdx));
252 template <
class Flu
idState>
257 const Scalar T = fluidState.temperature(phaseIdx);
258 const Scalar p = fluidState.pressure(phaseIdx);
261 return MainComponent::liquidEnthalpy(T, p);
263 return SecondComponent::liquidEnthalpy(T, p);
265 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
284 template <
class Flu
idState>
288 return viscosity(fluidState.temperature(phaseIdx),
289 fluidState.pressure(phaseIdx));
300 template <
class Flu
idState>
305 assert(0 <= phaseIdx && phaseIdx <
numPhases);
308 if (phaseIdx == compIdx)
314 return std::numeric_limits<Scalar>::infinity();
325 template <
class Flu
idState>
330 DUNE_THROW(Dune::InvalidStateException,
"Not applicable: Diffusion coefficients");
342 template <
class Flu
idState>
346 return BinaryCoefficients::liquidDiffCoeff(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
359 template <
class Flu
idState>
364 fluidState.pressure(phaseIdx));
377 template <
class Flu
idState>
382 fluidState.pressure(phaseIdx));
A collection of input/output field names for common physical quantities.
Binary coefficients for water and a "constant" component.
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
std::string liquidPhase() noexcept
I/O name of liquid phase.
Definition: name.hh:119
Binary coefficients for water and another component.
Definition: h2o_constant.hh:43
Fluid system base class.
Definition: fluidsystems/base.hh:45
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:48
static Scalar density(const FluidState &fluidState, int phaseIdx)
Calculate the density of a fluid phase.
Definition: fluidsystems/base.hh:134
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: fluidsystems/base.hh:390
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the fugacity coefficient of an individual component in a fluid phase.
Definition: fluidsystems/base.hh:197
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: fluidsystems/base.hh:278
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: fluidsystems/base.hh:326
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: fluidsystems/base.hh:363
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: fluidsystems/base.hh:160
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: fluidsystems/base.hh:236
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: fluidsystems/base.hh:424
A liquid phase consisting of a two components, a main component and a conservative tracer component.
Definition: liquidphase2c.hh:46
static constexpr int liquidPhaseIdx
index of the liquid phase
Definition: liquidphase2c.hh:57
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: liquidphase2c.hh:85
static constexpr bool isCompressible(int phaseIdx=0)
Returns true if the fluid is assumed to be compressible.
Definition: liquidphase2c.hh:128
static constexpr int numComponents
Number of components in the fluid system.
Definition: liquidphase2c.hh:55
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in the specified phase.
Definition: liquidphase2c.hh:253
static Scalar thermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of the fluid .
Definition: liquidphase2c.hh:352
static constexpr int mainCompIdx
index of the main component
Definition: liquidphase2c.hh:62
static const Scalar internalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy the pure component as a liquid.
Definition: liquidphase2c.hh:271
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition: liquidphase2c.hh:212
static std::string phaseName(int phaseIdx=0)
Return the human readable name of a fluid phase.
Definition: liquidphase2c.hh:78
static Scalar pressure(Scalar temperature, Scalar density)
The pressure of the component at a given density and temperature.
Definition: liquidphase2c.hh:225
static Scalar density(Scalar temperature, Scalar pressure)
The density of the phase at a given pressure and temperature.
Definition: liquidphase2c.hh:177
static Scalar criticalTemperature()
Returns the critical temperature of the main component.
Definition: liquidphase2c.hh:146
static Scalar tripleTemperature()
Returns the temperature at the main component's triple point.
Definition: liquidphase2c.hh:158
static constexpr int comp0Idx
index of the frist component
Definition: liquidphase2c.hh:60
static bool isIdealMixture(int phaseIdx=0)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: liquidphase2c.hh:122
static Scalar viscosity(const FluidState &fluidState, const int phaseIdx)
The dynamic liquid viscosity of the pure component.
Definition: liquidphase2c.hh:285
static Scalar triplePressure()
Returns the pressure at the main component's triple point.
Definition: liquidphase2c.hh:164
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: liquidphase2c.hh:343
static Scalar viscosity(Scalar temperature, Scalar pressure)
The dynamic liquid viscosity of the pure component.
Definition: liquidphase2c.hh:277
static std::string name()
A human readable name for the fluid system.
Definition: liquidphase2c.hh:99
static std::string componentName(int compIdx)
A human readable name for the component.
Definition: liquidphase2c.hh:93
static Scalar heatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the fluid .
Definition: liquidphase2c.hh:370
static bool isIdealGas(int phaseIdx=0)
Returns true if the fluid is assumed to be an ideal gas.
Definition: liquidphase2c.hh:134
static Scalar density(const FluidState &fluidState, const int phaseIdx=0)
The density of the phase at a given pressure and temperature.
Definition: liquidphase2c.hh:185
static Scalar enthalpy(const FluidState &fluidState, const int phaseIdx)
Specific enthalpy the pure component as a liquid.
Definition: liquidphase2c.hh:239
static void init()
Initialize the fluid system's static parameters generically.
Definition: liquidphase2c.hh:68
static constexpr int phase0Idx
index of the only phase
Definition: liquidphase2c.hh:58
static const Scalar enthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy the pure component as a liquid.
Definition: liquidphase2c.hh:231
static constexpr int secondCompIdx
index of the secondary component
Definition: liquidphase2c.hh:63
static Scalar vaporPressure(Scalar T)
The vapor pressure in of the main component at a given temperature.
Definition: liquidphase2c.hh:171
static Scalar molarMass(int compIdx)
The mass in of one mole of the component.
Definition: liquidphase2c.hh:140
static Scalar heatCapacity(const FluidState &fluidState, const int phaseIdx)
Specific isobaric heat capacity of the fluid .
Definition: liquidphase2c.hh:378
static Scalar criticalPressure()
Returns the critical pressure of the main component.
Definition: liquidphase2c.hh:152
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of the fluid .
Definition: liquidphase2c.hh:360
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the fugacity coefficient of an individual component in a fluid phase.
Definition: liquidphase2c.hh:301
static constexpr bool isGas(int phaseIdx=0)
Returns whether the fluid is gaseous.
Definition: liquidphase2c.hh:105
static constexpr int comp1Idx
index of the second component
Definition: liquidphase2c.hh:61
static constexpr int numPhases
Number of phases in the fluid system.
Definition: liquidphase2c.hh:54
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: liquidphase2c.hh:326
The a parameter cache which does nothing.
Definition: nullparametercache.hh:34