43template <
class Scalar>
 
  186                enthalpyRegion2_(temperature, pv) +
 
  187                (pressure - pv)*dh_dp;
 
  190        return enthalpyRegion2_(temperature, pressure);
 
 
  221                enthalpyRegion1_(temperature, pv) +
 
  222                (pressure - pv)*dh_dp;
 
  225        return enthalpyRegion1_(temperature, pressure);
 
 
  252            return heatCap_p_Region2_(temperature, pv);
 
  254        return heatCap_p_Region2_(temperature, pressure);
 
 
  277            return heatCap_p_Region1_(temperature, pv);
 
  280        return heatCap_p_Region1_(temperature, pressure);
 
 
  323            static const Scalar eps = 1e-7;
 
  324            Scalar uv = internalEnergyRegion1_(temperature, pv);
 
  325            Scalar uvPEps = internalEnergyRegion1_(temperature, pv + eps);
 
  326            Scalar du_dp = (uvPEps - uv)/eps;
 
  327            return uv + du_dp*(pressure - pv);
 
  330        return internalEnergyRegion1_(temperature, pressure);
 
 
  390            static const Scalar eps = 1e-7;
 
  391            Scalar uv = internalEnergyRegion2_(temperature, pv);
 
  392            Scalar uvMEps = internalEnergyRegion2_(temperature, pv - eps);
 
  393            Scalar du_dp = (uv - uvMEps)/eps;
 
  394            return uv + du_dp*(pressure - pv);
 
  397        return internalEnergyRegion2_(temperature, pressure);
 
 
  421            return heatCap_v_Region1_(temperature, pv);
 
  424        return heatCap_v_Region1_(temperature, pressure);
 
 
  450            return heatCap_v_Region2_(temperature, pv);
 
  453        return heatCap_v_Region2_(temperature, pressure);
 
 
  488            Scalar rho0IAPWS = 1.0/volumeRegion2_(temperature,
 
  507            const Scalar eps = pv*1e-8;
 
  508            Scalar v0 = volumeRegion2_(temperature, pv);
 
  509            Scalar v1 = volumeRegion2_(temperature, pv + eps);
 
  510            Scalar dv_dp = (v1 - v0)/eps;
 
  526            Scalar drho_dp = - 1/(v0*v0)*dv_dp;
 
  529            return 1.0/v0 + (pressure - pv)*drho_dp;
 
  532        return 1.0/volumeRegion2_(temperature, pressure);
 
 
  568        Scalar eps = pressure*1e-7;
 
  570        Scalar deltaP = pressure*2;
 
  572        for (
int i = 0; i < 5 && abs(pressure*1e-9) < abs(deltaP); ++i)
 
  577            df_dp = 
gasDensity(temperature, pressure + eps);
 
  578            df_dp -= 
gasDensity(temperature, pressure - eps);
 
 
  613            const Scalar eps = pv*1e-8;
 
  614            Scalar v0 = volumeRegion1_(temperature, pv);
 
  615            Scalar v1 = volumeRegion1_(temperature, pv + eps);
 
  616            Scalar dv_dp = (v1 - v0)/eps;
 
  634            Scalar drho_dp = - 1/(v0*v0)*dv_dp;
 
  637            return 1.0/v0 + (pressure - pv)*drho_dp;
 
  640        return 1/volumeRegion1_(temperature, pressure);
 
 
  671        Scalar maxPressure = 100e6;
 
  672        const auto residualFunction = [&] (
const Scalar pressure) {
 
  682                    "searched for pressure(T=" << temperature << 
",rho=" << density
 
  683                    <<
") in [" << minPressure << 
", " << maxPressure << 
"]: " 
 
  749        if ( !(   (pressure <= 400e6 && (273.15 <= temperature) && (temperature <= 398.15))
 
  750               || (pressure <= 200e6 && (398.15 <  temperature) && (temperature <=  523.15))
 
  751               || (pressure <= 150e6 && (523.15 <  temperature) && (temperature <=  673.15))
 
  752               || (pressure <= 100e6 && (673.15 <  temperature) && (temperature <=  1073.15)) ))
 
  755                       "Evaluating the IAPWS fit function for thermal conductivity outside range of applicability." 
  756                       "(T=" << temperature << 
", p=" << pressure << 
")");
 
 
  782        if ( !(   (pressure <= 400e6 && (273.15 <= temperature) && (temperature <= 398.15))
 
  783               || (pressure <= 200e6 && (398.15 <  temperature) && (temperature <= 523.15))
 
  784               || (pressure <= 150e6 && (523.15 <  temperature) && (temperature <= 673.15))
 
  785               || (pressure <= 100e6 && (673.15 <  temperature) && (temperature <= 1073.15)) ))
 
  788                       "Evaluating the IAPWS fit function for thermal conductivity outside range of applicability." 
  789                       "(T=" << temperature << 
", p=" << pressure << 
")");
 
 
 
  896template <
