27 #ifndef OPM_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HPP
28 #define OPM_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HPP
48 namespace FluidSystems {
55 template <
class Scalar>
66 template <
class Evaluation>
125 if (H2O::isTabulated) {
127 pressMin, pressMax, nPress);
172 OPM_THROW(std::logic_error,
"Invalid phase index " << phaseIdx);
183 OPM_THROW(std::logic_error,
"Invalid component index " << compIdx);
201 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
202 static LhsEval
density(
const FluidState& fluidState,
206 const LhsEval& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
212 ? Opm::decay<LhsEval>(fluidState.pressure(phaseIdx))
229 ? Opm::decay<LhsEval>(fluidState.pressure(phaseIdx))
235 const LhsEval& pg = Opm::decay<LhsEval>(fluidState.pressure(
gasPhaseIdx));
236 const LhsEval& pH2O = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx))*pg;
237 const LhsEval& pAir = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx))*pg;
238 const LhsEval& pNAPL = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx))*pg;
246 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
251 const LhsEval& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
252 const LhsEval& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
290 const LhsEval& xgAir = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
291 const LhsEval& xgH2O = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
292 const LhsEval& xgNapl = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx));
293 const LhsEval& xgAW = xgAir + xgH2O;
294 const LhsEval& muAW = (mu[
airIdx]*xgAir + mu[
H2OIdx]*xgH2O)/xgAW;
302 const LhsEval& phiAWC = phiCAW * muAW*M[
NAPLIdx]/(mu[
NAPLIdx]*MAW);
304 return (xgAW*muAW)/(xgAW + xgNapl*phiAWC) + (xgNapl*mu[
NAPLIdx])/(xgNapl + xgAW*phiCAW);
308 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
318 const LhsEval& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
319 const LhsEval& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
327 const LhsEval& xga = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
328 const LhsEval& xgw = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
329 const LhsEval& xgc = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx));
331 if (compIdx==
NAPLIdx)
return (1 - xgw)/(xga/diffAW + xgc/diffWC);
332 else if (compIdx==
H2OIdx)
return (1 - xgc)/(xgw/diffWC + xga/diffAC);
333 else if (compIdx==
airIdx) OPM_THROW(std::logic_error,
334 "Diffusivity of air in the gas phase "
335 "is constraint by sum of diffusive fluxes = 0 !\n");
338 const LhsEval& diffACl = 1.e-9;
339 const LhsEval& diffWCl = 1.e-9;
340 const LhsEval& diffAWl = 1.e-9;
348 diffCont = (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
351 diffCont = (1.- xwc)/(xww/diffWCl + xwa/diffACl);
354 OPM_THROW(std::logic_error,
355 "Diffusivity of water in the water phase "
356 "is constraint by sum of diffusive fluxes = 0 !\n");
360 OPM_THROW(std::logic_error,
361 "Diffusion coefficients of "
362 "substances in liquid phase are undefined!\n");
369 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
375 assert(0 <= phaseIdx && phaseIdx <
numPhases);
378 const LhsEval& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
379 const LhsEval& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
380 Valgrind::CheckDefined(T);
381 Valgrind::CheckDefined(p);
386 else if (compIdx ==
airIdx)
401 else if (compIdx ==
airIdx)
403 else if (compIdx ==
H2OIdx)
416 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
417 static LhsEval
enthalpy(
const FluidState& fluidState,
421 const LhsEval& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
422 const LhsEval& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
439 OPM_THROW(std::logic_error,
"Invalid phase index " << phaseIdx);
443 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
448 assert(0 <= phaseIdx && phaseIdx <
numPhases);
451 const LhsEval& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
452 const LhsEval& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
457 const LhsEval& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
458 const LhsEval& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
Material properties of pure water .
Definition: H2O.hpp:61
static Evaluation henry(const Evaluation &temperature)
Henry coefficent for molecular nitrogen in liquid water.
Definition: H2O_N2.hpp:52
Binary coefficients for water and mesitylene.
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 &pressure)
The density of liquid at a given pressure and temperature .
Definition: TabulatedComponent.hpp:435
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the liquid .
Definition: TabulatedComponent.hpp:290
static void init()
Initialize the fluid system's static parameters.
Definition: H2OAirMesityleneFluidSystem.hpp:101
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 const int numPhases
Number of fluid phases in the fluid system.
Definition: H2OAirMesityleneFluidSystem.hpp:82
static Scalar molarMass()
The molar mass in of the component.
Definition: TabulatedComponent.hpp:224
static Evaluation liquidViscosity(Evaluation temperature, const Evaluation &)
The dynamic viscosity of pure mesitylene.
Definition: Mesitylene.hpp:255
A fluid system with water, gas and NAPL as phases and water, air and mesitylene (DNAPL) as components...
Definition: H2OAirMesityleneFluidSystem.hpp:56
A simple version of pure water.
Relations valid for an ideal gas.
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition: H2OAirMesityleneFluidSystem.hpp:132
static const char * componentName(unsigned compIdx)
Return the human readable name of a component.
Definition: H2OAirMesityleneFluidSystem.hpp:176
static const int H2OIdx
The index of the water component.
Definition: H2OAirMesityleneFluidSystem.hpp:94
static LhsEval thermalConductivity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Thermal conductivity of a fluid phase [W/(m K)].
Definition: H2OAirMesityleneFluidSystem.hpp:444
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: H2OAirMesityleneFluidSystem.hpp:155
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition: H2OAirMesityleneFluidSystem.hpp:247
Component for Mesitylene.
static bool isCompressible(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: H2OAirMesityleneFluidSystem.hpp:143
Opm::Air< Scalar > Air
The type of the air component.
Definition: H2OAirMesityleneFluidSystem.hpp:74
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 bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: H2OAirMesityleneFluidSystem.hpp:139
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &, bool=true)
The dynamic viscosity of mesitylene vapor.
Definition: Mesitylene.hpp:229
static const int airIdx
The index of the air pseudo-component.
Definition: H2OAirMesityleneFluidSystem.hpp:98
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Air.hpp:73
static const int NAPLIdx
The index of the NAPL component.
Definition: H2OAirMesityleneFluidSystem.hpp:96
static const int numComponents
Number of chemical species in the fluid system.
Definition: H2OAirMesityleneFluidSystem.hpp:84
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &)
The dynamic viscosity of at a given pressure and temperature.
Definition: Air.hpp:138
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Mesitylene.hpp:212
static const int naplPhaseIdx
The index of the NAPL phase.
Definition: H2OAirMesityleneFluidSystem.hpp:89
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: Mesitylene.hpp:218
static Scalar molarMass()
The molar mass in of .
Definition: Air.hpp:81
A parameter cache which does nothing.
A simple class implementing the fluid properties of air.
Definition: Air.hpp:47
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:122
Material properties of pure water .
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of gas.
Definition: TabulatedComponent.hpp:452
TabulatedH2O H2O
The type of the water component.
Definition: H2OAirMesityleneFluidSystem.hpp:78
static Evaluation henry(const Evaluation &)
Henry coefficent for mesitylene in liquid water.
Definition: H2O_Mesitylene.hpp:52
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of at a given pressure and temperature [kg/m^3].
Definition: Air.hpp:103
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition: H2OAirMesityleneFluidSystem.hpp:202
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of gas at a given pressure and temperature .
Definition: TabulatedComponent.hpp:417
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:370
static Evaluation gasThermalConductivity(const Evaluation &, const Evaluation &)
Specific heat conductivity of steam .
Definition: Air.hpp:219
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 gasDiffCoeff(const Evaluation &temperature, const Evaluation &pressure)
Binary diffusion coefficent for molecular water and air.
Definition: H2O_Air.hpp:70
static Evaluation liquidThermalConductivity(const Evaluation &temperature, const Evaluation &pressure)
The thermal conductivity of liquid water .
Definition: TabulatedComponent.hpp:503
static const char * name()
A human readable name for the component.
Definition: TabulatedComponent.hpp:218
static const char * phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition: H2OAirMesityleneFluidSystem.hpp:165
static Evaluation gasDiffCoeff(Evaluation temperature, Evaluation pressure)
Binary diffusion coefficent [m^2/s] for air and mesitylene.
Definition: Air_Mesitylene.hpp:59
static Evaluation vaporPressure(const Evaluation &temperature)
The vapor pressure in of the component at a given temperature.
Definition: TabulatedComponent.hpp:258
static Scalar molarMass()
The molar mass in of mesitylene.
Definition: Mesitylene.hpp:58
A simple class implementing the fluid properties of air.
Binary coefficients for water and mesitylene.
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition: H2OAirMesityleneFluidSystem.hpp:187
static const int waterPhaseIdx
The index of the water phase.
Definition: H2OAirMesityleneFluidSystem.hpp:87
Properties of pure molecular nitrogen .
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &)
The density of pure mesitylene at a given pressure and temperature .
Definition: Mesitylene.hpp:200
A generic class which tabulates all thermodynamic properties of a given component.
The base class for all fluid systems.
Definition: BaseFluidSystem.hpp:43
Component for Mesitylene.
Definition: Mesitylene.hpp:44
Definition: H2OAirMesityleneFluidSystem.hpp:67
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:309
A generic class which tabulates all thermodynamic properties of a given component.
Definition: TabulatedComponent.hpp:58
static const char * name()
A human readable name for the .
Definition: Air.hpp:61
Opm::Mesitylene< Scalar > NAPL
The type of the mesithylene/napl component.
Definition: H2OAirMesityleneFluidSystem.hpp:71
static const int gasPhaseIdx
The index of the gas phase.
Definition: H2OAirMesityleneFluidSystem.hpp:91
A parameter cache which does nothing.
Definition: NullParameterCache.hpp:39
Scalar Scalar
The type used for scalar quantities.
Definition: BaseFluidSystem.hpp:49
static void init(Scalar tempMin, Scalar tempMax, unsigned nTemp, Scalar pressMin, Scalar pressMax, unsigned nPress)
Initialize the tables.
Definition: TabulatedComponent.hpp:75
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the gas .
Definition: TabulatedComponent.hpp:273
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: TabulatedComponent.hpp:405
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 liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of liquid.
Definition: TabulatedComponent.hpp:469
Binary coefficients for water and nitrogen.
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of liquid mesitylene .
Definition: Mesitylene.hpp:118
The base class for all fluid systems.
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: TabulatedComponent.hpp:399
Binary coefficients for water and nitrogen.
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:417