24#ifndef DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH
25#define DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH
53template <
class Scalar,
54 class H2OType = Components::TabulatedComponent<Components::H2O<Scalar> > >
56 :
public Base<Scalar, H2OAirMesitylene<Scalar, H2OType> >
115 if (H2O::isTabulated)
117 H2O::init(tempMin, tempMax, nTemp,
118 pressMin, pressMax, nPress);
133 static constexpr bool isGas(
int phaseIdx)
135 assert(0 <= phaseIdx && phaseIdx <
numPhases);
164 assert(0 <= phaseIdx && phaseIdx <
numPhases);
182 assert(0 <= phaseIdx && phaseIdx <
numPhases);
188 return H2O::liquidIsCompressible();
199 assert(0 <= phaseIdx && phaseIdx <
numPhases);
206 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
215 case H2OIdx:
return H2O::name();
219 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
229 case H2OIdx:
return H2O::molarMass();
233 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << compIdx);
249 template <
class Flu
idState>
256 return H2O::liquidMolarDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx))
277 return H2O::gasDensity(fluidState.temperature(phaseIdx), pH2O)
292 template <
class Flu
idState>
295 Scalar temperature = fluidState.temperature(phaseIdx);
296 Scalar pressure = fluidState.pressure(phaseIdx);
305 return H2O::liquidMolarDensity(temperature, pressure);
309 return H2O::gasMolarDensity(temperature, fluidState.partialPressure(
gPhaseIdx,
H2OIdx))
322 template <
class Flu
idState>
328 return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
329 fluidState.pressure(phaseIdx));
334 fluidState.pressure(phaseIdx));
353 Air::gasViscosity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx)),
383 muResult = (xAW*muAW)/(xAW+fluidState.moleFraction(
gPhaseIdx,
NAPLIdx)*phiAWC)
398 template <
class Flu
idState>
416 return (1.- xgw)/(xga/diffAW + xgc/diffWC);
425 return (1.- xgc)/(xgw/diffWC + xga/diffAC);
428 DUNE_THROW(Dune::InvalidStateException,
"Diffusivity of Air in the gas phase is constraint by sum of diffusive fluxes = 0 !");
444 return (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
446 return (1.- xwc)/(xww/diffWCl + xwa/diffACl);
448 DUNE_THROW(Dune::InvalidStateException,
449 "Diffusivity of water in the water phase "
450 "is constraint by sum of diffusive fluxes = 0 !\n");
462 template <
class Flu
idState>
468 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirMesitylene::binaryDiffusionCoefficient()");
485 template <
class Flu
idState>
490 assert(0 <= phaseIdx && phaseIdx <
numPhases);
493 Scalar T = fluidState.temperature(phaseIdx);
494 Scalar p = fluidState.pressure(phaseIdx);
498 return H2O::vaporPressure(T)/p;
499 else if (compIdx ==
AirIdx)
514 else if (compIdx ==
AirIdx)
516 else if (compIdx ==
H2OIdx)
526 template <
class Flu
idState>
531 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirMesitylene::kelvinVaporPressure()");
544 template <
class Flu
idState>
549 return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
556 fluidState.pressure(phaseIdx));
557 Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
558 fluidState.pressure(phaseIdx));
569 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
578 template <
class Flu
idState>
581 const Scalar T = fluidState.temperature(phaseIdx);
582 const Scalar p = fluidState.pressure(phaseIdx);
586 if (componentIdx ==
H2OIdx)
587 return H2O::liquidEnthalpy(T, p);
588 else if (componentIdx ==
NAPLIdx)
589 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for NAPL in water is not implemented.");
590 else if (componentIdx ==
AirIdx)
591 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for Air in water is not implemented.");
592 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
596 if (componentIdx ==
H2OIdx)
597 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for water in NAPL is not implemented.");
598 else if (componentIdx ==
NAPLIdx)
600 else if (componentIdx ==
AirIdx)
601 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for air in NAPL is not implemented.");
602 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
606 if (componentIdx ==
H2OIdx)
607 return H2O::gasEnthalpy(T, p);
608 else if (componentIdx ==
NAPLIdx)
610 else if (componentIdx ==
AirIdx)
612 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
614 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
623 template <
class Flu
idState>
627 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirMesitylene::heatCapacity()");
636 template <
class Flu
idState>
640 const Scalar temperature = fluidState.temperature(phaseIdx) ;
641 const Scalar pressure = fluidState.pressure(phaseIdx);
644 return H2O::liquidThermalConductivity(temperature, pressure);
654 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
660 Scalar rholH2O = H2O::liquidDensity(T, pw);
661 Scalar clH2O = rholH2O/H2O::molarMass();
A collection of input/output field names for common physical quantities.
Binary coefficients for water and air.
Binary coefficients for air and mesitylene.
Binary coefficients for water and mesitylene.
Properties of mesitylene.
Tabulates all thermodynamic properties of a given untabulated chemical species.
A simple class for the air fluid properties.
Material properties of pure water .
Relations valid for an ideal gas.
std::string gaseousPhase() noexcept
I/O name of gaseous phase.
Definition name.hh:123
std::string naplPhase() noexcept
I/O name of napl phase.
Definition name.hh:131
std::string aqueousPhase() noexcept
I/O name of aqueous phase.
Definition name.hh:127
Scalar h2oGasViscosityInMixture(Scalar temperature, Scalar pressure)
The dynamic viscosity of steam in a gas mixture.
Definition h2o.hh:977
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for air and mesitylene in liquid water.
Definition air_mesitylene.hh:109
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:59
static Scalar henry(Scalar temperature)
Henry coefficient for air in liquid water.
Definition h2o_air.hh:48
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and air.
Definition h2o_air.hh:68
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for molecular nitrogen in liquid water.
Definition h2o_air.hh:101
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for mesitylene in liquid water.
Definition h2o_mesitylene.hh:116
static Scalar henry(Scalar temperature)
Henry coefficient for mesitylene in liquid water.
Definition h2o_mesitylene.hh:50
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and mesitylene.
Definition h2o_mesitylene.hh:66
A class for the air fluid properties.
Definition air.hh:47
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of Air at a given pressure and temperature.
Definition air.hh:85
static constexpr Scalar molarMass()
The molar mass in of Air.
Definition air.hh:62
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of Air at a given pressure and temperature.
Definition air.hh:187
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of air.
Definition air.hh:345
static constexpr bool gasIsIdeal()
Returns true, the gas phase is assumed to be ideal.
Definition air.hh:109
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of Air with 273.15 as basis.
Definition air.hh:270
static std::string name()
A human readable name for Air.
Definition air.hh:54
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of air in , depending on pressure and temperature.
Definition air.hh:97
mesitylene
Definition mesitylene.hh:48
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of mesitylene in , depending on pressure and temperature.
Definition mesitylene.hh:219
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of mesitylene vapor .
Definition mesitylene.hh:195
static std::string name()
A human readable name for the mesitylene.
Definition mesitylene.hh:55
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure mesitylene at a given pressure and temperature .
Definition mesitylene.hh:242
static constexpr Scalar molarMass()
The molar mass in of mesitylene.
Definition mesitylene.hh:61
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of mesitylene.
Definition mesitylene.hh:379
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of pure mesitylene at a given temperature according to Antoine afte...
Definition mesitylene.hh:105
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition mesitylene.hh:273
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of mesitylene at a given pressure and temperature .
Definition mesitylene.hh:206
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid mesitylene .
Definition mesitylene.hh:124
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure mesitylene at a given pressure and temperature .
Definition mesitylene.hh:228
static Scalar gasViscosity(Scalar temperature, Scalar pressure, bool regularize=true)
The dynamic viscosity of mesitylene vapor.
Definition mesitylene.hh:283
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition mesitylene.hh:267
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of pure mesitylene.
Definition mesitylene.hh:313
Fluid system base class.
Definition fluidsystems/base.hh:45
ScalarType Scalar
Definition fluidsystems/base.hh:48
static Scalar density(const FluidState &fluidState, int phaseIdx)
Calculate the density of a fluid phase.
Definition fluidsystems/base.hh:134
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Thermal conductivity of a fluid phase .
Definition fluidsystems/base.hh:390
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the fugacity coefficient of an individual component in a fluid phase.
Definition fluidsystems/base.hh:197
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Calculate the binary molecular diffusion coefficient for a component in a fluid phase .
Definition fluidsystems/base.hh:278
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 fluidsystems/base.hh:326
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure and density, calculate its specific enthalpy .
Definition fluidsystems/base.hh:363
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density of a fluid phase.
Definition fluidsystems/base.hh:160
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Calculate the dynamic viscosity of a fluid phase .
Definition fluidsystems/base.hh:236
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity of a fluid phase .
Definition fluidsystems/base.hh:424
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water and air (Pseu...
Definition h2oairmesitylene.hh:57
static const int numComponents
Definition h2oairmesitylene.hh:68
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Return the thermal conductivity .
Definition h2oairmesitylene.hh:637
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition h2oairmesitylene.hh:293
static void init()
Initialize the fluid system's static parameters generically.
Definition h2oairmesitylene.hh:91
static const int numPhases
Definition h2oairmesitylene.hh:67
static const int nPhaseIdx
Definition h2oairmesitylene.hh:71
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition h2oairmesitylene.hh:579
Dumux::Components::Air< Scalar > Air
Definition h2oairmesitylene.hh:63
static const int H2OIdx
Definition h2oairmesitylene.hh:74
static const int AirIdx
Definition h2oairmesitylene.hh:76
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition h2oairmesitylene.hh:226
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Return the viscosity of a phase .
Definition h2oairmesitylene.hh:323
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given all mole fractions in a phase, return the specific phase enthalpy .
Definition h2oairmesitylene.hh:545
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition h2oairmesitylene.hh:145
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:399
Components::Mesitylene< Scalar > NAPL
Definition h2oairmesitylene.hh:62
static const int wPhaseIdx
Definition h2oairmesitylene.hh:70
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition h2oairmesitylene.hh:133
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition h2oairmesitylene.hh:180
static const int wCompIdx
Definition h2oairmesitylene.hh:81
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Returns the fugacity coefficient of a component in a phase.
Definition h2oairmesitylene.hh:486
static const int gPhaseIdx
Definition h2oairmesitylene.hh:72
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:112
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition h2oairmesitylene.hh:125
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Return the heat capacity in .
Definition h2oairmesitylene.hh:624
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition h2oairmesitylene.hh:162
static std::string componentName(int compIdx)
Return the human readable name of a component (used in indices).
Definition h2oairmesitylene.hh:212
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:250
static const int NAPLIdx
Definition h2oairmesitylene.hh:75
H2OType H2O
Definition h2oairmesitylene.hh:64
static const int gCompIdx
Definition h2oairmesitylene.hh:83
static const int nCompIdx
Definition h2oairmesitylene.hh:82
static std::string phaseName(int phaseIdx)
Return the human readable name of a phase (used in indices).
Definition h2oairmesitylene.hh:197
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Definition h2oairmesitylene.hh:527
static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIIdx, int compJIdx)
Definition h2oairmesitylene.hh:463