OGS
WaterDensityIAPWSIF97Region1.cpp
Go to the documentation of this file.
1
13
14#include <cmath>
15
16#include "BaseLib/Error.h"
19
20namespace MaterialPropertyLib
21{
22
24 VariableArray const& variable_array,
25 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
26 double const /*dt*/) const
27{
28 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
29 double const T = variable_array.temperature;
30 const double tau = ref_T_ / T;
31 const double pi = p / ref_p_;
32
33 return ref_p_ /
36}
37
39 VariableArray const& variable_array, Variable const variable,
40 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
41 double const /*dt*/) const
42{
43 const double T = variable_array.temperature;
44 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
45
46 const double tau = ref_T_ / T;
47 const double pi = p / ref_p_;
48
49 const double dgamma_dpi = gibbs_free_energy_.get_dgamma_dpi(tau, pi);
50
51 switch (variable)
52 {
54 return -(ref_p_ -
55 tau * ref_p_ *
57 dgamma_dpi) /
58 (MaterialLib::PhysicalConstant::SpecificGasConstant::
59 WaterVapour *
60 T * T * dgamma_dpi);
62 return -gibbs_free_energy_.get_dgamma_dpi_dpi(tau, pi) /
63 (MaterialLib::PhysicalConstant::SpecificGasConstant::
64 WaterVapour *
65 T * dgamma_dpi * dgamma_dpi);
66 default:
68 "WaterDensityIAPWSIF97Region1::dValue is implemented for "
69 "derivatives with "
70 "respect to temperature or liquid_phase_pressure only.");
71 }
72}
73
74} // 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.
const MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1 gibbs_free_energy_
static constexpr double ref_T_
reference temperature in K.
constexpr double WaterVapour
Specific gas constant for water vapour.
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_dpi_dpi(const double tau, const double pi)