OGS
WaterEnthalpyIAPWSIF97Region1.cpp
Go to the documentation of this file.
1
12
#include "
WaterEnthalpyIAPWSIF97Region1.h
"
13
14
#include <cmath>
15
16
#include "
BaseLib/Error.h
"
17
#include "
MaterialLib/Fluid/GibbsFreeEnergy/DimensionLessGibbsFreeEnergyRegion1.h
"
18
#include "
MaterialLib/PhysicalConstant.h
"
19
20
namespace
MaterialPropertyLib
21
{
22
23
const
MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1
24
gibbs_free_energy_
;
25
26
static
constexpr
double
ref_T_
= 1386;
27
static
constexpr
double
ref_p_
= 1.653e7;
28
29
PropertyDataType
WaterEnthalpyIAPWSIF97Region1::value
(
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 *
41
MaterialLib::PhysicalConstant::SpecificGasConstant::WaterVapour
* T *
42
gibbs_free_energy_
.
get_dgamma_dtau
(tau, pi);
43
}
44
45
PropertyDataType
WaterEnthalpyIAPWSIF97Region1::dValue
(
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) *
59
MaterialLib::PhysicalConstant::SpecificGasConstant::WaterVapour
;
60
}
61
62
OGS_FATAL
(
63
"WaterEnthalpyIAPWSIF97Region1::dValue is implemented for derivatives "
64
"with respect to temperature only."
);
65
}
66
}
// namespace MaterialPropertyLib
DimensionLessGibbsFreeEnergyRegion1.h
Declare a class for dimensionless Gibbs free energy, region1.
Error.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
PhysicalConstant.h
WaterEnthalpyIAPWSIF97Region1.h
MaterialPropertyLib::Property::value
virtual PropertyDataType value() const
Definition
Property.cpp:76
MaterialPropertyLib::VariableArray
Definition
VariableType.h:97
MaterialPropertyLib::VariableArray::temperature
double temperature
Definition
VariableType.h:188
MaterialPropertyLib::VariableArray::liquid_phase_pressure
double liquid_phase_pressure
Definition
VariableType.h:178
MaterialPropertyLib::WaterEnthalpyIAPWSIF97Region1::dValue
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
Definition
WaterEnthalpyIAPWSIF97Region1.cpp:45
ParameterLib::SpatialPosition
Definition
SpatialPosition.h:27
MaterialLib::PhysicalConstant::SpecificGasConstant::WaterVapour
constexpr double WaterVapour
Specific gas constant for water vapour.
Definition
PhysicalConstant.h:95
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:21
MaterialPropertyLib::ref_p_
static constexpr double ref_p_
reference pressure in Pa.
Definition
WaterEnthalpyIAPWSIF97Region1.cpp:27
MaterialPropertyLib::gibbs_free_energy_
const MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1 gibbs_free_energy_
Definition
WaterEnthalpyIAPWSIF97Region1.cpp:24
MaterialPropertyLib::Variable
Variable
Definition
VariableType.h:30
MaterialPropertyLib::Variable::temperature
@ temperature
MaterialPropertyLib::ref_T_
static constexpr double ref_T_
reference temperature in K.
Definition
WaterEnthalpyIAPWSIF97Region1.cpp:26
MaterialPropertyLib::PropertyDataType
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
MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1
Definition
DimensionLessGibbsFreeEnergyRegion1.h:34
MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1::get_dgamma_dtau
static double get_dgamma_dtau(const double tau, const double pi)
Definition
DimensionLessGibbsFreeEnergyRegion1.cpp:57
MaterialLib::Fluid::DimensionLessGibbsFreeEnergyRegion1::get_dgamma_dtau_dtau
static double get_dgamma_dtau_dtau(const double tau, const double pi)
Definition
DimensionLessGibbsFreeEnergyRegion1.cpp:70
MaterialLib
MPL
Properties
Enthalpy
WaterEnthalpyIAPWSIF97Region1.cpp
Generated by
1.12.0