27 #ifndef OPM_H2O_AIR_XYLENE_FLUID_SYSTEM_HPP 28 #define OPM_H2O_AIR_XYLENE_FLUID_SYSTEM_HPP 44 namespace FluidSystems {
51 template <
class Scalar>
59 template <
class Evaluation>
137 OPM_THROW(std::logic_error,
"Invalid phase index " << phaseIdx);
148 OPM_THROW(std::logic_error,
"Invalid component index " << compIdx);
168 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
169 static LhsEval
density(
const FluidState& fluidState,
174 const auto& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
175 const auto& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
191 const auto& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
196 const auto& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
197 const auto& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
199 const LhsEval& pH2O = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx))*p;
200 const LhsEval& pAir = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx))*p;
201 const LhsEval& pNAPL = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx))*p;
209 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
214 const auto& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
215 const auto& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
241 Air::simpleGasViscosity(T, p),
251 const auto& xgAir = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
252 const auto& xgH2O = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
253 const auto& xgNapl = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx));
255 const LhsEval& xgAW = xgAir + xgH2O;
256 const LhsEval& muAW = (mu[
airIdx]*xgAir + mu[
H2OIdx]*xgH2O)/ xgAW;
265 const LhsEval& phiAWC = phiCAW * muAW*M[
NAPLIdx]/(mu[
NAPLIdx]*MAW);
267 return (xgAW*muAW)/(xgAW+xgNapl*phiAWC) + (xgNapl*mu[
NAPLIdx])/(xgNapl + xgAW*phiCAW);
271 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
278 const auto& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
279 const auto& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
285 const LhsEval& xga = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
airIdx));
286 const LhsEval& xgw = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
H2OIdx));
287 const LhsEval& xgc = Opm::decay<LhsEval>(fluidState.moleFraction(
gasPhaseIdx,
NAPLIdx));
289 if (compIdx==
NAPLIdx)
return (1.- xgw)/(xga/diffAW + xgc/diffWC);
290 else if (compIdx==
H2OIdx)
return (1.- xgc)/(xgw/diffWC + xga/diffAC);
291 else if (compIdx==
airIdx) OPM_THROW(std::logic_error,
292 "Diffusivity of air in the gas phase " 293 "is constraint by sum of diffusive fluxes = 0 !\n");
305 return (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
307 return (1.- xwc)/(xww/diffWCl + xwa/diffACl);
309 OPM_THROW(std::logic_error,
310 "Diffusivity of water in the water phase " 311 "is constraint by sum of diffusive fluxes = 0 !\n");
315 OPM_THROW(std::logic_error,
316 "Diffusion coefficients of " 317 "substances in liquid phase are undefined!\n");
323 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
329 assert(0 <= phaseIdx && phaseIdx <
numPhases);
332 const auto& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
333 const auto& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
338 else if (compIdx ==
airIdx)
353 else if (compIdx ==
airIdx)
355 else if (compIdx ==
H2OIdx)
366 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar,
class ParamCacheEval = LhsEval>
367 static LhsEval
enthalpy(
const FluidState& fluidState,
371 const auto& T = Opm::decay<LhsEval>(fluidState.temperature(phaseIdx));
372 const auto& p = Opm::decay<LhsEval>(fluidState.pressure(phaseIdx));
386 result += hgw * Opm::decay<LhsEval>(fluidState.massFraction(
gasPhaseIdx,
H2OIdx));
387 result += hga * Opm::decay<LhsEval>(fluidState.massFraction(
gasPhaseIdx,
airIdx));
392 OPM_THROW(std::logic_error,
"Invalid phase index " << phaseIdx);
396 template <
class LhsEval>
397 static LhsEval waterPhaseDensity_(
const LhsEval& T,
411 template <
class LhsEval>
412 static LhsEval gasPhaseDensity_(
const LhsEval& T,
419 template <
class LhsEval>
420 static LhsEval NAPLPhaseDensity_(
const LhsEval& T,
const LhsEval& pn)
Material properties of pure water .
Definition: H2O.hpp:61
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of pure water in at a given pressure and temperature.
Definition: H2O.hpp:678
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Xylene.hpp:277
static bool isCompressible(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: H2OAirXyleneFluidSystem.hpp:116
static const int waterPhaseIdx
The index of the water phase.
Definition: H2OAirXyleneFluidSystem.hpp:76
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: H2O.hpp:618
static LhsEval viscosity(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the dynamic viscosity of a fluid phase [Pa*s].
Definition: H2OAirXyleneFluidSystem.hpp:210
static const int numComponents
Number of chemical species in the fluid system.
Definition: H2OAirXyleneFluidSystem.hpp:73
static const int numPhases
Number of fluid phases in the fluid system.
Definition: H2OAirXyleneFluidSystem.hpp:71
static void init()
Initialize the fluid system's static parameters.
Definition: H2OAirXyleneFluidSystem.hpp:90
Relations valid for an ideal gas.
static const int naplPhaseIdx
The index of the NAPL phase.
Definition: H2OAirXyleneFluidSystem.hpp:78
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the pure component in gas.
Definition: Xylene.hpp:211
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: H2O.hpp:537
static Evaluation vaporPressure(const Evaluation &temperature)
The saturation vapor pressure in of pure xylene at a given temperature according to Antoine after Be...
Definition: Xylene.hpp:95
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of steam.
Definition: H2O.hpp:779
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: H2OAirXyleneFluidSystem.hpp:367
static Scalar molarMass(unsigned compIdx)
Return the molar mass of a component in [kg/mol].
Definition: H2OAirXyleneFluidSystem.hpp:152
static const char * phaseName(unsigned phaseIdx)
Return the human readable name of a fluid phase.
Definition: H2OAirXyleneFluidSystem.hpp:130
static bool gasIsIdeal()
Returns true iff the gas phase is assumed to be ideal.
Definition: Air.hpp:73
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of steam in at a given pressure and temperature.
Definition: H2O.hpp:553
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of liquid water .
Definition: H2O.hpp:228
Binary coefficients for water and xylene.
Opm::Xylene< Scalar > NAPL
The type of the xylene/napl component.
Definition: H2OAirXyleneFluidSystem.hpp:66
Definition: Air_Mesitylene.hpp:33
static Scalar molarMass()
The molar mass in of .
Definition: Air.hpp:81
static const char * name()
A human readable name for the xylene.
Definition: Xylene.hpp:55
static const int airIdx
The index of the air pseudo-component.
Definition: H2OAirXyleneFluidSystem.hpp:87
Opm::Air< Scalar > Air
The type of the air component.
Definition: H2OAirXyleneFluidSystem.hpp:68
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure)
The density in of the component at a given pressure in and temperature in .
Definition: Xylene.hpp:220
A parameter cache which does nothing.
A simple class implementing the fluid properties of air.
Definition: Air.hpp:47
static Evaluation henry(const Evaluation &temperature)
Henry coefficent for air in liquid water.
Definition: H2O_Air.hpp:55
Material properties of pure water .
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &)
The dynamic viscosity of the pure component at a given pressure in and temperature in ...
Definition: Xylene.hpp:290
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 Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of the pure component in liquid.
Definition: Xylene.hpp:149
static LhsEval density(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx)
Calculate the density [kg/m^3] of a fluid phase.
Definition: H2OAirXyleneFluidSystem.hpp:169
static const char * name()
A human readable name for the water.
Definition: H2O.hpp:74
A fluid system with water, gas and NAPL as phases and water, air and NAPL (contaminant) as components...
Definition: H2OAirXyleneFluidSystem.hpp:52
static bool liquidIsCompressible()
Returns true iff the liquid phase is assumed to be compressible.
Definition: Xylene.hpp:283
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 LhsEval diffusionCoefficient(const FluidState &fluidState, const ParameterCache< ParamCacheEval > &, unsigned phaseIdx, unsigned compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol^2 * s / (k...
Definition: H2OAirXyleneFluidSystem.hpp:272
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure)
The dynamic viscosity of pure water.
Definition: H2O.hpp:804
A simple class implementing the fluid properties of air.
static bool isIdealMixture(unsigned)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: H2OAirXyleneFluidSystem.hpp:105
static Evaluation vaporPressure(Evaluation temperature)
The vapor pressure in of pure water at a given temperature.
Definition: H2O.hpp:132
static Evaluation gasDiffCoeff(Evaluation temperature, Evaluation pressure)
Binary diffusion coefficent [m^2/s] for molecular water and xylene.
Definition: H2O_Xylene.hpp:66
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure)
Specific enthalpy of water steam .
Definition: H2O.hpp:177
static Evaluation liquidViscosity(Evaluation temperature, const Evaluation &)
The dynamic liquid viscosity of the pure component.
Definition: Xylene.hpp:309
static const int H2OIdx
The index of the water component.
Definition: H2OAirXyleneFluidSystem.hpp:83
static bool isIdealGas(unsigned phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: H2OAirXyleneFluidSystem.hpp:101
static Scalar molarMass()
The molar mass in of xylene.
Definition: Xylene.hpp:61
A generic class which tabulates all thermodynamic properties of a given component.
The base class for all fluid systems.
Definition: BaseFluidSystem.hpp:43
static const int NAPLIdx
The index of the NAPL component.
Definition: H2OAirXyleneFluidSystem.hpp:85
static bool isLiquid(unsigned phaseIdx)
Return whether a phase is liquid.
Definition: H2OAirXyleneFluidSystem.hpp:94
static Evaluation gasDiffCoeff(Evaluation temperature, Evaluation pressure)
Binary diffusion coefficent [m^2/s] for air and xylene.
Definition: Air_Xylene.hpp:57
static const char * name()
A human readable name for the .
Definition: Air.hpp:61
Component for Xylene.
Definition: Xylene.hpp:46
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure)
The density of the liquid component at a given pressure in and temperature in . ...
Definition: Xylene.hpp:265
A parameter cache which does nothing.
Definition: NullParameterCache.hpp:39
static const Scalar molarMass()
The molar mass in of water.
Definition: H2O.hpp:80
Scalar Scalar
The type used for scalar quantities.
Definition: BaseFluidSystem.hpp:49
Binary coefficients for water and xylene.
Definition: H2OAirXyleneFluidSystem.hpp:60
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: H2OAirXyleneFluidSystem.hpp:324
Opm::H2O< Scalar > H2O
The type of the water component.
Definition: H2OAirXyleneFluidSystem.hpp:64
static Evaluation henry(const Evaluation &)
Henry coefficent for xylene in liquid water.
Definition: H2O_Xylene.hpp:51
Binary coefficients for water and nitrogen.
The base class for all fluid systems.
static const int gasPhaseIdx
The index of the gas phase.
Definition: H2OAirXyleneFluidSystem.hpp:80
static const char * componentName(unsigned compIdx)
Return the human readable name of a component.
Definition: H2OAirXyleneFluidSystem.hpp:141