OGS
WaterSaturationCurveIAPWSIF97Region4.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <array>
7#include <cmath>
8
10{
11
15inline double waterSaturationTemperature(double const pressure)
16{
17 static constexpr std::array n = {0.11670521452767e4, -0.72421316703206e6,
18 -0.17073846940092e2, 0.12020824702470e5,
19 -0.32325550322333e7, 0.14915108613530e2,
20 -0.48232657361591e4, 0.40511340542057e6,
21 -0.23855557567849, 0.65017534844798e3};
22
23 static constexpr double p_c = 1e6;
24
25 double const beta2 = std::sqrt(pressure / p_c);
26 double const beta = std::sqrt(beta2);
27
28 double const E = beta2 + n[2] * beta + n[5];
29 double const F = n[0] * beta2 + n[3] * beta + n[6];
30 double const G = n[1] * beta2 + n[4] * beta + n[7];
31
32 double const D = 2 * G / (-F - std::sqrt(F * F - 4 * E * G));
33
34 double const n10pD = n[9] + D;
35
36 return (n10pD - std::sqrt(n10pD * n10pD - 4 * (n[8] + n[9] * D))) / 2;
37}
38} // namespace MaterialPropertyLib::IAPWSIF97Region4