OGS
LinearSaturationSwellingStress.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
8
10{
12 std::string name, double const coefficient,
13 double const reference_saturation)
14 : coefficient_(coefficient), reference_saturation_(reference_saturation)
15{
16 name_ = std::move(name);
17}
18
20 const VariableArray& /*variable_array*/,
21 const ParameterLib::SpatialPosition& /*pos*/, const double /*t*/,
22 const double /*dt*/) const
23{
25 "LinearSaturationSwellingStress value call requires previous time step "
26 "values.");
27}
28
30 const VariableArray& variable_array,
31 const VariableArray& variable_array_prev,
32 const ParameterLib::SpatialPosition& /*pos*/, const double /*t*/,
33 const double /*dt*/) const
34{
35 // Sl <= S_max is guaranteed by the saturation property or
36 // the saturation calculation.
37 const double Sl = variable_array.liquid_saturation;
38
39 if (Sl < reference_saturation_)
40 {
41 return 0.0;
42 }
43
44 const double Sl_prev = variable_array_prev.liquid_saturation;
45
46 return coefficient_ * (Sl - Sl_prev);
47}
48
50 VariableArray const& variable_array, Variable const variable,
51 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
52 double const /*dt*/) const
53{
54 if (variable != Variable::liquid_saturation)
55 {
57 "LinearSaturationSwellingStress::dValue is implemented for "
58 "derivatives with respect to liquid saturation only.");
59 }
60
61 // Sl <= S_max is guaranteed by the saturation property or
62 // the saturation calculation.
63 const double Sl = variable_array.liquid_saturation;
64
65 return Sl < reference_saturation_ ? 0.0 : coefficient_;
66}
67
68} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:19
LinearSaturationSwellingStress(std::string name, double const coefficient, double const reference_saturation)
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
virtual PropertyDataType value() const
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