OGS
LinearSaturationSwellingStress.cpp
Go to the documentation of this file.
1
13
16
17namespace MaterialPropertyLib
18{
20 std::string name, double const coefficient,
21 double const reference_saturation)
22 : coefficient_(coefficient), reference_saturation_(reference_saturation)
23{
24 name_ = std::move(name);
25}
26
28 const VariableArray& /*variable_array*/,
29 const ParameterLib::SpatialPosition& /*pos*/, const double /*t*/,
30 const double /*dt*/) const
31{
33 "LinearSaturationSwellingStress value call requires previous time step "
34 "values.");
35}
36
38 const VariableArray& variable_array,
39 const VariableArray& variable_array_prev,
40 const ParameterLib::SpatialPosition& /*pos*/, const double /*t*/,
41 const double /*dt*/) const
42{
43 // Sl <= S_max is guaranteed by the saturation property or
44 // the saturation calculation.
45 const double Sl = variable_array.liquid_saturation;
46
47 if (Sl < reference_saturation_)
48 {
49 return 0.0;
50 }
51
52 const double Sl_prev = variable_array_prev.liquid_saturation;
53
54 return coefficient_ * (Sl - Sl_prev);
55}
56
58 VariableArray const& variable_array, Variable const variable,
59 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
60 double const /*dt*/) const
61{
62 if (variable != Variable::liquid_saturation)
63 {
65 "LinearSaturationSwellingStress::dValue is implemented for "
66 "derivatives with respect to liquid saturation only.");
67 }
68
69 // Sl <= S_max is guaranteed by the saturation property or
70 // the saturation calculation.
71 const double Sl = variable_array.liquid_saturation;
72
73 return Sl < reference_saturation_ ? 0.0 : coefficient_;
74}
75
76} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:26
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
Definition Property.cpp:76
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