12#ifndef DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH 
   13#define DUMUX_H2O_AIR_MESITYLENE_FLUID_SYSTEM_HH 
   40template <
class Scalar,
 
   41          class H2OType = Components::TabulatedComponent<Components::H2O<Scalar> > >
 
   43    : 
public Base<Scalar, H2OAirMesitylene<Scalar, H2OType> >
 
  101        if (H2O::isTabulated)
 
  103            H2O::init(tempMin, tempMax, nTemp,
 
  104                      pressMin, pressMax, nPress);
 
 
  119    static constexpr bool isGas(
int phaseIdx)
 
  121        assert(0 <= phaseIdx && phaseIdx < 
numPhases);
 
 
  150        assert(0 <= phaseIdx && phaseIdx < 
numPhases);
 
 
  168        assert(0 <= phaseIdx && phaseIdx < 
numPhases);
 
  174            return H2O::liquidIsCompressible();
 
 
  185        assert(0 <= phaseIdx && phaseIdx < 
numPhases);
 
  192        DUNE_THROW(Dune::InvalidStateException, 
"Invalid phase index " << phaseIdx);
 
 
  201            case H2OIdx: 
return H2O::name();
 
  205        DUNE_THROW(Dune::InvalidStateException, 
"Invalid component index " << compIdx);
 
 
  215            case H2OIdx: 
return H2O::molarMass();
 
  219        DUNE_THROW(Dune::InvalidStateException, 
"Invalid component index " << compIdx);
 
 
  235    template <
class Flu
idState>
 
  242            return H2O::liquidMolarDensity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx))
 
  263        return H2O::gasDensity(fluidState.temperature(phaseIdx), pH2O)
 
 
  270    template <
class Flu
idState>
 
  273        Scalar temperature = fluidState.temperature(phaseIdx);
 
  274        Scalar pressure = fluidState.pressure(phaseIdx);
 
  283            return H2O::liquidMolarDensity(temperature, pressure);
 
  287            return H2O::gasMolarDensity(temperature, fluidState.partialPressure(
gPhaseIdx, 
H2OIdx))
 
 
  300    template <
class Flu
idState>
 
  306            return H2O::liquidViscosity(fluidState.temperature(phaseIdx),
 
  307                                        fluidState.pressure(phaseIdx));
 
  312                                         fluidState.pressure(phaseIdx));
 
  331            Air::gasViscosity(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx)),
 
  361        muResult = (xAW*muAW)/(xAW+fluidState.moleFraction(
gPhaseIdx, 
NAPLIdx)*phiAWC)
 
 
  376    template <
class Flu
idState>
 
  394                        return (1.- xgw)/(xga/diffAW + xgc/diffWC);
 
  403                        return (1.- xgc)/(xgw/diffWC + xga/diffAC);
 
  406                        DUNE_THROW(Dune::InvalidStateException, 
"Diffusivity of Air in the gas phase is constraint by sum of diffusive fluxes = 0 !");
 
  422                        return (1.- xww)/(xwa/diffAWl + xwc/diffWCl);
 
  424                        return (1.- xwc)/(xww/diffWCl + xwa/diffACl);
 
  426                        DUNE_THROW(Dune::InvalidStateException,
 
  427                                   "Diffusivity of water in the water phase " 
  428                                   "is constraint by sum of diffusive fluxes = 0 !\n");
 
 
  441    template <
class Flu
idState>
 
  447        DUNE_THROW(Dune::NotImplemented, 
"FluidSystems::H2OAirMesitylene::binaryDiffusionCoefficient()");
 
 
  464    template <
class Flu
idState>
 
  469        assert(0 <= phaseIdx  && phaseIdx < 
numPhases);
 
  472        Scalar T = fluidState.temperature(phaseIdx);
 
  473        Scalar p = fluidState.pressure(phaseIdx);
 
  477                return H2O::vaporPressure(T)/p;
 
  478            else if (compIdx == 
AirIdx)
 
  493            else if (compIdx == 
AirIdx)
 
  495            else if (compIdx == 
H2OIdx)
 
 
  505    template <
class Flu
idState>
 
  510        DUNE_THROW(Dune::NotImplemented, 
"FluidSystems::H2OAirMesitylene::kelvinVaporPressure()");
 
 
  523    template <
class Flu
idState>
 
  528            return H2O::liquidEnthalpy(fluidState.temperature(phaseIdx), fluidState.pressure(phaseIdx));
 
  535                                           fluidState.pressure(phaseIdx));
 
  536            Scalar hgw = H2O::gasEnthalpy(fluidState.temperature(phaseIdx),
 
  537                                          fluidState.pressure(phaseIdx));
 
  548        DUNE_THROW(Dune::InvalidStateException, 
"Invalid phase index " << phaseIdx);
 
 
  557    template <
