OGS
WaterSaturationCurveIAPWSIF97Region4.h
Go to the documentation of this file.
1
12#pragma once
13
14#include <array>
15#include <cmath>
16
18{
19
23inline double waterSaturationTemperature(double const pressure)
24{
25 static constexpr std::array n = {0.11670521452767e4, -0.72421316703206e6,
26 -0.17073846940092e2, 0.12020824702470e5,
27 -0.32325550322333e7, 0.14915108613530e2,
28 -0.48232657361591e4, 0.40511340542057e6,
29 -0.23855557567849, 0.65017534844798e3};
30
31 static constexpr double p_c = 1e6;
32
33 double const beta2 = std::sqrt(pressure / p_c);
34 double const beta = std::sqrt(beta2);
35
36 double const E = beta2 + n[2] * beta + n[5];
37 double const F = n[0] * beta2 + n[3] * beta + n[6];
38 double const G = n[1] * beta2 + n[4] * beta + n[7];
39
40 double const D = 2 * G / (-F - std::sqrt(F * F - 4 * E * G));
41
42 double const n10pD = n[9] + D;
43
44 return (n10pD - std::sqrt(n10pD * n10pD - 4 * (n[8] + n[9] * D))) / 2;
45}
46} // namespace MaterialPropertyLib::IAPWSIF97Region4