class Scalar>
 
  904template <
class Scalar>
 
  907    constexpr Scalar tc = 647.3;
 
  909    const Scalar tr = max(temperature/tc, 1e-8);
 
  911    const Scalar fp0 = 1.0 + 0.221*(0.96 + 0.1*(tr - 0.7));
 
  912    constexpr Scalar xi = 3.334e-3;
 
  915    const Scalar eta_xi = (0.807*pow(tr, 0.618) - 0.357*exp((-0.449)*tr)
 
  916                           + 0.34*exp((-4.058)*tr) + 0.018)*fp0;
 
  918    return 1.0e-7*eta_xi/xi;
 
 
  922template <
class Scalar>
 
  925    constexpr Scalar a1 = -4.4189440e-6;
 
  926    constexpr Scalar a2 = 4.6876380e-8;
 
  927    constexpr Scalar a3 = -5.3894310e-12;
 
  928    constexpr Scalar a4 = 3.2028560e-16;
 
  929    constexpr Scalar a5 = 4.9191790e-22;
 
  931    return a1 + a2*temperature + a3*temperature*temperature
 
  932              + a4*temperature*temperature*temperature
 
  933              + a5*temperature*temperature*temperature*temperature;
 
 
 
  963template <
class Scalar>
 
  966    if (temperature < 480.0)
 
  969    else if (temperature > 500.0)
 
  974        const Scalar op = (500.0 - temperature)/20.0;
 
 
