OGS
MaterialPropertyLib::IAPWSIF97Region4 Namespace Reference

Functions

void checkPressureInRange (double const pressure, std::string_view const quantity)
double waterSaturationTemperature (double const pressure)

Variables

constexpr double minimum_saturation_pressure = 611.213
 Pa.

Function Documentation

◆ checkPressureInRange()

void MaterialPropertyLib::IAPWSIF97Region4::checkPressureInRange ( double const pressure,
std::string_view const quantity )
inline

Aborts the assembly if pressure lies outside the pressure range of the region 4 saturation line. Outside it the correlations below are extrapolated and no longer describe water, and they do not say so themselves: they return plausible looking values well outside the range, 998 kg/m^3 at half the lower bound and 618 kg/m^3 at twice the critical pressure, where no saturation state exists at all. Nothing downstream can catch what this check lets through.

The pressure is a solution iterate, so leaving the range is a diverging step rather than a broken input, and an AssemblyException lets the time stepper repeat the step with a smaller step size, as for every other inadmissible state the closure reports.

Parameters
pressurethe pressure to check, in Pa.
quantitythe quantity being evaluated, named in the message.

Definition at line 38 of file WaterSaturationCurveIAPWSIF97Region4.h.

40{
41 constexpr double maximum_saturation_pressure =
43
44 if ((pressure < minimum_saturation_pressure) ||
45 (pressure > maximum_saturation_pressure))
46 {
47 throw NumLib::AssemblyException(fmt::format(
48 "Pressure {:g} Pa is out of the range [{:g}, {:g}] Pa for {}.",
49 pressure, minimum_saturation_pressure, maximum_saturation_pressure,
50 quantity));
51 }
52}

References minimum_saturation_pressure, and MaterialLib::PhysicalConstant::CriticalPoint::PressureWater.

Referenced by MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4::value(), MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4::value(), MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4::value(), MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4::value(), and MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4::value().

◆ waterSaturationTemperature()

double MaterialPropertyLib::IAPWSIF97Region4::waterSaturationTemperature ( double const pressure)
inline

The saturation-temperature equation function in region 4, from "The International Association for the Properties of Water and Steam" (see http://www.iapws.org/relguide/IF97-Rev.pdf) p.35, section 8.2.

Definition at line 57 of file WaterSaturationCurveIAPWSIF97Region4.h.

58{
59 static constexpr std::array n = {0.11670521452767e4, -0.72421316703206e6,
60 -0.17073846940092e2, 0.12020824702470e5,
61 -0.32325550322333e7, 0.14915108613530e2,
62 -0.48232657361591e4, 0.40511340542057e6,
63 -0.23855557567849, 0.65017534844798e3};
64
65 static constexpr double p_c = 1e6;
66
67 double const beta2 = std::sqrt(pressure / p_c);
68 double const beta = std::sqrt(beta2);
69
70 double const E = beta2 + n[2] * beta + n[5];
71 double const F = n[0] * beta2 + n[3] * beta + n[6];
72 double const G = n[1] * beta2 + n[4] * beta + n[7];
73
74 double const D = 2 * G / (-F - std::sqrt(F * F - 4 * E * G));
75
76 double const n10pD = n[9] + D;
77
78 return (n10pD - std::sqrt(n10pD * n10pD - 4 * (n[8] + n[9] * D))) / 2;
79}

References MaterialPropertyLib::beta.

Referenced by MaterialPropertyLib::WaterLiquidDensityIAPWSIF97Region4::value(), MaterialPropertyLib::WaterLiquidEnthalpyIAPWSIF97Region4::value(), MaterialPropertyLib::WaterSaturationTemperatureIAPWSIF97Region4::value(), MaterialPropertyLib::WaterVapourDensityIAPWSIF97Region4::value(), and MaterialPropertyLib::WaterVapourEnthalpyIAPWSIF97Region4::value().

Variable Documentation

◆ minimum_saturation_pressure

double MaterialPropertyLib::IAPWSIF97Region4::minimum_saturation_pressure = 611.213
constexpr

Pa.

Lower bound of the pressure range of the region 4 saturation line, the saturation pressure at 273.15 K. It is fixed by the formulation itself, see http://www.iapws.org/relguide/IF97-Rev.pdf p.33, section 8.1, and is neither the triple point pressure of ordinary water nor to be updated to it. The upper bound of the range is the critical pressure.

Definition at line 22 of file WaterSaturationCurveIAPWSIF97Region4.h.

Referenced by checkPressureInRange().