12#ifndef DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH
13#define DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH
31namespace FluidSystems {
41template <
class Scalar,
42 class H2OType = Components::TabulatedComponent<Components::H2O<Scalar> > >
44 :
public Base<Scalar, H2OAirMesitylene<Scalar, H2OType> >
102 if (H2O::isTabulated)
104 H2O::init(tempMin, tempMax, nTemp,
105 pressMin, pressMax, nPress);
120 static constexpr bool isGas(
int phaseIdx)
122 assert(0 <= phaseIdx && phaseIdx <
numPhases);
151 assert(0 <= phaseIdx && phaseIdx <
numPhases);
169 assert(0 <= phaseIdx && phaseIdx <
numPhases);
175 return H2O::liquidIsCompressible();
186 assert(0 <= phaseIdx && phaseIdx <
numPhases);
193 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
202 case H2OIdx:
return H2O::name();
206 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
216 case H2OIdx:
return H2O::molarMass();
220 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
236 template <
class Flu
idState>
243 return H2O::liquidMolarDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx))
264 return H2O::gasDensity(fluidState.temperature(phaseIdx), pH2O)
271 template <
class Flu
idState>
301 template <
class Flu
idState>
307 return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
308 fluidState.pressure(phaseIdx));
313 fluidState.pressure(phaseIdx));
332 Air::gasViscosity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx)),
362 muResult = (xAW*muAW)/(xAW+fluidState.moleFraction(
gPhaseIdx,
NAPLIdx)*phiAWC)
377 template <
class Flu
idState>
395 return (1.- xgw)/(xga/diffAW + xgc/diffWC);
404 return (1.- xgc)/(xgw/diffWC + xga/diffAC);
407 DUNE_THROW(Dune::InvalidStateException,
"Diffusivity of Air in the gas phase is constraint by sum of diffusive fluxes = 0 !");
423 return (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
425 return (1.- xwc)/(xww/diffWCl + xwa/diffACl);
427 DUNE_THROW(Dune::InvalidStateException,
428 "Diffusivity of water in the water phase "
429 "is constraint by sum of diffusive fluxes = 0 !\n");
442 template <
class Flu
idState>
448 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirMesitylene::binaryDiffusionCoefficient()");
465 template <
class Flu
idState>
470 assert(0 <= phaseIdx && phaseIdx <
numPhases);
473 Scalar T = fluidState.temperature(phaseIdx);
474 Scalar p = fluidState.pressure(phaseIdx);
478 return H2O::vaporPressure(T)/p;
479 else if (compIdx ==
AirIdx)
494 else if (compIdx ==
AirIdx)
496 else if (compIdx ==
H2OIdx)
506 template <
class Flu
idState>
511 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirMesitylene::kelvinVaporPressure()");
524 template <
class Flu
idState>
529 return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
536 fluidState.pressure(phaseIdx));
537 Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
538 fluidState.pressure(phaseIdx));
549 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
558 template <
class Flu
idState>
561 const Scalar T = fluidState.temperature(phaseIdx);
562 const Scalar p = fluidState.pressure(phaseIdx);
566 if (componentIdx ==
H2OIdx)
567 return H2O::liquidEnthalpy(T, p);
568 else if (componentIdx ==
NAPLIdx)
569 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for NAPL in water is not implemented.");
570 else if (componentIdx ==
AirIdx)
571 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for Air in water is not implemented.");
572 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
576 if (componentIdx ==
H2OIdx)
577 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for water in NAPL is not implemented.");
578 else if (componentIdx ==
NAPLIdx)
580 else if (componentIdx ==
AirIdx)
581 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for air in NAPL is not implemented.");
582 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
586 if (componentIdx ==
H2OIdx)
587 return H2O::gasEnthalpy(T, p);
588 else if (componentIdx ==
NAPLIdx)
590 else if (componentIdx ==
AirIdx)
592 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
594 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
599 template <
class Flu
idState>
603 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirMesitylene::heatCapacity()");
608 template <
class Flu
idState>
626 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
632 Scalar rholH2O = H2O::liquidDensity(T, pw);
633 Scalar clH2O = rholH2O/H2O::molarMass();
A simple class for the air fluid properties.
Binary coefficients for air and mesitylene.
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for air and mesitylene in liquid water.
Definition: air_mesitylene.hh:97
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for air and mesitylene. I used the method according to Wilke and Lee se...
Definition: air_mesitylene.hh:47
static Scalar henry(Scalar temperature)
Henry coefficient for air in liquid water.
Definition: h2o_air.hh:36
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and air.
Definition: h2o_air.hh:56
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for molecular nitrogen in liquid water.
Definition: h2o_air.hh:89
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for mesitylene in liquid water.
Definition: h2o_mesitylene.hh:104
static Scalar henry(Scalar temperature)
Henry coefficient for mesitylene in liquid water.
Definition: h2o_mesitylene.hh:38
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and mesitylene.
Definition: h2o_mesitylene.hh:54
A class for the air fluid properties.
Definition: air.hh:35
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of Air at a given pressure and temperature.
Definition: air.hh:73
static constexpr Scalar molarMass()
The molar mass in of Air.
Definition: air.hh:50
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of Air at a given pressure and temperature.
Definition: air.hh:181
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of air.
Definition: air.hh:339
static constexpr bool gasIsIdeal()
Returns true, the gas phase is assumed to be ideal.
Definition: air.hh:97
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of Air with 273.15 as basis.
Definition: air.hh:264
static std::string name()
A human readable name for Air.
Definition: air.hh:42
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of air in , depending on pressure and temperature.
Definition: air.hh:85
mesitylene
Definition: mesitylene.hh:36
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of mesitylene in , depending on pressure and temperature.
Definition: mesitylene.hh:207
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of mesitylene vapor .
Definition: mesitylene.hh:183
static std::string name()
A human readable name for the mesitylene.
Definition: mesitylene.hh:43
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure mesitylene at a given pressure and temperature .
Definition: mesitylene.hh:230
static constexpr Scalar molarMass()
The molar mass in of mesitylene.
Definition: mesitylene.hh:49
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of mesitylene.
Definition: mesitylene.hh:366
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of mesitylene vapor.
Definition: mesitylene.hh:270
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of pure mesitylene at a given temperature according to Antoine afte...
Definition: mesitylene.hh:93
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: mesitylene.hh:261
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of mesitylene at a given pressure and temperature .
Definition: mesitylene.hh:194
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid mesitylene .
Definition: mesitylene.hh:112
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure mesitylene at a given pressure and temperature .
Definition: mesitylene.hh:216
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: mesitylene.hh:255
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure mesitylene.
Definition: mesitylene.hh:300
Fluid system base class.
Definition: fluidsystems/base.hh:33
Scalar Scalar
export the scalar type
Definition: fluidsystems/base.hh:36
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water and air (Pseu...
Definition: h2oairmesitylene.hh:45
static const int numComponents
Definition: h2oairmesitylene.hh:55
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Thermal conductivity of a fluid phase .
Definition: h2oairmesitylene.hh:609
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition: h2oairmesitylene.hh:272
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2oairmesitylene.hh:78
static const int numPhases
Definition: h2oairmesitylene.hh:54
static const int nPhaseIdx
Definition: h2oairmesitylene.hh:58
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition: h2oairmesitylene.hh:559
static const int H2OIdx
Definition: h2oairmesitylene.hh:61
static const int AirIdx
Definition: h2oairmesitylene.hh:63
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition: h2oairmesitylene.hh:213
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Return the viscosity of a phase .
Definition: h2oairmesitylene.hh:302
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given all mole fractions in a phase, return the specific phase enthalpy .
Definition: h2oairmesitylene.hh:525
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2oairmesitylene.hh:132
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Given all mole fractions, return the diffusion coefficient in of a component in a phase.
Definition: h2oairmesitylene.hh:378
static const int wPhaseIdx
Definition: h2oairmesitylene.hh:57
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2oairmesitylene.hh:120
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2oairmesitylene.hh:167
static const int wCompIdx
Definition: h2oairmesitylene.hh:68
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Returns the fugacity coefficient of a component in a phase.
Definition: h2oairmesitylene.hh:466
static const int gPhaseIdx
Definition: h2oairmesitylene.hh:59
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: h2oairmesitylene.hh:99
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2oairmesitylene.hh:112
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition: h2oairmesitylene.hh:600
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2oairmesitylene.hh:149
static std::string componentName(int compIdx)
Return the human readable name of a component (used in indices)
Definition: h2oairmesitylene.hh:199
static Scalar density(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure, and the partial pressures of all components,...
Definition: h2oairmesitylene.hh:237
static const int NAPLIdx
Definition: h2oairmesitylene.hh:62
H2OType H2O
Definition: h2oairmesitylene.hh:51
static const int gCompIdx
Definition: h2oairmesitylene.hh:70
static const int nCompIdx
Definition: h2oairmesitylene.hh:69
static std::string phaseName(int phaseIdx)
Return the human readable name of a phase (used in indices)
Definition: h2oairmesitylene.hh:184
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Definition: h2oairmesitylene.hh:507
static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIIdx, int compJIdx)
Given a phase's composition, temperature and pressure, return the binary diffusion coefficient for c...
Definition: h2oairmesitylene.hh:443
Material properties of pure water .
Binary coefficients for water and air.
Binary coefficients for water and mesitylene.
Relations valid for an ideal gas.
Properties of mesitylene.
A collection of input/output field names for common physical quantities.
Scalar h2oGasViscosityInMixture(Scalar temperature, Scalar pressure)
The dynamic viscosity of steam in a gas mixture.
Definition: h2o.hh:961
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:39
std::string gaseousPhase() noexcept
I/O name of gaseous phase.
Definition: name.hh:111
std::string naplPhase() noexcept
I/O name of napl phase.
Definition: name.hh:119
std::string aqueousPhase() noexcept
I/O name of aqueous phase.
Definition: name.hh:115
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:22
Tabulates all thermodynamic properties of a given untabulated chemical species.