24#ifndef DUMUX_H2O_AIR_XYLENE_FLUID_SYSTEM_HH
25#define DUMUX_H2O_AIR_XYLENE_FLUID_SYSTEM_HH
42namespace FluidSystems {
52template <
class Scalar,
53 class H2OType = Components::TabulatedComponent<Components::H2O<Scalar> > >
55 :
public Base<Scalar, H2OAirXylene<Scalar, H2OType> >
113 if (H2O::isTabulated)
115 H2O::init(tempMin, tempMax, nTemp,
116 pressMin, pressMax, nPress);
131 static constexpr bool isGas(
int phaseIdx)
133 assert(0 <= phaseIdx && phaseIdx <
numPhases);
162 assert(0 <= phaseIdx && phaseIdx <
numPhases);
180 assert(0 <= phaseIdx && phaseIdx <
numPhases);
186 return H2O::liquidIsCompressible();
198 assert(0 <= phaseIdx && phaseIdx <
numPhases);
205 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>
255 return H2O::liquidMolarDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx))
276 return H2O::gasDensity(fluidState.temperature(phaseIdx), pH2O)
291 template <
class Flu
idState>
321 template <
class Flu
idState>
327 return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
328 fluidState.pressure(phaseIdx));
333 fluidState.pressure(phaseIdx));
351 H2O::gasViscosity(fluidState.temperature(phaseIdx), H2O::vaporPressure(fluidState.temperature(phaseIdx))),
352 Air::gasViscosity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx)),
382 muResult = (xAW*muAW)/(xAW+fluidState.moleFraction(
gPhaseIdx,
NAPLIdx)*phiAWC)
397 template <
class Flu
idState>
416 return (1.- xgw)/(xga/diffAW + xgc/diffWC);
418 return (1.- xgc)/(xgw/diffWC + xga/diffAC);
420 DUNE_THROW(Dune::InvalidStateException,
421 "Diffusivity of Air in the gas phase "
422 "is constraint by sum of diffusive fluxes = 0 !\n");
434 diffCont = (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
437 diffCont = (1.- xwc)/(xww/diffWCl + xwa/diffACl);
440 DUNE_THROW(Dune::InvalidStateException,
441 "Diffusivity of water in the water phase "
442 "is constraint by sum of diffusive fluxes = 0 !\n");
446 DUNE_THROW(Dune::InvalidStateException,
447 "Diffusion coefficients of "
448 "substances in liquid phase are undefined!\n");
454 template <
class Flu
idState>
460 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirXylene::binaryDiffusionCoefficient()");
477 template <
class Flu
idState>
482 assert(0 <= phaseIdx && phaseIdx <
numPhases);
485 Scalar T = fluidState.temperature(phaseIdx);
486 Scalar p = fluidState.pressure(phaseIdx);
490 return H2O::vaporPressure(T)/p;
491 else if (compIdx ==
AirIdx)
506 else if (compIdx ==
AirIdx)
508 else if (compIdx ==
H2OIdx)
518 template <
class Flu
idState>
523 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirXylene::kelvinVaporPressure()");
536 template <
class Flu
idState>
541 return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
548 fluidState.pressure(phaseIdx));
549 Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
550 fluidState.pressure(phaseIdx));
561 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
570 template <
class Flu
idState>
573 const Scalar T = fluidState.temperature(phaseIdx);
574 const Scalar p = fluidState.pressure(phaseIdx);
578 if (componentIdx ==
H2OIdx)
579 return H2O::liquidEnthalpy(T, p);
580 else if (componentIdx ==
NAPLIdx)
581 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for NAPL in water is not implemented.");
582 else if (componentIdx ==
AirIdx)
583 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for Air in water is not implemented.");
584 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
588 if (componentIdx ==
H2OIdx)
589 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for water in NAPL is not implemented.");
590 else if (componentIdx ==
NAPLIdx)
592 else if (componentIdx ==
AirIdx)
593 DUNE_THROW(Dune::NotImplemented,
"The component enthalpy for air in NAPL is not implemented.");
594 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
598 if (componentIdx ==
H2OIdx)
599 return H2O::gasEnthalpy(T, p);
600 else if (componentIdx ==
NAPLIdx)
602 else if (componentIdx ==
AirIdx)
604 DUNE_THROW(Dune::InvalidStateException,
"Invalid component index " << componentIdx);
606 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
615 template <
class Flu
idState>
619 DUNE_THROW(Dune::NotImplemented,
"FluidSystems::H2OAirXylene::heatCapacity()");
628 template <
class Flu
idState>
646 DUNE_THROW(Dune::InvalidStateException,
"Invalid phase index " << phaseIdx);
652 Scalar rholH2O = H2O::liquidDensity(T, pw);
653 Scalar clH2O = rholH2O/H2O::molarMass();
A collection of input/output field names for common physical quantities.
Material properties of pure water .
Tabulates all thermodynamic properties of a given untabulated chemical species.
A simple class for the air fluid properties.
Relations valid for an ideal gas.
Binary coefficients for water and air.
Binary coefficients for air and xylene.
Binary coefficients for water and xylene.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition: name.hh:51
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
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition: name.hh:34
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for air and xylene. method according to Wilke and Lee see W....
Definition: air_xylene.hh:59
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient for air and xylene in liquid water.
Definition: air_xylene.hh:106
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 xylene in liquid water.
Definition: h2o_xylene.hh:115
static Scalar henry(Scalar temperature)
Henry coefficient for xylene in liquid water.
Definition: h2o_xylene.hh:49
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient for molecular water and xylene.
Definition: h2o_xylene.hh:66
A class for the air fluid properties.
Definition: air.hh:46
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of Air at a given pressure and temperature.
Definition: air.hh:84
static constexpr Scalar molarMass()
The molar mass in of Air.
Definition: air.hh:61
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity of Air at a given pressure and temperature.
Definition: air.hh:186
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of air.
Definition: air.hh:342
static constexpr bool gasIsIdeal()
Returns true, the gas phase is assumed to be ideal.
Definition: air.hh:108
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of Air with 273.15 as basis.
Definition: air.hh:268
static std::string name()
A human readable name for Air.
Definition: air.hh:53
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of air in , depending on pressure and temperature.
Definition: air.hh:96
Properties of xylene.
Definition: xylene.hh:49
static Scalar gasViscosity(Scalar temp, Scalar pressure, bool regularize=true)
The dynamic viscosity of xylene vapor.
Definition: xylene.hh:329
static std::string name()
A human readable name for the xylene.
Definition: xylene.hh:57
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure xylene at a given pressure and temperature .
Definition: xylene.hh:299
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid xylene .
Definition: xylene.hh:167
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar gas density of xylene gas at a given pressure and temperature.
Definition: xylene.hh:262
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition: xylene.hh:313
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in of pure xylene at a given temperature according to Antoine after Be...
Definition: xylene.hh:106
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity of xylene.
Definition: xylene.hh:385
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition: xylene.hh:319
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of xylene vapor .
Definition: xylene.hh:238
static constexpr Scalar molarMass()
The molar mass in of xylene.
Definition: xylene.hh:63
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of xylene gas at a given pressure and temperature.
Definition: xylene.hh:249
static Scalar liquidMolarDensity(Scalar temp, Scalar pressure)
The molar liquid density of pure xylene at a given pressure and temperature .
Definition: xylene.hh:274
static Scalar liquidViscosity(Scalar temp, Scalar pressure)
The dynamic viscosity of pure xylene.
Definition: xylene.hh:357
Fluid system base class.
Definition: fluidsystems/base.hh:45
Scalar Scalar
export the scalar type
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: h2oairxylene.hh:56
static Scalar diffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Given all mole fractions, return the diffusion coefficient of a component in a phase.
Definition: h2oairxylene.hh:398
static Scalar density(const FluidState &fluidState, int phaseIdx)
Given a phase's composition, temperature, pressure, and the partial pressures of all components,...
Definition: h2oairxylene.hh:250
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition: h2oairxylene.hh:131
static const int gCompIdx
Definition: h2oairxylene.hh:81
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Return the viscosity of a phase .
Definition: h2oairxylene.hh:322
static void init()
Initialize the fluid system's static parameters generically.
Definition: h2oairxylene.hh:89
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Return the heat capacity in .
Definition: h2oairxylene.hh:616
static const int nCompIdx
Definition: h2oairxylene.hh:80
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition: h2oairxylene.hh:226
static const int AirIdx
Definition: h2oairxylene.hh:74
static const int gPhaseIdx
Definition: h2oairxylene.hh:70
static std::string componentName(int compIdx)
Return the human readable name of a component (used in indices)
Definition: h2oairxylene.hh:212
static std::string phaseName(int phaseIdx)
Return the human readable name of a phase (used in indices)
Definition: h2oairxylene.hh:196
static const int numComponents
Definition: h2oairxylene.hh:66
static Scalar binaryDiffusionCoefficient(const FluidState &fluidState, int phaseIdx, int compIIdx, int compJIdx)
Definition: h2oairxylene.hh:455
static const int H2OIdx
Definition: h2oairxylene.hh:72
static const int wCompIdx
Definition: h2oairxylene.hh:79
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition: h2oairxylene.hh:178
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition: h2oairxylene.hh:123
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition: h2oairxylene.hh:143
H2OType H2O
Definition: h2oairxylene.hh:61
static const int nPhaseIdx
Definition: h2oairxylene.hh:69
static const int numPhases
Definition: h2oairxylene.hh:65
static const int NAPLIdx
Definition: h2oairxylene.hh:73
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Returns the fugacity coefficient of a component in a phase.
Definition: h2oairxylene.hh:478
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
The molar density of a fluid phase in .
Definition: h2oairxylene.hh:292
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy of a component in a specific phase.
Definition: h2oairxylene.hh:571
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given all mole fractions in a phase, return the specific phase enthalpy .
Definition: h2oairxylene.hh:537
static const int wPhaseIdx
Definition: h2oairxylene.hh:68
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Return the thermal conductivity .
Definition: h2oairxylene.hh:629
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: h2oairxylene.hh:110
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition: h2oairxylene.hh:160
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Definition: h2oairxylene.hh:519