OGS
WaterEnthalpyIAPWSIF97Region1.cpp
Go to the documentation of this file.
1
13
14#include <cmath>
15
16#include "BaseLib/Error.h"
19
20namespace MaterialPropertyLib
21{
22
25
26static constexpr double ref_T_ = 1386;
27static constexpr double ref_p_ = 1.653e7;
28
30 VariableArray const& variable_array,
31 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
32 double const /*dt*/) const
33{
34 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
35 double const T = variable_array.temperature;
36
37 double const tau = ref_T_ / T;
38 double const pi = p / ref_p_;
39
40 return tau *
43}
44
46 VariableArray const& variable_array, Variable const variable,
47 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
48 double const /*dt*/) const
49{
50 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
51 double const T = variable_array.temperature;
52
53 double const tau = ref_T_ / T;
54 double const pi = p / ref_p_;
55
56 if (variable == Variable::temperature)
57 {
58 return -tau * tau * gibbs_free_energy_.get_dgamma_dtau_dtau(tau, pi) *
60 }
61
63 "WaterEnthalpyIAPWSIF97Region1::dValue is implemented for derivatives "
64 "with respect to temperature only.");
65}
66} // namespace MaterialPropertyLib
Declare a class for dimensionless Gibbs free energy, region1.
#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
constexpr double WaterVapour
Specific gas constant for water vapour.
static constexpr double ref_p_
reference pressure in Pa.
const MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1 gibbs_free_energy_
static constexpr double ref_T_
reference temperature in K.
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
static double get_dgamma_dtau_dtau(const double tau, const double pi)