OGS
LinearSaturationSwellingStress.cpp
Go to the documentation of this file.
1
12
#include "
LinearSaturationSwellingStress.h
"
13
14
#include "
MaterialLib/MPL/Medium.h
"
15
#include "
MaterialLib/MPL/VariableType.h
"
16
17
namespace
MaterialPropertyLib
18
{
19
LinearSaturationSwellingStress::LinearSaturationSwellingStress
(
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
27
PropertyDataType
LinearSaturationSwellingStress::value
(
28
const
VariableArray
&
/*variable_array*/
,
29
const
ParameterLib::SpatialPosition
&
/*pos*/
,
const
double
/*t*/
,
30
const
double
/*dt*/
)
const
31
{
32
OGS_FATAL
(
33
"LinearSaturationSwellingStress value call requires previous time step "
34
"values."
);
35
}
36
37
PropertyDataType
LinearSaturationSwellingStress::value
(
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
57
PropertyDataType
LinearSaturationSwellingStress::dValue
(
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
{
64
OGS_FATAL
(
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
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
LinearSaturationSwellingStress.h
Medium.h
VariableType.h
MaterialPropertyLib::LinearSaturationSwellingStress::LinearSaturationSwellingStress
LinearSaturationSwellingStress(std::string name, double const coefficient, double const reference_saturation)
Definition
LinearSaturationSwellingStress.cpp:19
MaterialPropertyLib::LinearSaturationSwellingStress::coefficient_
double const coefficient_
Definition
LinearSaturationSwellingStress.h:110
MaterialPropertyLib::LinearSaturationSwellingStress::dValue
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
Definition
LinearSaturationSwellingStress.cpp:57
MaterialPropertyLib::LinearSaturationSwellingStress::reference_saturation_
double const reference_saturation_
Definition
LinearSaturationSwellingStress.h:114
MaterialPropertyLib::Property::value
virtual PropertyDataType value() const
Definition
Property.cpp:76
MaterialPropertyLib::Property::name_
std::string name_
Definition
Property.h:290
MaterialPropertyLib::VariableArray
Definition
VariableType.h:97
MaterialPropertyLib::VariableArray::liquid_saturation
double liquid_saturation
Definition
VariableType.h:179
ParameterLib::SpatialPosition
Definition
SpatialPosition.h:27
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:21
MaterialPropertyLib::Variable
Variable
Definition
VariableType.h:30
MaterialPropertyLib::Variable::liquid_saturation
@ liquid_saturation
MaterialPropertyLib::name
@ name
Definition
PropertyType.h:66
MaterialPropertyLib::PropertyDataType
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
MaterialLib
MPL
Properties
SwellingStress
LinearSaturationSwellingStress.cpp
Generated by
1.12.0