OGS
BishopsPowerLaw.cpp
Go to the documentation of this file.
1
10
#include "
BishopsPowerLaw.h
"
11
12
namespace
MaterialPropertyLib
13
{
14
BishopsPowerLaw::BishopsPowerLaw
(std::string
name
,
double
const
exponent)
15
: m_(exponent)
16
{
17
name_
= std::move(
name
);
18
}
19
20
void
BishopsPowerLaw::checkScale
()
const
21
{
22
if
(!std::holds_alternative<Medium*>(
scale_
))
23
{
24
OGS_FATAL
(
25
"The property 'BishopsPowerLaw' is implemented on the 'media' "
26
"scale only."
);
27
}
28
}
29
30
PropertyDataType
BishopsPowerLaw::value
(
31
VariableArray
const
& variable_array,
32
ParameterLib::SpatialPosition
const
&
/*pos*/
,
double
const
/*t*/
,
33
double
const
/*dt*/
)
const
34
{
35
auto
const
S_L = variable_array.
liquid_saturation
;
36
37
return
std::pow(S_L,
m_
);
38
}
39
40
PropertyDataType
BishopsPowerLaw::dValue
(
41
VariableArray
const
& variable_array,
Variable
const
variable,
42
ParameterLib::SpatialPosition
const
&
/*pos*/
,
double
const
/*t*/
,
43
double
const
/*dt*/
)
const
44
{
45
if
(variable !=
Variable::liquid_saturation
)
46
{
47
OGS_FATAL
(
48
"BishopsPowerLaw::dValue is implemented for derivatives with "
49
"respect to liquid saturation only."
);
50
}
51
52
auto
const
S_L = variable_array.
liquid_saturation
;
53
54
return
m_
* std::pow(S_L,
m_
- 1.);
55
}
56
}
// namespace MaterialPropertyLib
BishopsPowerLaw.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:26
MaterialPropertyLib::BishopsPowerLaw::checkScale
void checkScale() const override
Definition
BishopsPowerLaw.cpp:20
MaterialPropertyLib::BishopsPowerLaw::m_
double const m_
Definition
BishopsPowerLaw.h:34
MaterialPropertyLib::BishopsPowerLaw::BishopsPowerLaw
BishopsPowerLaw(std::string name, double const exponent)
Definition
BishopsPowerLaw.cpp:14
MaterialPropertyLib::BishopsPowerLaw::dValue
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &, double const, double const) const override
Definition
BishopsPowerLaw.cpp:40
MaterialPropertyLib::Property::value
virtual PropertyDataType value() const
Definition
Property.cpp:76
MaterialPropertyLib::Property::name_
std::string name_
Definition
Property.h:290
MaterialPropertyLib::Property::scale_
std::variant< Medium *, Phase *, Component * > scale_
Definition
Property.h:297
MaterialPropertyLib::VariableArray
Definition
VariableType.h:99
MaterialPropertyLib::VariableArray::liquid_saturation
double liquid_saturation
Definition
VariableType.h:182
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
BishopsPowerLaw.cpp
Generated by
1.11.0