OGS
VapourDiffusionPMQ.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 S_L = std::clamp(variable_array.liquid_saturation, 0.0, 1.0);
21
22 const double T = variable_array.temperature;
23
24 const double S_v = 1 - S_L;
25 const double D_vr = S_v;
26
29 exponent_) *
30 D_vr;
31}
32
34 VariableArray const& variable_array, Variable const variable,
35 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
36 double const /*dt*/) const
37{
38 const double S_L = std::clamp(variable_array.liquid_saturation, 0.0, 1.0);
39
40 const double T = variable_array.temperature;
41
42 if (variable == Variable::temperature)
43 {
44 const double S_v = 1 - S_L;
45 const double D_vr = S_v;
46
49 exponent_ - 1.0) *
51 }
52
53 if (variable == Variable::liquid_saturation)
54 {
57 exponent_);
58 }
59
61 "VapourDiffusionPMQ::dValue is implemented for "
62 "derivatives with respect to temperature or saturation only.");
63}
64
65} // 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
constexpr double CelsiusZeroInKelvin
Zero degrees Celsius in Kelvin.
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