27#ifndef OPM_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HPP
28#define OPM_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HPP
52template <
class Scalar>
63 template <
class Evaluation>
71 typedef ::Opm::Air<Scalar>
Air;
122 if (H2O::isTabulated) {
124 pressMin, pressMax, nPress);
169 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
180 throw std::logic_error(
"Invalid component index "+std::to_string(compIdx));
198 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
199 static LhsEval
density(
const FluidState& fluidState,
203 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
209 ? decay<LhsEval>(fluidState.pressure(phaseIdx))
226 ? decay<LhsEval>(fluidState.pressure(phaseIdx))
232 const LhsEval& pg = decay<LhsEval>(fluidState.pressure(
gasPhaseIdx));
233 const LhsEval& pH2O = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx))*pg;
234 const LhsEval& pAir = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx))*pg;
235 const LhsEval& pNAPL = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx))*pg;
243 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
248 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
249 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
287 const LhsEval& xgAir = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
288 const LhsEval& xgH2O = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
289 const LhsEval& xgNapl = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx));
290 const LhsEval& xgAW = xgAir + xgH2O;
291 const LhsEval& muAW = (mu[
airIdx]*xgAir + mu[
H2OIdx]*xgH2O)/xgAW;
299 const LhsEval& phiAWC = phiCAW * muAW*M[
NAPLIdx]/(mu[
NAPLIdx]*MAW);
301 return (xgAW*muAW)/(xgAW + xgNapl*phiAWC) + (xgNapl*mu[
NAPLIdx])/(xgNapl + xgAW*phiCAW);
305 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
315 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
316 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
324 const LhsEval& xga = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
325 const LhsEval& xgw = decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
328 if (compIdx==
NAPLIdx)
return (1 - xgw)/(xga/diffAW + xgc/diffWC);
329 else if (compIdx==
H2OIdx)
return (1 - xgc)/(xgw/diffWC + xga/diffAC);
330 else if (compIdx==
airIdx)
throw std::logic_error(
"Diffusivity of air in the gas phase "
331 "is constraint by sum of diffusive fluxes = 0 !\n");
334 const LhsEval& diffACl = 1.e-9;
335 const LhsEval& diffWCl = 1.e-9;
336 const LhsEval& diffAWl = 1.e-9;
344 diffCont = (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
347 diffCont = (1.- xwc)/(xww/diffWCl + xwa/diffACl);
350 throw std::logic_error(
"Diffusivity of water in the water phase "
351 "is constraint by sum of diffusive fluxes = 0 !\n");
355 throw std::logic_error(
"Diffusion coefficients of "
356 "substances in liquid phase are undefined!\n");
363 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
372 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
373 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
374 Valgrind::CheckDefined(T);
375 Valgrind::CheckDefined(p);
380 else if (compIdx ==
airIdx)
395 else if (compIdx ==
airIdx)
397 else if (compIdx ==
H2OIdx)
410 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
411 static LhsEval
enthalpy(
const FluidState& fluidState,
415 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
416 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
433 throw std::logic_error(
"Invalid phase index "+std::to_string(phaseIdx));
437 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
445 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
446 const LhsEval& p = decay<LhsEval>(fluidState.pressure(phaseIdx));
451 const LhsEval& T = decay<LhsEval>(fluidState.temperature(phaseIdx));
452 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:217
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of at a given pressure and temperature [kg/m^3].
Definition Air.hpp:102
static Scalar molarMass()
The molar mass in of .
Definition Air.hpp:80
static const char * name()
A human readable name for the .
Definition Air.hpp:60
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition Air.hpp:72
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of liquid water with 273.15 K as basis.
Definition Air.hpp:180
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition Air.hpp:137
The base class for all fluid systems.
Definition BaseFluidSystem.hpp:46
Scalar Scalar
The type used for scalar quantities.
Definition BaseFluidSystem.hpp:51
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:55
static const int numComponents
Number of chemical species in the fluid system.
Definition H2OAirMesityleneFluidSystem.hpp:81
static const int airIdx
The index of the air pseudo-component.
Definition H2OAirMesityleneFluidSystem.hpp:95
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:364
static const int H2OIdx
The index of the water component.
Definition H2OAirMesityleneFluidSystem.hpp:91
static const int waterPhaseIdx
The index of the water phase.
Definition H2OAirMesityleneFluidSystem.hpp:84
static const int naplPhaseIdx
The index of the NAPL phase.
Definition H2OAirMesityleneFluidSystem.hpp:86
Mesitylene< Scalar > NAPL
The type of the mesithylene/napl component.
Definition H2OAirMesityleneFluidSystem.hpp:68
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:119
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition H2OAirMesityleneFluidSystem.hpp:129
static LhsEval thermalConductivity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition H2OAirMesityleneFluidSystem.hpp:438
TabulatedH2O H2O
The type of the water component.
Definition H2OAirMesityleneFluidSystem.hpp:75
static bool isCompressible(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition H2OAirMesityleneFluidSystem.hpp:140
static const int NAPLIdx
The index of the NAPL component.
Definition H2OAirMesityleneFluidSystem.hpp:93
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition H2OAirMesityleneFluidSystem.hpp:184
static const char * componentName(unsigned compIdx)
Return the human readable name of a component.
Definition H2OAirMesityleneFluidSystem.hpp:173
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition H2OAirMesityleneFluidSystem.hpp:199
static const char * phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition H2OAirMesityleneFluidSystem.hpp:162
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition H2OAirMesityleneFluidSystem.hpp:244
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:306
static const int numPhases
Number of fluid phases in the fluid system.
Definition H2OAirMesityleneFluidSystem.hpp:79
static const int gasPhaseIdx
The index of the gas phase.
Definition H2OAirMesityleneFluidSystem.hpp:88
static void init()
Initialize the fluid system's static parameters.
Definition H2OAirMesityleneFluidSystem.hpp:98
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition H2OAirMesityleneFluidSystem.hpp:152
::Opm::Air< Scalar > Air
The type of the air component.
Definition H2OAirMesityleneFluidSystem.hpp:71
static bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition H2OAirMesityleneFluidSystem.hpp:136
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:411
Material properties of pure water .
Definition H2O.hpp:65
Component for Mesitylene.
Definition Mesitylene.hpp:45
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition Mesitylene.hpp:218
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:99
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of liquid mesitylene .
Definition Mesitylene.hpp:118
static Scalar molarMass()
The molar mass in of mesitylene.
Definition Mesitylene.hpp:58
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of pure mesitylene vapor at a given pressure and temperature .
Definition Mesitylene.hpp:190
static const char * name()
A human readable name for the mesitylene.
Definition Mesitylene.hpp:52
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition Mesitylene.hpp:212
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of mesitylene vapor .
Definition Mesitylene.hpp:178
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &)
The density of pure mesitylene at a given pressure and temperature .
Definition Mesitylene.hpp:200
static Evaluation liquidViscosity(Evaluation temperature, const Evaluation &)
The dynamic viscosity of pure mesitylene.
Definition Mesitylene.hpp:255
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &, bool=true)
The dynamic viscosity of mesitylene vapor.
Definition Mesitylene.hpp:229
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 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
static const char * name()
A human readable name for the component.
Definition TabulatedComponent.hpp:215
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition H2OAirMesityleneFluidSystem.hpp:65