27#ifndef OPM_SINGLE_PHASE_FLUIDSYSTEM_HPP
28#define OPM_SINGLE_PHASE_FLUIDSYSTEM_HPP
55template <
class Scalar,
class Flu
id>
57 :
public BaseFluidSystem<Scalar, SinglePhaseFluidSystem<Scalar, Fluid> >
64 template <
class Evaluation>
76 static std::string_view
phaseName([[maybe_unused]]
unsigned phaseIdx)
88 return Fluid::isLiquid();
97 return Fluid::isCompressible();
115 return Fluid::isIdealGas();
130 return Fluid::name();
138 return Fluid::molarMass();
150 return Fluid::criticalTemperature();
162 return Fluid::criticalPressure();
174 return Fluid::acentricFactor();
186 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
187 static LhsEval
density(
const FluidState& fluidState,
193 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
194 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
195 return Fluid::density(T, p);
199 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
206 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
207 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
208 return Fluid::viscosity(T, p);
212 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
221 if (phaseIdx == compIdx)
227 return std::numeric_limits<Scalar>::infinity();
231 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
232 static LhsEval
enthalpy(
const FluidState& fluidState,
238 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
239 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
240 return Fluid::enthalpy(T, p);
244 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
251 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
252 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
253 return Fluid::thermalConductivity(T, p);
257 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
264 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
265 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
266 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:47
Scalar Scalar
The type used for scalar quantities.
Definition BaseFluidSystem.hpp:52
A parameter cache which does nothing.
Definition NullParameterCache.hpp:40
A fluid system for single phase models.
Definition SinglePhaseFluidSystem.hpp:58
static LhsEval thermalConductivity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition SinglePhaseFluidSystem.hpp:245
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition SinglePhaseFluidSystem.hpp:200
static const int numComponents
Number of chemical species in the fluid system.
Definition SinglePhaseFluidSystem.hpp:123
static Scalar criticalTemperature(unsigned)
Critical temperature of a component [K].
Definition SinglePhaseFluidSystem.hpp:146
static Scalar acentricFactor(unsigned)
The acentric factor of a component [].
Definition SinglePhaseFluidSystem.hpp:170
static const int numPhases
Number of fluid phases in the fluid system.
Definition SinglePhaseFluidSystem.hpp:73
static std::string_view phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition SinglePhaseFluidSystem.hpp:76
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:213
static bool isIdealGas(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition SinglePhaseFluidSystem.hpp:110
static void init()
Initialize the fluid system's static parameters.
Definition SinglePhaseFluidSystem.hpp:182
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition SinglePhaseFluidSystem.hpp:187
static Scalar molarMass(unsigned)
Return the molar mass of a component in [kg/mol].
Definition SinglePhaseFluidSystem.hpp:134
static Scalar criticalPressure(unsigned)
Critical pressure of a component [Pa].
Definition SinglePhaseFluidSystem.hpp:158
static LhsEval heatCapacity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Specific isobaric heat capacity of a fluid phase [J/kg].
Definition SinglePhaseFluidSystem.hpp:258
static bool isCompressible(unsigned)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition SinglePhaseFluidSystem.hpp:92
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition SinglePhaseFluidSystem.hpp:101
static std::string_view componentName(unsigned compIdx)
Return the human readable name of a component.
Definition SinglePhaseFluidSystem.hpp:126
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:232
static bool isLiquid(unsigned)
Return whether a phase is liquid.
Definition SinglePhaseFluidSystem.hpp:84
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
The type of the fluid system's parameter cache.
Definition SinglePhaseFluidSystem.hpp:66