OGS
VapourDiffusionDeVries.cpp
Go to the documentation of this file.
1
13
14#include <algorithm>
15#include <cmath>
16
20
21namespace MaterialPropertyLib
22{
24 const VariableArray& variable_array,
25 const ParameterLib::SpatialPosition& /*pos*/, const double /*t*/,
26 const double /*dt*/) const
27{
28 const double T = variable_array.temperature;
29 const double p_g = variable_array.gas_phase_pressure;
30
31 return base_diffusion_coefficient_ * std::pow(T, exponent_) / p_g;
32}
33
35 VariableArray const& variable_array, Variable const variable,
36 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
37 double const /*dt*/) const
38{
39 const double T = variable_array.temperature;
40 const double p_g = variable_array.gas_phase_pressure;
41
42 if (variable == Variable::temperature)
43 {
45 std::pow(T, exponent_ - 1.0) / p_g;
46 }
47 if (variable == Variable::gas_phase_pressure)
48 {
49 return -base_diffusion_coefficient_ * std::pow(T, exponent_) /
50 (p_g * p_g);
51 }
52 if (variable == Variable::liquid_saturation)
53 {
54 return 0.0;
55 }
56
58 "VapourDiffusionDeVries::dValue is implemented for derivatives with "
59 "respect to temperature or saturation only.");
60}
61
62} // 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
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