class Flu
idState>
 
  560        const Scalar T = fluidState.temperature(phaseIdx);
 
  561        const Scalar p = fluidState.pressure(phaseIdx);
 
  565            if (componentIdx == 
H2OIdx)
 
  566                return H2O::liquidEnthalpy(T, p);
 
  567            else if (componentIdx == 
NAPLIdx)
 
  568                DUNE_THROW(Dune::NotImplemented, 
"The component enthalpy for NAPL in water is not implemented.");
 
  569            else if (componentIdx == 
AirIdx)
 
  570                DUNE_THROW(Dune::NotImplemented, 
"The component enthalpy for Air in water is not implemented.");
 
  571            DUNE_THROW(Dune::InvalidStateException, 
"Invalid component index " << componentIdx);
 
  575            if (componentIdx == 
H2OIdx)
 
  576                DUNE_THROW(Dune::NotImplemented, 
"The component enthalpy for water in NAPL is not implemented.");
 
  577            else if (componentIdx == 
NAPLIdx)
 
  579            else if (componentIdx == 
AirIdx)
 
  580                DUNE_THROW(Dune::NotImplemented, 
"The component enthalpy for air in NAPL is not implemented.");
 
  581            DUNE_THROW(Dune::InvalidStateException, 
"Invalid component index " << componentIdx);
 
  585            if (componentIdx == 
H2OIdx)
 
  586                return H2O::gasEnthalpy(T, p);
 
  587            else if (componentIdx == 
NAPLIdx)
 
  589            else if (componentIdx == 
AirIdx)
 
  591            DUNE_THROW(Dune::InvalidStateException, 
"Invalid component index " << componentIdx);
 
  593        DUNE_THROW(Dune::InvalidStateException, 
"Invalid phase index " << phaseIdx);
 
 
  598    template <
class Flu
idState>
 
  602        DUNE_THROW(Dune::NotImplemented, 
"FluidSystems::H2OAirMesitylene::heatCapacity()");
 
 
  607    template <
