27 #ifndef OPM_SINGLE_PHASE_FLUIDSYSTEM_HPP
28 #define OPM_SINGLE_PHASE_FLUIDSYSTEM_HPP
54 template <
class Scalar,
class Flu
id>
56 :
public BaseFluidSystem<Scalar, SinglePhaseFluidSystem<Scalar, Fluid> >
63 template <
class Evaluation>
75 static const char*
phaseName([[maybe_unused]]
unsigned phaseIdx)
87 return Fluid::isLiquid();
96 return Fluid::isCompressible();
114 return Fluid::isIdealGas();
129 return Fluid::name();
137 return Fluid::molarMass();
149 return Fluid::criticalTemperature();
161 return Fluid::criticalPressure();
173 return Fluid::acentricFactor();
185 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
186 static LhsEval
density(
const FluidState& fluidState,
192 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
193 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
194 return Fluid::density(T, p);
198 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
205 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
206 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
207 return Fluid::viscosity(T, p);
211 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
220 if (phaseIdx == compIdx)
226 return std::numeric_limits<Scalar>::infinity();
230 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
231 static LhsEval
enthalpy(
const FluidState& fluidState,
237 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
238 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
239 return Fluid::enthalpy(T, p);
243 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
250 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
251 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
252 return Fluid::thermalConductivity(T, p);
256 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
263 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
264 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
265 return Fluid::heatCapacity(T, p);
The base class for all fluid systems.
Represents the gas phase of a single (pseudo-) component.
Material properties of pure water .
Represents the liquid phase of a single (pseudo-) component.
Properties of pure molecular nitrogen .
A parameter cache which does nothing.
A simple version of pure water.
A generic class which tabulates all thermodynamic properties of a given component.
The base class for all fluid systems.
Definition: BaseFluidSystem.hpp:44
Scalar Scalar
The type used for scalar quantities.
Definition: BaseFluidSystem.hpp:49
A parameter cache which does nothing.
Definition: NullParameterCache.hpp:40
A fluid system for single phase models.
Definition: SinglePhaseFluidSystem.hpp:57
static LhsEval thermalConductivity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition: SinglePhaseFluidSystem.hpp:244
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition: SinglePhaseFluidSystem.hpp:199
static const int numComponents
Number of chemical species in the fluid system.
Definition: SinglePhaseFluidSystem.hpp:122
static Scalar criticalTemperature(unsigned)
Critical temperature of a component [K].
Definition: SinglePhaseFluidSystem.hpp:145
static const char * phaseName([[maybe_unused]] unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition: SinglePhaseFluidSystem.hpp:75
static const char * componentName([[maybe_unused]] unsigned compIdx)
Return the human readable name of a component.
Definition: SinglePhaseFluidSystem.hpp:125
static Scalar acentricFactor(unsigned)
The acentric factor of a component [].
Definition: SinglePhaseFluidSystem.hpp:169
static const int numPhases
Number of fluid phases in the fluid system.
Definition: SinglePhaseFluidSystem.hpp:72
static LhsEval fugacityCoefficient(const FluidState &, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx, unsigned compIdx)
Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase.
Definition: SinglePhaseFluidSystem.hpp:212
static bool isIdealGas(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: SinglePhaseFluidSystem.hpp:109
static void init()
Initialize the fluid system's static parameters.
Definition: SinglePhaseFluidSystem.hpp:181
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition: SinglePhaseFluidSystem.hpp:186
static Scalar molarMass(unsigned)
Return the molar mass of a component in [kg/mol].
Definition: SinglePhaseFluidSystem.hpp:133
static Scalar criticalPressure(unsigned)
Critical pressure of a component [Pa].
Definition: SinglePhaseFluidSystem.hpp:157
static LhsEval heatCapacity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Specific isobaric heat capacity of a fluid phase [J/kg].
Definition: SinglePhaseFluidSystem.hpp:257
static bool isCompressible(unsigned)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: SinglePhaseFluidSystem.hpp:91
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: SinglePhaseFluidSystem.hpp:100
static LhsEval enthalpy(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy [J/kg...
Definition: SinglePhaseFluidSystem.hpp:231
static bool isLiquid(unsigned)
Return whether a phase is liquid.
Definition: SinglePhaseFluidSystem.hpp:83
The type of the fluid system's parameter cache.
Definition: SinglePhaseFluidSystem.hpp:65