Base class for all components Components provide the thermodynamic relations for the liquid,...
Definition components/base.hh:46
Scalar Scalar
Definition components/base.hh:50
Interface for components that have a gas state.
Definition gas.hh:28
Material properties of pure water .
Definition h2o.hh:48
static Scalar liquidViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity  of pure water.
Definition h2o.hh:722
static Scalar vaporTemperature(Scalar pressure)
The vapor temperature in  of pure water at a given pressure.
Definition h2o.hh:139
static Scalar liquidPressure(Scalar temperature, Scalar density)
The pressure of liquid water in  at a given density and temperature.
Definition h2o.hh:666
static Scalar liquidThermalConductivity(Scalar temperature, Scalar pressure)
Thermal conductivity  of water (IAPWS) .
Definition h2o.hh:745
static const Scalar liquidInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of liquid water .
Definition h2o.hh:294
static Scalar gasHeatCapacityConstVolume(Scalar temperature, Scalar pressure)
Specific isochoric heat capacity of steam and water vapor .
Definition h2o.hh:439
static constexpr bool gasIsIdeal()
Returns true if the gas phase is assumed to be ideal.
Definition h2o.hh:548
static Scalar gasViscosity(Scalar temperature, Scalar pressure)
The dynamic viscosity  of steam.
Definition h2o.hh:703
static const Scalar liquidHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of liquid water .
Definition h2o.hh:268
static const Scalar liquidEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of liquid water .
Definition h2o.hh:204
static Scalar liquidDensity(Scalar temperature, Scalar pressure)
The density of pure water in  at a given pressure and temperature.
Definition h2o.hh:601
static const Scalar gasEnthalpy(Scalar temperature, Scalar pressure)
Specific enthalpy of water steam .
Definition h2o.hh:160
static Scalar gasDensity(Scalar temperature, Scalar pressure)
The density of steam in  at a given pressure and temperature.
Definition h2o.hh:480
static Scalar liquidMolarDensity(Scalar temperature, Scalar pressure)
The molar density of water in  at a given pressure and temperature.
Definition h2o.hh:650
static constexpr Scalar acentricFactor()
The acentric factor  of water.
Definition h2o.hh:74
static Scalar vaporPressure(Scalar T)
The vapor pressure in  of pure water at a given temperature.
Definition h2o.hh:118
static constexpr Scalar criticalTemperature()
Returns the critical temperature  of water.
Definition h2o.hh:80
static Scalar gasThermalConductivity(const Scalar temperature, const Scalar pressure)
Thermal conductivity  of steam (IAPWS) .
Definition h2o.hh:778
static constexpr Scalar triplePressure()
Returns the pressure  at water's triple point.
Definition h2o.hh:104
static Scalar gasInternalEnergy(Scalar temperature, Scalar pressure)
Specific internal energy of steam and water vapor .
Definition h2o.hh:344
static const Scalar gasHeatCapacity(Scalar temperature, Scalar pressure)
Specific isobaric heat capacity of water steam .
Definition h2o.hh:239
static constexpr bool gasIsCompressible()
Returns true if the gas phase is assumed to be compressible.
Definition h2o.hh:459
static const Scalar liquidHeatCapacityConstVolume(Scalar temperature, Scalar pressure)
Specific isochoric heat capacity of liquid water .
Definition h2o.hh:411
static std::string name()
A human readable name for the water.
Definition h2o.hh:62
static constexpr Scalar molarMass()
The molar mass in  of water.
Definition h2o.hh:68
static constexpr Scalar criticalPressure()
Returns the critical pressure  of water.
Definition h2o.hh:86
static constexpr Scalar criticalMolarVolume()
Returns the molar volume  of water at the critical point.
Definition h2o.hh:92
static constexpr bool liquidIsCompressible()
Returns true if the liquid phase is assumed to be compressible.
Definition h2o.hh:465
static Scalar gasPressure(Scalar temperature, Scalar density)
The pressure of steam in  at a given density and temperature.
Definition h2o.hh:563
static constexpr Scalar tripleTemperature()
Returns the temperature  at water's triple point.
Definition h2o.hh:98
static Scalar gasMolarDensity(Scalar temperature, Scalar pressure)
The molar density of steam in  at a given pressure and temperature.
Definition h2o.hh:542
Interface for components that have a liquid state.
Definition liquid.hh:28
Implements relations which are common for all regions of the IAPWS '97 formulation.
Definition common.hh:45
static constexpr Scalar criticalMolarVolume
Critical molar volume of water .
Definition common.hh:60
static constexpr Scalar Rs
Specific gas constant of water .
Definition common.hh:51
static constexpr Scalar triplePressure
Triple pressure of water .
Definition common.hh:72
static constexpr Scalar molarMass
The molar mass of water .
Definition common.hh:48
static Scalar viscosity(Scalar temperature, Scalar rho)
The dynamic viscosity  of pure water.
Definition common.hh:88
static constexpr Scalar acentricFactor
The acentric factor of water .
Definition common.hh:63
static constexpr Scalar criticalTemperature
Critical temperature of water .
Definition common.hh:54
static constexpr Scalar tripleTemperature
Triple temperature of water .
Definition common.hh:69
static constexpr Scalar criticalPressure
Critical pressure of water .
Definition common.hh:57
static Scalar thermalConductivityIAPWS(const Scalar T, const Scalar rho)
Thermal conductivity  water (IAPWS) .
Definition common.hh:149
Implements the equations for region 1 of the IAPWS '97 formulation.
Definition region1.hh:38
static Scalar dGamma_dPi(Scalar temperature, Scalar pressure)
The partial derivative of the Gibbs free energy to the normalized pressure for IAPWS region 1 (i....
Definition region1.hh:170
static Scalar ddGamma_ddPi(Scalar temperature, Scalar pressure)
The second partial derivative of the Gibbs free energy to the normalized pressure for IAPWS region 1 ...
Definition region1.hh:229
static constexpr Scalar dPi_dp(Scalar pressure)
Returns the derivative of the reduced pressure to the pressure for IAPWS region 1 in .
Definition region1.hh:95
static constexpr Scalar tau(Scalar temperature)
Returns the reduced temperature for IAPWS region 1.
Definition region1.hh:69
static void checkValidityRange(Scalar temperature, Scalar pressure, const std::string &propertyName="This property")
Returns true if IAPWS region 1 applies for a (temperature in , pressure in ) pair.
Definition region1.hh:48
static Scalar dGamma_dTau(Scalar temperature, Scalar pressure)
The partial derivative of the Gibbs free energy to the normalized temperature for IAPWS region 1 (i....
Definition region1.hh:142
static constexpr Scalar pi(Scalar pressure)
Returns the reduced pressure for IAPWS region 1.
Definition region1.hh:86
static Scalar ddGamma_ddTau(Scalar temperature, Scalar pressure)
The second partial derivative of the Gibbs free energy to the normalized temperature for IAPWS region...
Definition region1.hh:258
static Scalar ddGamma_dTaudPi(Scalar temperature, Scalar pressure)
The partial derivative of the Gibbs free energy to the normalized pressure and to the normalized temp...
Definition region1.hh:199
Implements the equations for region 2 of the IAPWS '97 formulation.
Definition region2.hh:40
static Scalar ddGamma_ddTau(Scalar temperature, Scalar pressure)
The second partial derivative of the Gibbs free energy to the normalized temperature for IAPWS region...
Definition region2.hh:288
static Scalar dGamma_dTau(Scalar temperature, Scalar pressure)
The partial derivative of the Gibbs free energy to the normalized temperature for IAPWS region 2 (i....
Definition region2.hh:153
static Scalar ddGamma_dTaudPi(Scalar temperature, Scalar pressure)
The partial derivative of the Gibbs free energy to the normalized pressure and to the normalized temp...
Definition region2.hh:222
static Scalar ddGamma_ddPi(Scalar temperature, Scalar pressure)
The second partial derivative of the Gibbs free energy to the normalized pressure for IAPWS region 2 ...
Definition region2.hh:255
static void checkValidityRange(Scalar temperature, Scalar pressure, const std::string &propertyName="This property")
Returns true if IAPWS region 2 applies for a (temperature, pressure) pair.
Definition region2.hh:50
static constexpr Scalar pi(Scalar pressure)
Returns the reduced pressure (dimensionless) for IAPWS region 2.
Definition region2.hh:88
static constexpr Scalar dPi_dp(Scalar pressure)
Returns the derivative of the reduced pressure to the pressure for IAPWS region 2 in .
Definition region2.hh:97
static constexpr Scalar tau(Scalar temperature)
Returns the reduced temperature (dimensionless) for IAPWS region 2.
Definition region2.hh:71
static Scalar dGamma_dPi(Scalar temperature, Scalar pressure)
The partial derivative of the Gibbs free energy to the normalized pressure for IAPWS region 2 (i....
Definition region2.hh:190
Implements the equations for region 4 of the IAPWS '97 formulation.
Definition region4.hh:41
static Scalar saturationPressure(Scalar temperature)
Returns the saturation pressure in  of pure water at a given temperature.
Definition region4.hh:52
static Scalar vaporTemperature(Scalar pressure)
Returns the saturation temperature in  of pure water at a given pressure.
Definition region4.hh:83
static constexpr Scalar pressure(Scalar temperature, Scalar rhoMolar)
The pressure of the gas in , depending on the molar density and temperature.
Definition idealgas.hh:48
static constexpr Scalar density(Scalar avgMolarMass, Scalar temperature, Scalar pressure)
The density of the gas in , depending on pressure, temperature and average molar mass of the gas.
Definition idealgas.hh:37
Exception thrown if a fixable numerical problem occurs.
Definition exceptions.hh:27
Implements relations common for all regions of the IAPWS '97 formulation. See:
Base class for all components Components provide the thermodynamic relations for the liquid,...
Some exceptions thrown in DuMux
Root finding algorithms for scalar functions.
Interface for components that have a gas state.
Scalar findScalarRootBrent(Scalar a, Scalar b, const ResFunc &residual, const Scalar tol=1e-13, const int maxIter=200)
Brent's root finding algorithm for scalar functions.
Definition findscalarroot.hh:99
Relations valid for an ideal gas.
Interface for components that have a liquid state.
Scalar viscosityNagel_(Scalar temperature)
Definition h2o.hh:923
Scalar viscosityReid_(Scalar temperature)
Definition h2o.hh:905
Scalar h2oGasViscosityInMixture(Scalar temperature, Scalar pressure)
The dynamic viscosity  of steam in a gas mixture.
Definition h2o.hh:964
std::string temperature() noexcept
I/O name of temperature for equilibrium models.
Definition name.hh:39
std::string pressure(int phaseIdx) noexcept
I/O name of pressure for multiphase systems.
Definition name.hh:22
Implements the equations for region 1 of the IAPWS '97 formulation. See:
Implements the equations for region 2 of the IAPWS '97 formulation. See:
Implements the equations for region 4 of the IAPWS '97 formulation.
IsAqueous struct.
Definition components/base.hh:34