OGS
DupuitPermeability.cpp
Go to the documentation of this file.
1
12
13namespace MaterialPropertyLib
14{
16 std::string name, ParameterLib::Parameter<double> const& parameter)
17 : parameter_(parameter)
18{
19 name_ = std::move(name);
20}
21
23 MaterialPropertyLib::VariableArray const& variable_array,
24 ParameterLib::SpatialPosition const& pos, double const t,
25 double const /*dt*/) const
26{
27 double const pressure = variable_array.liquid_phase_pressure;
28 auto const& permeability_values = parameter_(t, pos);
29
30 auto const& permeability_variant = fromVector(permeability_values);
31 PropertyDataType dupuit_permeability = std::visit(
32 [&pressure](auto const& permeability_variant) -> PropertyDataType
33 {
34 using T = std::decay_t<decltype(permeability_variant)>;
35 if constexpr (std::is_same_v<T, double>)
36 {
37 return pressure * permeability_variant;
38 }
39 else
40 {
41 return (pressure * permeability_variant).eval();
42 }
43 },
44 permeability_variant);
45
46 return dupuit_permeability;
47}
48
49} // namespace MaterialPropertyLib
ParameterLib::Parameter< double > const & parameter_
DupuitPermeability(std::string name, ParameterLib::Parameter< double > const &parameter)
This constructor accepts two parameters.
virtual PropertyDataType value() const
Definition Property.cpp:76
PropertyDataType fromVector(std::vector< double > const &values)
Definition Property.cpp:23
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