OGS
KozenyCarmanModel.cpp
Go to the documentation of this file.
1 
11 #include "KozenyCarmanModel.h"
12 
13 #include <algorithm>
14 #include <cmath>
15 
16 namespace MaterialPropertyLib
17 {
19  MaterialPropertyLib::VariableArray const& variable_array,
20  ParameterLib::SpatialPosition const& pos, double const t,
21  double const /*dt*/) const
22 {
23  double const phi = std::get<double>(variable_array[static_cast<int>(
25  auto const& k0 = _k0(t, pos);
26 
27  std::vector<double> k;
28  k.reserve(k0.size());
29  std::transform(k0.cbegin(), k0.cend(), std::back_inserter(k),
30  [&](auto const& k_component)
31  {
32  return k_component *
33  std::pow((1 - _phi0(t, pos)[0]) / (1 - phi), 2) *
34  std::pow(phi / _phi0(t, pos)[0], 3);
35  });
36 
37  return fromVector(k);
38 }
39 
40 } // namespace MaterialPropertyLib
ParameterLib::Parameter< double > const & _k0
Initial medium permeability.
virtual PropertyDataType value() const
Definition: Property.cpp:72
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 > > PropertyDataType
Definition: Property.h:35
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
Definition: VariableType.h:108