OGS
LiquidViscosityVogels.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
5
6#include <cmath>
7
8#include "BaseLib/Error.h"
10
11namespace MaterialPropertyLib
12{
13
14template <typename VogelsConstants>
16 VariableArray const& variable_array,
17 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
18 double const /*dt*/) const
19{
20 const double T = variable_array.temperature;
21 // Note: the constant of 1.e-3 is for the SI unit conversion.
22 return 1.e-3 * std::exp(constants_.A + constants_.B / (constants_.C + T));
23}
24
25template <typename VogelsConstants>
27 VariableArray const& variable_array, Variable const variable,
28 ParameterLib::SpatialPosition const& /*pos*/, double const /*t*/,
29 double const /*dt*/) const
30{
31 if (variable != Variable::temperature)
32 {
34 "LiquidViscosityVogels::dValue is implemented for "
35 "derivatives with respect to temperature only.");
36 }
37 const double T = variable_array.temperature;
38 const double f_buff = constants_.B / (constants_.C + T);
39 // Note: the constant of 1.e-3 is for the SI unit conversion.
40 return -1.e-3 * f_buff * std::exp(constants_.A + f_buff) /
41 (constants_.C + T);
42}
43
47
48} // namespace MaterialPropertyLib
#define OGS_FATAL(...)
Definition Error.h:19
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
virtual PropertyDataType value() const
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