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
7{
8BishopsPowerLaw::BishopsPowerLaw(std::string name, double const exponent)
9 : m_(exponent)
10{
11 name_ = std::move(name);
12}
13
15{
16 if (!std::holds_alternative<Medium*>(scale_))
17 {
19 "The property 'BishopsPowerLaw' is implemented on the 'media' "
20 "scale only.");
21 }
22}
23
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
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 {
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
#define OGS_FATAL(...)
Definition Error.h:19
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
std::variant< Medium *, Phase *, Component * > scale_
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