27#ifndef OPM_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HPP
28#define OPM_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HPP
54template <
class Scalar>
65 template <
class Evaluation>
73 typedef ::Opm::Air<Scalar>
Air;
124 if (H2O::isTabulated) {
126 pressMin, pressMax, nPress);
171 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
182 throw std::logic_error(
"Invalid component index "+std::to_string(compIdx));
200 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
201 static LhsEval
density(
const FluidState& fluidState,
205 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
211 ? decay<LhsEval>(fluidState.pressure(phaseIdx))
228 ? decay<LhsEval>(fluidState.pressure(phaseIdx))
234 const LhsEval& pg = decay<LhsEval>(fluidState.pressure(
gasPhaseIdx));
235 const LhsEval& pH2O = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx))*pg;
236 const LhsEval& pAir = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx))*pg;
237 const LhsEval& pNAPL = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx))*pg;
245 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
250 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
251 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
289 const LhsEval& xgAir = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
290 const LhsEval& xgH2O = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
291 const LhsEval& xgNapl = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx));
292 const LhsEval& xgAW = xgAir + xgH2O;
293 const LhsEval& muAW = (mu[
airIdx]*xgAir + mu[
H2OIdx]*xgH2O)/xgAW;
301 const LhsEval& phiAWC = phiCAW * muAW*M[
NAPLIdx]/(mu[
NAPLIdx]*MAW);
303 return (xgAW*muAW)/(xgAW + xgNapl*phiAWC) + (xgNapl*mu[
NAPLIdx])/(xgNapl + xgAW*phiCAW);
307 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
317 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
318 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
326 const LhsEval& xga = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
327 const LhsEval& xgw = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
330 if (compIdx==
NAPLIdx)
return (1 - xgw)/(xga/diffAW + xgc/diffWC);
331 else if (compIdx==
H2OIdx)
return (1 - xgc)/(xgw/diffWC + xga/diffAC);
332 else if (compIdx==
airIdx)
throw std::logic_error(
"Diffusivity of air in the gas phase "
333 "is constraint by sum of diffusive fluxes = 0 !\n");
336 const LhsEval& diffACl = 1.e-9;
337 const LhsEval& diffWCl = 1.e-9;
338 const LhsEval& diffAWl = 1.e-9;
346 diffCont = (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
349 diffCont = (1.- xwc)/(xww/diffWCl + xwa/diffACl);
352 throw std::logic_error(
"Diffusivity of water in the water phase "
353 "is constraint by sum of diffusive fluxes = 0 !\n");
357 throw std::logic_error(
"Diffusion coefficients of "
358 "substances in liquid phase are undefined!\n");
365 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
374 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
375 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
376 Valgrind::CheckDefined(T);
377 Valgrind::CheckDefined(p);
382 else if (compIdx ==
airIdx)
397 else if (compIdx ==
airIdx)
399 else if (compIdx ==
H2OIdx)
412 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
413 static LhsEval
enthalpy(
const FluidState& fluidState,
417 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
418 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
435 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
439 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
447 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
448 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
453 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
454 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
A simple class implementing the fluid properties of air.
Binary coefficients for water and mesitylene.
The base class for all fluid systems.
Material properties of pure water .
Binary coefficients for water and nitrogen.
Binary coefficients for water and mesitylene.
Binary coefficients for water and nitrogen.
Relations valid for an ideal gas.
Component for Mesitylene.
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.
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Specific heat conductivity of steam .
Definition Air.hpp:219
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 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
Scalar Scalar
The type used for scalar quantities.
Definition BaseFluidSystem.hpp:52
static Evaluation gasDiffCoeff(Evaluation temperature, Evaluation pressure)
Binary diffusion coefficent [m^2/s] for air and mesitylene.
Definition Air_Mesitylene.hpp:59
static Evaluation gasDiffCoeff(const Evaluation &temperature, const Evaluation &pressure)
Binary diffusion coefficent for molecular water and air.
Definition H2O_Air.hpp:70
static Evaluation henry(const Evaluation &)
Henry coefficent for mesitylene in liquid water.
Definition H2O_Mesitylene.hpp:52
static Evaluation gasDiffCoeff(Evaluation temperature, Evaluation pressure)
Binary diffusion coefficent [m^2/s] for molecular water and mesitylene.
Definition H2O_Mesitylene.hpp:67
static Evaluation henry(const Evaluation &temperature)
Henry coefficent for molecular nitrogen in liquid water.
Definition H2O_N2.hpp:52
A fluid system with water, gas and NAPL as phases and water, air and mesitylene (DNAPL) as components...
Definition H2OAirMesityleneFluidSystem.hpp:57
static const int numComponents
Number of chemical species in the fluid system.
Definition H2OAirMesityleneFluidSystem.hpp:83
static const int airIdx
The index of the air pseudo-component.
Definition H2OAirMesityleneFluidSystem.hpp:97
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 H2OAirMesityleneFluidSystem.hpp:366
static const int H2OIdx
The index of the water component.
Definition H2OAirMesityleneFluidSystem.hpp:93
static const int waterPhaseIdx
The index of the water phase.
Definition H2OAirMesityleneFluidSystem.hpp:86
static const int naplPhaseIdx
The index of the NAPL phase.
Definition H2OAirMesityleneFluidSystem.hpp:88
Mesitylene< Scalar > NAPL
The type of the mesithylene/napl component.
Definition H2OAirMesityleneFluidSystem.hpp:70
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 H2OAirMesityleneFluidSystem.hpp:121
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition H2OAirMesityleneFluidSystem.hpp:131
static LhsEval thermalConductivity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition H2OAirMesityleneFluidSystem.hpp:440
TabulatedH2O H2O
The type of the water component.
Definition H2OAirMesityleneFluidSystem.hpp:77
static bool isCompressible(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition H2OAirMesityleneFluidSystem.hpp:142
static const int NAPLIdx
The index of the NAPL component.
Definition H2OAirMesityleneFluidSystem.hpp:95
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition H2OAirMesityleneFluidSystem.hpp:186
static std::string_view componentName(unsigned compIdx)
Return the human readable name of a component.
Definition H2OAirMesityleneFluidSystem.hpp:175
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition H2OAirMesityleneFluidSystem.hpp:201
static std::string_view phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition H2OAirMesityleneFluidSystem.hpp:164
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition H2OAirMesityleneFluidSystem.hpp:246
static LhsEval diffusionCoefficient(const FluidState &, const ParameterCache< ParamCacheEval > &, unsigned, unsigned)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol^2 * s / (k...
Definition H2OAirMesityleneFluidSystem.hpp:308
static const int numPhases
Number of fluid phases in the fluid system.
Definition H2OAirMesityleneFluidSystem.hpp:81
static const int gasPhaseIdx
The index of the gas phase.
Definition H2OAirMesityleneFluidSystem.hpp:90
static void init()
Initialize the fluid system's static parameters.
Definition H2OAirMesityleneFluidSystem.hpp:100
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition H2OAirMesityleneFluidSystem.hpp:154
::Opm::Air< Scalar > Air
The type of the air component.
Definition H2OAirMesityleneFluidSystem.hpp:73
static bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition H2OAirMesityleneFluidSystem.hpp:138
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 H2OAirMesityleneFluidSystem.hpp:413
Material properties of pure water .
Definition H2O.hpp:65
Component for Mesitylene.
Definition Mesitylene.hpp:47
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition Mesitylene.hpp:220
static Evaluation vaporPressure(const Evaluation &temperature)
The saturation vapor pressure in of pure mesitylene at a given temperature according to Antoine afte...
Definition Mesitylene.hpp:101
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of liquid mesitylene .
Definition Mesitylene.hpp:120
static Scalar molarMass()
The molar mass in of mesitylene.
Definition Mesitylene.hpp:60
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of pure mesitylene vapor at a given pressure and temperature .
Definition Mesitylene.hpp:192
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition Mesitylene.hpp:214
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of mesitylene vapor .
Definition Mesitylene.hpp:180
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &)
The density of pure mesitylene at a given pressure and temperature .
Definition Mesitylene.hpp:202
static Evaluation liquidViscosity(Evaluation temperature, const Evaluation &)
The dynamic viscosity of pure mesitylene.
Definition Mesitylene.hpp:257
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &, bool=true)
The dynamic viscosity of mesitylene vapor.
Definition Mesitylene.hpp:231
static std::string_view name()
A human readable name for the mesitylene.
Definition Mesitylene.hpp:54
A parameter cache which does nothing.
Definition NullParameterCache.hpp:40
A generic class which tabulates all thermodynamic properties of a given component.
Definition TabulatedComponent.hpp:56
static std::string_view name()
A human readable name for the component.
Definition TabulatedComponent.hpp:215
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the gas .
Definition TabulatedComponent.hpp:282
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the tables.
Definition TabulatedComponent.hpp:72
static Scalar molarMass()
The molar mass in of the component.
Definition TabulatedComponent.hpp:221
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition TabulatedComponent.hpp:408
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of liquid.
Definition TabulatedComponent.hpp:478
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature .
Definition TabulatedComponent.hpp:426
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition TabulatedComponent.hpp:414
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of liquid at a given pressure and temperature .
Definition TabulatedComponent.hpp:444
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of the component at a given temperature.
Definition TabulatedComponent.hpp:267
static Evaluation liquidThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of liquid water .
Definition TabulatedComponent.hpp:512
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of gas.
Definition TabulatedComponent.hpp:461
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the liquid .
Definition TabulatedComponent.hpp:299
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition H2OAirMesityleneFluidSystem.hpp:67