OGS
WaterTemperatureIAPWSIF97Region1.cpp
Go to the documentation of this file.
1
13
14#include <cmath>
15
16#include "BaseLib/Error.h"
17
18namespace MaterialPropertyLib
19{
20static constexpr std::array n_T = {
21 -0.23872489924521e3, 0.40421188637945e3, 0.11349746881718e3,
22 -0.58457616048039e1, -0.15285482413140e-3, -0.10866707695377e-5,
23 -0.13391744872602e2, 0.43211039183559e2, -0.54010067170506e2,
24 0.30535892203916e2, -0.65964749423638e1, 0.93965400878363e-2,
25 0.11573647505340e-6, -0.25858641282073e-4, -0.40644363084799e-8,
26 0.66456186191635e-7, 0.80670734103027e-10, -0.93477771213947e-12,
27 0.58265442020601e-14, -0.15020185953503e-16};
28
29static constexpr std::array I_T = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1,
30 1, 1, 1, 2, 2, 3, 3, 4, 5, 6};
31
32static constexpr std::array J_T = {0, 1, 2, 6, 22, 32, 0, 1, 2, 3,
33 4, 10, 32, 10, 32, 10, 32, 32, 32, 32};
34
35double computeTemperature(double const pi, double const eta)
36{
37 double val = 0.;
38 for (int i = 0; i < 20; i++)
39 {
40 val += n_T[i] * std::pow(pi, I_T[i]) * std::pow(eta + 1, J_T[i]);
41 }
42
43 return val;
44}
45
47 VariableArray const& variable_array,
48 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
49 double const /*dt*/) const
50{
51 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
52 double const h = variable_array.enthalpy;
53
54 static constexpr double ref_h_ = 2500e3;
55 static constexpr double ref_p_ = 1e6;
56
57 double const eta = h / ref_h_;
58 double const pi = p / ref_p_;
59
60 return computeTemperature(pi, eta);
61}
62
64 VariableArray const& /*variable_array*/, Variable const /*variable*/,
65 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
66 double const /*dt*/) const
67{
68 OGS_FATAL("WaterTemperatureIAPWSIF97Region1::dValue is not implemented.");
69}
70
71} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:26
virtual PropertyDataType value() const
Definition Property.cpp:76
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
static constexpr double ref_p_
reference pressure in Pa.
double computeTemperature(double const pi, double const eta)
static constexpr std::array n_T
static constexpr std::array I_T
static constexpr std::array J_T
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType
Definition Property.h:31