27#ifndef OPM_H2O_AIR_SYSTEM_HPP
28#define OPM_H2O_AIR_SYSTEM_HPP
55template <
class Scalar,
57 class H2Otype = TabulatedComponent<Scalar, H2O<Scalar> >>
62 typedef BaseFluidSystem <Scalar, ThisType>
Base;
63 typedef ::Opm::IdealGas<Scalar>
IdealGas;
66 template <
class Evaluation>
73 typedef ::Opm::Air<Scalar>
Air;
84 static std::string_view
phaseName(
unsigned phaseIdx)
90 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
151 throw std::logic_error(
"Invalid component index "+std::to_string(compIdx));
223 if (H2O::isTabulated)
246 if (H2O::isTabulated) {
248 pressMin, pressMax, nPress);
253 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
254 static LhsEval
density(
const FluidState& fluidState,
260 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
263 p = decay<LhsEval>(fluidState.pressure(phaseIdx));
268 Valgrind::SetUndefined(p);
272 LhsEval sumMoleFrac = 0;
273 for (
unsigned compIdx = 0; compIdx <
numComponents; ++compIdx)
274 sumMoleFrac += decay<LhsEval>(fluidState.moleFraction(phaseIdx, compIdx));
289 LhsEval partialPressureH2O =
293 LhsEval partialPressureAir =
299 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
303 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
310 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
311 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
328 LhsEval muResult = 0;
344 divisor += decay<LhsEval>(fluidState.moleFraction(phaseIdx, j))*phiIJ;
346 const auto& xAlphaI = decay<LhsEval>(fluidState.moleFraction(phaseIdx, i));
347 muResult += xAlphaI*mu[i]/divisor;
351 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
355 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
364 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
365 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
379 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
385 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
386 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
396 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
397 static LhsEval
enthalpy(
const FluidState& fluidState,
401 const auto& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
402 const auto& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
403 Valgrind::CheckDefined(T);
404 Valgrind::CheckDefined(p);
414 LhsEval result = 0.0;
424 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
428 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
435 const LhsEval& temperature =
436 decay<LhsEval>(fluidState.temperature(phaseIdx));
437 const LhsEval& pressure =
438 decay<LhsEval>(fluidState.pressure(phaseIdx));
445 const LhsEval& xAir =
446 decay<LhsEval>(fluidState.moleFraction(phaseIdx,
AirIdx));
447 const LhsEval& xH2O =
448 decay<LhsEval>(fluidState.moleFraction(phaseIdx,
H2OIdx));
449 LhsEval lambdaAir = xAir*lambdaDryAir;
453 LhsEval partialPressure = pressure*xH2O;
457 return lambdaAir + lambdaH2O;
A simple class implementing the fluid properties of air.
The base class for all fluid systems.
Material properties of pure water .
Binary coefficients for water and nitrogen.
Relations valid for an ideal gas.
A parameter cache which does nothing.
A generic class which tabulates all thermodynamic properties of a given component.
Some templates to wrap the valgrind client request macros.
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Specific heat conductivity of steam .
Definition Air.hpp:219
static Scalar criticalPressure()
Returns the critical pressure of .
Definition Air.hpp:94
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of at a given pressure and temperature [kg/m^3].
Definition Air.hpp:104
static Scalar molarMass()
The molar mass in of .
Definition Air.hpp:82
static std::string_view name()
A human readable name for the .
Definition Air.hpp:62
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition Air.hpp:74
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of liquid water with 273.15 K as basis.
Definition Air.hpp:182
static Scalar criticalTemperature()
Returns the critical temperature of .
Definition Air.hpp:88
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition Air.hpp:139
The base class for all fluid systems.
Definition BaseFluidSystem.hpp:47
ScalarT Scalar
The type used for scalar quantities.
Definition BaseFluidSystem.hpp:52
static Evaluation henry(const Evaluation &temperature)
Henry coefficent for air in liquid water.
Definition H2O_Air.hpp:55
static Evaluation liquidDiffCoeff(const Evaluation &temperature, const Evaluation &)
Lacking better data on water-air diffusion in liquids, we use at the moment the diffusion coefficient...
Definition H2O_Air.hpp:101
static Evaluation gasDiffCoeff(const Evaluation &temperature, const Evaluation &pressure)
Binary diffusion coefficent for molecular water and air.
Definition H2O_Air.hpp:70
static Scalar acentricFactor()
Returns the acentric factor of the component.
Definition Component.hpp:112
static void init(Scalar, Scalar, unsigned, Scalar, Scalar, unsigned)
A default routine for initialization, not needed for components and must not be called.
Definition Component.hpp:62
A fluid system with a liquid and a gaseous phase and water and air as components.
Definition H2OAirFluidSystem.hpp:60
H2Otype H2O
The type of the water component used for this fluid system.
Definition H2OAirFluidSystem.hpp:71
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition H2OAirFluidSystem.hpp:254
static const int AirIdx
The index of the air component.
Definition H2OAirFluidSystem.hpp:141
static const int numComponents
Number of chemical species in the fluid system.
Definition H2OAirFluidSystem.hpp:136
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition H2OAirFluidSystem.hpp:155
static const int gasPhaseIdx
The index of the gas phase.
Definition H2OAirFluidSystem.hpp:81
static bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition H2OAirFluidSystem.hpp:113
static const int liquidPhaseIdx
The index of the liquid phase.
Definition H2OAirFluidSystem.hpp:79
static LhsEval binaryDiffusionCoefficient(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx, unsigned)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol^2 * s / (k...
Definition H2OAirFluidSystem.hpp:380
static const int H2OIdx
The index of the water component.
Definition H2OAirFluidSystem.hpp:139
static std::string_view componentName(unsigned compIdx)
Return the human readable name of a component.
Definition H2OAirFluidSystem.hpp:144
static bool isCompressible(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition H2OAirFluidSystem.hpp:101
static std::string_view phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition H2OAirFluidSystem.hpp:84
static const int numPhases
Number of fluid phases in the fluid system.
Definition H2OAirFluidSystem.hpp:76
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition H2OAirFluidSystem.hpp:304
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition H2OAirFluidSystem.hpp:122
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the fluid system's static parameters using problem specific temperature and pressure range...
Definition H2OAirFluidSystem.hpp:243
::Opm::Air< Scalar > Air
The type of the air component used for this fluid system.
Definition H2OAirFluidSystem.hpp:73
static Scalar criticalTemperature(unsigned compIdx)
Critical temperature of a component [K].
Definition H2OAirFluidSystem.hpp:171
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition H2OAirFluidSystem.hpp:94
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 H2OAirFluidSystem.hpp:397
static Scalar acentricFactor(unsigned compIdx)
The acentric factor of a component [].
Definition H2OAirFluidSystem.hpp:201
static void init()
Initialize the fluid system's static parameters.
Definition H2OAirFluidSystem.hpp:221
static Scalar criticalPressure(unsigned compIdx)
Critical pressure of a component [Pa].
Definition H2OAirFluidSystem.hpp:186
static LhsEval thermalConductivity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition H2OAirFluidSystem.hpp:429
static LhsEval fugacityCoefficient(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx, unsigned compIdx)
Calculate the fugacity coefficient [Pa] of an individual component in a fluid phase.
Definition H2OAirFluidSystem.hpp:356
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
The density of pure water in at a given pressure and temperature.
Definition H2O.hpp:687
static const Scalar criticalTemperature()
Returns the critical temperature of water.
Definition H2O.hpp:95
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of steam in at a given pressure and temperature.
Definition H2O.hpp:562
static std::string_view name()
A human readable name for the water.
Definition H2O.hpp:77
static Evaluation vaporPressure(Evaluation temperature)
The vapor pressure in of pure water at a given temperature.
Definition H2O.hpp:141
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of steam.
Definition H2O.hpp:790
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of liquid water .
Definition H2O.hpp:237
static Evaluation liquidThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
Thermal conductivity of water (IAPWS) .
Definition H2O.hpp:844
static const Scalar acentricFactor()
The acentric factor of water.
Definition H2O.hpp:89
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition H2O.hpp:627
static const Scalar criticalPressure()
Returns the critical pressure of water.
Definition H2O.hpp:101
static const Scalar molarMass()
The molar mass in of water.
Definition H2O.hpp:83
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition H2O.hpp:546
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
The dynamic viscosity of pure water.
Definition H2O.hpp:815
static Evaluation gasThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
Thermal conductivity of water (IAPWS) .
Definition H2O.hpp:864
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of water steam .
Definition H2O.hpp:186
Relations valid for an ideal gas.
Definition IdealGas.hpp:38
A parameter cache which does nothing.
Definition NullParameterCache.hpp:40
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition H2OAirFluidSystem.hpp:68