OGS
BishopsPowerLaw.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
4
#include "
BishopsPowerLaw.h
"
5
6
namespace
MaterialPropertyLib
7
{
8
BishopsPowerLaw::BishopsPowerLaw
(std::string
name
,
double
const
exponent)
9
:
m_
(exponent)
10
{
11
name_
= std::move(
name
);
12
}
13
14
void
BishopsPowerLaw::checkScale
()
const
15
{
16
if
(!std::holds_alternative<Medium*>(
scale_
))
17
{
18
OGS_FATAL
(
19
"The property 'BishopsPowerLaw' is implemented on the 'media' "
20
"scale only."
);
21
}
22
}
23
24
PropertyDataType
BishopsPowerLaw::value
(
25
VariableArray
const
& variable_array,
26
ParameterLib::SpatialPosition
const
&
/*pos*/
,
double
const
/*t*/
,
27
double
const
/*dt*/
)
const
28
{
29
auto
const
S_L = variable_array.
liquid_saturation
;
30
31
return
std::pow(S_L,
m_
);
32
}
33
34
PropertyDataType
BishopsPowerLaw::dValue
(
35
VariableArray
const
& variable_array,
Variable
const
variable,
36
ParameterLib::SpatialPosition
const
&
/*pos*/
,
double
const
/*t*/
,
37
double
const
/*dt*/
)
const
38
{
39
if
(variable !=
Variable::liquid_saturation
)
40
{
41
OGS_FATAL
(
42
"BishopsPowerLaw::dValue is implemented for derivatives with "
43
"respect to liquid saturation only."
);
44
}
45
46
auto
const
S_L = variable_array.
liquid_saturation
;
47
48
return
m_
* std::pow(S_L,
m_
- 1.);
49
}
50
}
// namespace MaterialPropertyLib
BishopsPowerLaw.h
OGS_FATAL
#define OGS_FATAL(...)
Definition
Error.h:19
MaterialPropertyLib::BishopsPowerLaw::checkScale
void checkScale() const override
Definition
BishopsPowerLaw.cpp:14
MaterialPropertyLib::BishopsPowerLaw::m_
double const m_
Definition
BishopsPowerLaw.h:29
MaterialPropertyLib::BishopsPowerLaw::BishopsPowerLaw
BishopsPowerLaw(std::string name, double const exponent)
Definition
BishopsPowerLaw.cpp:8
MaterialPropertyLib::BishopsPowerLaw::dValue
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &, double const, double const) const override
Definition
BishopsPowerLaw.cpp:34
MaterialPropertyLib::Property::value
virtual PropertyDataType value() const
Definition
MaterialLib/MPL/Property.cpp:67
MaterialPropertyLib::Property::name_
std::string name_
Definition
MaterialLib/MPL/Property.h:283
MaterialPropertyLib::Property::scale_
std::variant< Medium *, Phase *, Component * > scale_
Definition
MaterialLib/MPL/Property.h:290
MaterialPropertyLib::VariableArray
Definition
VariableType.h:94
MaterialPropertyLib::VariableArray::liquid_saturation
double liquid_saturation
Definition
VariableType.h:178
ParameterLib::SpatialPosition
Definition
SpatialPosition.h:21
MaterialPropertyLib
Definition
ChemicalSolverInterface.h:98
MaterialPropertyLib::Variable
Variable
Definition
VariableType.h:21
MaterialPropertyLib::Variable::liquid_saturation
@ liquid_saturation
Definition
VariableType.h:34
MaterialPropertyLib::name
@ name
Definition
PropertyType.h:57
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
MaterialLib/MPL/Property.h:24
MaterialLib
MPL
Properties
BishopsPowerLaw.cpp
Generated by
1.14.0