class Flu
idState>
 
  611        const Scalar temperature  = fluidState.temperature(phaseIdx) ;
 
  612        const Scalar pressure = fluidState.pressure(phaseIdx);
 
  615            return H2O::liquidThermalConductivity(temperature, pressure);
 
  625        DUNE_THROW(Dune::InvalidStateException, 
"Invalid phase index " << phaseIdx);
 
 
  631        Scalar rholH2O = H2O::liquidDensity(T, pw);
 
  632        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:96
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:46
static Scalar henry(Scalar temperature)
Henry coefficient  for air in liquid water.
Definition h2o_air.hh:35
static Scalar gasDiffCoeff(Scalar temperature, Scalar pressure)
Binary diffusion coefficient  for molecular water and air.
Definition h2o_air.hh:55
static Scalar liquidDiffCoeff(Scalar temperature, Scalar pressure)
Diffusion coefficient  for molecular nitrogen in liquid water.
Definition h2o_air.hh:88
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:33
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density  of Air at a given pressure and temperature.
Definition air.hh:71
static constexpr Scalar molarMass()
The molar mass in  of Air.
Definition air.hh:48
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity  of Air at a given pressure and temperature.
Definition air.hh:179
static Scalar gasThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity  of air.
Definition air.hh:337
static constexpr bool gasIsIdeal()
Returns true, the gas phase is assumed to be ideal.
Definition air.hh:95
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of Air  with 273.15  as basis.
Definition air.hh:262
static std::string name()
A human readable name for Air.
Definition air.hh:40
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of air in , depending on pressure and temperature.
Definition air.hh:83
mesitylene
Definition mesitylene.hh:35
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of mesitylene in , depending on pressure and temperature.
Definition mesitylene.hh:206
static Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of mesitylene vapor .
Definition mesitylene.hh:182
static std::string name()
A human readable name for the mesitylene.
Definition mesitylene.hh:42
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of pure mesitylene at a given pressure and temperature .
Definition mesitylene.hh:229
static constexpr Scalar molarMass()
The molar mass in  of mesitylene.
Definition mesitylene.hh:48
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity  of mesitylene.
Definition mesitylene.hh:365
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity  of mesitylene vapor.
Definition mesitylene.hh:269
static Scalar vaporPressure(Scalar temperature)
The saturation vapor pressure in  of pure mesitylene at a given temperature according to Antoine afte...
Definition mesitylene.hh:92
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition mesitylene.hh:260
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of mesitylene at a given pressure and temperature  .
Definition mesitylene.hh:193
static Scalar liquidEnthalpy(const Scalar temperature, const Scalar pressure)
Specific enthalpy of liquid mesitylene .
Definition mesitylene.hh:111
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure mesitylene at a given pressure and temperature .
Definition mesitylene.hh:215
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition mesitylene.hh:254
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity  of pure mesitylene.
Definition mesitylene.hh:299
Fluid system base class.
Definition fluidsystems/base.hh:32
ScalarType Scalar
Definition fluidsystems/base.hh:35
A three-phase fluid system featuring gas, NAPL and water as phases and distilled water  and air (Pseu...
Definition h2oairmesitylene.hh:44
static const int numComponents
Definition h2oairmesitylene.hh:54
static Scalar thermalConductivity(const FluidState &fluidState, int phaseIdx)
Thermal conductivity  of a fluid phase .
Definition h2oairmesitylene.hh:608
static Scalar molarDensity(const FluidState &fluidState, int phaseIdx)
Calculate the molar density  of a fluid phase.
Definition h2oairmesitylene.hh:271
static void init()
Initialize the fluid system's static parameters generically.
Definition h2oairmesitylene.hh:77
static const int numPhases
Definition h2oairmesitylene.hh:53
static const int nPhaseIdx
Definition h2oairmesitylene.hh:57
static Scalar componentEnthalpy(const FluidState &fluidState, int phaseIdx, int componentIdx)
Returns the specific enthalpy  of a component in a specific phase.
Definition h2oairmesitylene.hh:558
Dumux::Components::Air< Scalar > Air
Definition h2oairmesitylene.hh:49
static const int H2OIdx
Definition h2oairmesitylene.hh:60
static const int AirIdx
Definition h2oairmesitylene.hh:62
static Scalar molarMass(int compIdx)
Return the molar mass of a component in .
Definition h2oairmesitylene.hh:212
static Scalar viscosity(const FluidState &fluidState, int phaseIdx)
Return the viscosity of a phase .
Definition h2oairmesitylene.hh:301
static Scalar enthalpy(const FluidState &fluidState, int phaseIdx)
Given all mole fractions in a phase, return the specific phase enthalpy .
Definition h2oairmesitylene.hh:524
static bool isIdealGas(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal gas.
Definition h2oairmesitylene.hh:131
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:377
Components::Mesitylene< Scalar > NAPL
Definition h2oairmesitylene.hh:48
static const int wPhaseIdx
Definition h2oairmesitylene.hh:56
static constexpr bool isGas(int phaseIdx)
Return whether a phase is gaseous.
Definition h2oairmesitylene.hh:119
static constexpr bool isCompressible(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be compressible.
Definition h2oairmesitylene.hh:166
static const int wCompIdx
Definition h2oairmesitylene.hh:67
static Scalar fugacityCoefficient(const FluidState &fluidState, int phaseIdx, int compIdx)
Returns the fugacity coefficient  of a component in a phase.
Definition h2oairmesitylene.hh:465
static const int gPhaseIdx
Definition h2oairmesitylene.hh:58
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:98
static constexpr bool isMiscible()
Returns whether the fluids are miscible.
Definition h2oairmesitylene.hh:111
static Scalar heatCapacity(const FluidState &fluidState, int phaseIdx)
Specific isobaric heat capacity  of a fluid phase .
Definition h2oairmesitylene.hh:599
static bool isIdealMixture(int phaseIdx)
Returns true if and only if a fluid phase is assumed to be an ideal mixture.
Definition h2oairmesitylene.hh:148
static std::string componentName(int compIdx)
Return the human readable name of a component (used in indices)
Definition h2oairmesitylene.hh:198
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:236
static const int NAPLIdx
Definition h2oairmesitylene.hh:61
H2OType H2O
Definition h2oairmesitylene.hh:50
static const int gCompIdx
Definition h2oairmesitylene.hh:69
static const int nCompIdx
Definition h2oairmesitylene.hh:68
static std::string phaseName(int phaseIdx)
Return the human readable name of a phase (used in indices)
Definition h2oairmesitylene.hh:183
static Scalar kelvinVaporPressure(const FluidState &fluidState, const int phaseIdx, const int compIdx)
Definition h2oairmesitylene.hh:506
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:442
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:964
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
Tabulates all thermodynamic properties of a given untabulated chemical species.