OGS
WaterEnthalpyIAPWSIF97Region1.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
5
6#include <cmath>
7
8#include "BaseLib/Error.h"
11
12namespace MaterialPropertyLib
13{
14
15const MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1
17
18static constexpr double ref_T_ = 1386;
19static constexpr double ref_p_ = 1.653e7;
20
22 VariableArray const& variable_array,
23 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
24 double const /*dt*/) const
25{
26 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
27 double const T = variable_array.temperature;
28
29 double const tau = ref_T_ / T;
30 double const pi = p / ref_p_;
31
33 T * gibbs_free_energy_.get_dgamma_dtau(tau, pi);
34}
35
37 VariableArray const& variable_array, Variable const variable,
38 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
39 double const /*dt*/) const
40{
41 double const p = std::max(0.0, variable_array.liquid_phase_pressure);
42 double const T = variable_array.temperature;
43
44 double const tau = ref_T_ / T;
45 double const pi = p / ref_p_;
46
47 if (variable == Variable::temperature)
48 {
49 return -tau * tau * gibbs_free_energy_.get_dgamma_dtau_dtau(tau, pi) *
51 }
52
54 "WaterEnthalpyIAPWSIF97Region1::dValue is implemented for derivatives "
55 "with respect to temperature only.");
56}
57} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:10
virtual PropertyDataType value() const
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.
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