27 #ifndef OPM_SINGLE_PHASE_FLUIDSYSTEM_HPP
28 #define OPM_SINGLE_PHASE_FLUIDSYSTEM_HPP
56 template <
class Scalar,
class Flu
id>
58 :
public BaseFluidSystem<Scalar, SinglePhaseFluidSystem<Scalar, Fluid> >
65 template <
class Evaluation>
77 static const char*
phaseName(
unsigned phaseIdx OPM_OPTIM_UNUSED)
89 return Fluid::isLiquid();
98 return Fluid::isCompressible();
116 return Fluid::isIdealGas();
131 return Fluid::name();
139 return Fluid::molarMass();
151 return Fluid::criticalTemperature();
163 return Fluid::criticalPressure();
175 return Fluid::acentricFactor();
187 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
188 static LhsEval
density(
const FluidState& fluidState,
194 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
195 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
196 return Fluid::density(T, p);
200 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
207 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
208 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
209 return Fluid::viscosity(T, p);
213 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
222 if (phaseIdx == compIdx)
228 return std::numeric_limits<Scalar>::infinity();
232 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
233 static LhsEval
enthalpy(
const FluidState& fluidState,
239 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
240 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
241 return Fluid::enthalpy(T, p);
245 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
252 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
253 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
254 return Fluid::thermalConductivity(T, p);
258 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
265 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
266 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
267 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.
Provides the OPM_UNUSED macro.
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:59
static LhsEval thermalConductivity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition: SinglePhaseFluidSystem.hpp:246
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition: SinglePhaseFluidSystem.hpp:201
static const int numComponents
Number of chemical species in the fluid system.
Definition: SinglePhaseFluidSystem.hpp:124
static Scalar criticalTemperature(unsigned)
Critical temperature of a component [K].
Definition: SinglePhaseFluidSystem.hpp:147
static Scalar acentricFactor(unsigned)
The acentric factor of a component [].
Definition: SinglePhaseFluidSystem.hpp:171
static const int numPhases
Number of fluid phases in the fluid system.
Definition: SinglePhaseFluidSystem.hpp:74
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:214
static bool isIdealGas(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: SinglePhaseFluidSystem.hpp:111
static void init()
Initialize the fluid system's static parameters.
Definition: SinglePhaseFluidSystem.hpp:183
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition: SinglePhaseFluidSystem.hpp:188
static Scalar molarMass(unsigned)
Return the molar mass of a component in [kg/mol].
Definition: SinglePhaseFluidSystem.hpp:135
static const char * componentName(unsigned compIdx OPM_OPTIM_UNUSED)
Return the human readable name of a component.
Definition: SinglePhaseFluidSystem.hpp:127
static Scalar criticalPressure(unsigned)
Critical pressure of a component [Pa].
Definition: SinglePhaseFluidSystem.hpp:159
static LhsEval heatCapacity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Specific isobaric heat capacity of a fluid phase [J/kg].
Definition: SinglePhaseFluidSystem.hpp:259
static bool isCompressible(unsigned)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: SinglePhaseFluidSystem.hpp:93
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: SinglePhaseFluidSystem.hpp:102
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:233
static bool isLiquid(unsigned)
Return whether a phase is liquid.
Definition: SinglePhaseFluidSystem.hpp:85
static const char * phaseName(unsigned phaseIdx OPM_OPTIM_UNUSED)
Return the human readable name of a fluid phase.
Definition: SinglePhaseFluidSystem.hpp:77
The type of the fluid system's parameter cache.
Definition: SinglePhaseFluidSystem.hpp:67