OGS
VapourDiffusionDeVries.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 <algorithm>
7#include <cmath>
8
12
13namespace MaterialPropertyLib
14{
16 const VariableArray& variable_array,
17 const ParameterLib::SpatialPosition& /*pos*/, const double /*t*/,
18 const double /*dt*/) const
19{
20 const double T = variable_array.temperature;
21 const double p_g = variable_array.gas_phase_pressure;
22
23 return base_diffusion_coefficient_ * std::pow(T, exponent_) / p_g;
24}
25
27 VariableArray const& variable_array, Variable const variable,
28 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
29 double const /*dt*/) const
30{
31 const double T = variable_array.temperature;
32 const double p_g = variable_array.gas_phase_pressure;
33
34 if (variable == Variable::temperature)
35 {
37 std::pow(T, exponent_ - 1.0) / p_g;
38 }
39 if (variable == Variable::gas_phase_pressure)
40 {
41 return -base_diffusion_coefficient_ * std::pow(T, exponent_) /
42 (p_g * p_g);
43 }
44 if (variable == Variable::liquid_saturation)
45 {
46 return 0.0;
47 }
48
50 "VapourDiffusionDeVries::dValue is implemented for derivatives with "
51 "respect to temperature or saturation only.");
52}
53
54} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:19
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
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