12#ifndef DUMUX_FLUIDSYTEMS_GAS_PHASE_HH
13#define DUMUX_FLUIDSYTEMS_GAS_PHASE_HH
18#include <dune/common/exceptions.hh>
30template <
class Scalar,
class ComponentT>
32:
public Base<Scalar, OnePGas<Scalar, ComponentT> >
71 {
return Component::name(); }
77 {
return Component::name(); }
88 static constexpr bool isGas(
int phaseIdx = 0)
112 {
return Component::gasIsCompressible(); }
118 {
return Component::gasIsIdeal(); }
127 {
return Component::gasViscosityIsConstant(); }
133 {
return Component::molarMass(); }
139 {
return Component::criticalTemperature(); }
145 {
return Component::criticalPressure(); }
151 {
return Component::tripleTemperature(); }
157 {
return Component::triplePressure(); }
165 {
return Component::vaporPressure(T); }
177 template <
class Flu
idState>
181 return density(fluidState.temperature(phaseIdx),
182 fluidState.pressure(phaseIdx));
201 template <
class Flu
idState>
206 fluidState.pressure(phaseIdx));
227 template <
class Flu
idState>
231 return enthalpy(fluidState.temperature(phaseIdx),
232 fluidState.pressure(phaseIdx));
253 template <
class Flu
idState>
257 return viscosity(fluidState.temperature(phaseIdx),
258 fluidState.pressure(phaseIdx));
263 template <
class Flu
idState>
268 assert(0 <= phaseIdx && phaseIdx <
numPhases);
271 if (phaseIdx == compIdx)
277 return std::numeric_limits<Scalar>::infinity();
282 template <
class Flu
idState>
287 DUNE_THROW(Dune::InvalidStateException,
"Not applicable: Diffusion coefficients");
292 template <
class Flu
idState>
299 DUNE_THROW(Dune::InvalidStateException,
"Not applicable: Binary diffusion coefficients");
312 template <
class Flu
idState>
317 fluidState.pressure(phaseIdx));
330 template <
class Flu
idState>
335 fluidState.pressure(phaseIdx));
Fluid system base class.
Definition: fluidsystems/base.hh:32
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:35
A gaseous phase consisting of a single component.
Definition: 1pgas.hh:33
static Scalar density(Scalar temperature, Scalar pressure)
The density of the component at a given pressure and temperature.
Definition: 1pgas.hh:172
static Scalar triplePressure(int compIdx=0)
Returns the pressure in at the component's triple point.
Definition: 1pgas.hh:156
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the fugacity coefficient of an individual component in a fluid phase.
Definition: 1pgas.hh:264
static std::string componentName(int compIdx=0)
A human readable name for the component.
Definition: 1pgas.hh:70
static Scalar thermalConductivity(const FluidState &fluidState, const int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: 1pgas.hh:313
static Scalar viscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of the pure component at a given pressure and temperature.
Definition: 1pgas.hh:248
static constexpr bool isGas(int phaseIdx=0)
Returns whether the fluid is gaseous.
Definition: 1pgas.hh:88
ComponentT Component
Definition: 1pgas.hh:39
static Scalar molarDensity(Scalar temperature, Scalar pressure)
The molar density of a fluid phase in .
Definition: 1pgas.hh:196
static Scalar heatCapacity(const FluidState &fluidState, const int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: 1pgas.hh:331
static Scalar molarMass(int compIdx=0)
The mass in of one mole of the component.
Definition: 1pgas.hh:132
static constexpr int numPhases
Number of phases in the fluid system.
Definition: 1pgas.hh:42
static constexpr bool viscosityIsConstant(int phaseIdx)
Returns true if and only if a fluid phase is assumed to have a constant viscosity.
Definition: 1pgas.hh:126
static constexpr int comp0Idx
index of the only component
Definition: 1pgas.hh:46
static constexpr int numComponents
Number of components in the fluid system.
Definition: 1pgas.hh:43
static Scalar criticalPressure(int compIdx=0)
Returns the critical pressure in of the component.
Definition: 1pgas.hh:144
static Scalar tripleTemperature(int compIdx=0)
Returns the temperature in at the component's triple point.
Definition: 1pgas.hh:150
static std::string name()
A human readable name for the component.
Definition: 1pgas.hh:76
static constexpr bool isIdealGas(int phaseIdx=0)
Returns true if the fluid is assumed to be an ideal gas.
Definition: 1pgas.hh:117
static constexpr int phase0Idx
index of the only phase
Definition: 1pgas.hh:45
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition: 1pgas.hh:283
static const Scalar internalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of the pure component as a gas.
Definition: 1pgas.hh:240
static Scalar criticalTemperature(int compIdx=0)
Returns the critical temperature in of the component.
Definition: 1pgas.hh:138
static Scalar density(const FluidState &fluidState, const int phaseIdx)
Calculate the density of a fluid phase.
Definition: 1pgas.hh:178
static const Scalar enthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of the pure component as a gas.
Definition: 1pgas.hh:222
static Scalar molarDensity(const FluidState &fluidState, const int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: 1pgas.hh:202
static std::string phaseName(int phaseIdx=0)
Return the human readable name of a fluid phase.
Definition: 1pgas.hh:62
static constexpr bool isIdealMixture(int phaseIdx=0)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: 1pgas.hh:105
static Scalar viscosity(const FluidState &fluidState, const int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition: 1pgas.hh:254
static constexpr bool isCompressible(int phaseIdx=0)
Returns true if the fluid is assumed to be compressible.
Definition: 1pgas.hh:111
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: 1pgas.hh:293
static Scalar pressure(Scalar temperature, Scalar density)
The pressure of the component at a given density and temperature.
Definition: 1pgas.hh:214
static constexpr bool isMiscible()
There is only one phase, so not mass transfer between phases can occur.
Definition: 1pgas.hh:82
static void init()
Initialize the fluid system's static parameters generically.
Definition: 1pgas.hh:51
static Scalar thermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of the fluid .
Definition: 1pgas.hh:307
static Scalar vaporPressure(Scalar T)
The vapor pressure in of the component at a given temperature.
Definition: 1pgas.hh:164
static Scalar heatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of the fluid .
Definition: 1pgas.hh:325
static Scalar enthalpy(const FluidState &fluidState, const int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition: 1pgas.hh:228
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 gaseousPhase() noexcept
I/O name of gaseous phase.
Definition: name.hh:111
Component traits, i.e. information extracted from components.
Definition: componenttraits.hh:31