OGS
BishopsPowerLaw.cpp
Go to the documentation of this file.
1
10#include "BishopsPowerLaw.h"
11
12namespace MaterialPropertyLib
13{
14BishopsPowerLaw::BishopsPowerLaw(std::string name, double const exponent)
15 : m_(exponent)
16{
17 name_ = std::move(name);
18}
19
21{
22 if (!std::holds_alternative<Medium*>(scale_))
23 {
25 "The property 'BishopsPowerLaw' is implemented on the 'media' "
26 "scale only.");
27 }
28}
29
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
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 {
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
#define OGS_FATAL(...)
Definition Error.h:26
BishopsPowerLaw(std::string name, double const exponent)
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &, double const, double const) const override
virtual PropertyDataType value() const
Definition Property.cpp:76
std::variant< Medium *, Phase *, Component * > scale_
Definition Property.h:297
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