OGS
KozenyCarmanModel.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 "KozenyCarmanModel.h"
5
6#include <algorithm>
7#include <cmath>
8
10{
12 MaterialPropertyLib::VariableArray const& variable_array,
13 ParameterLib::SpatialPosition const& pos, double const t,
14 double const /*dt*/) const
15{
16 double const phi = variable_array.porosity;
17 auto const& k0 = _k0(t, pos);
18
19 std::vector<double> k;
20 k.reserve(k0.size());
21 std::transform(k0.cbegin(), k0.cend(), std::back_inserter(k),
22 [&](auto const& k_component)
23 {
24 return k_component *
25 std::pow((1 - _phi0(t, pos)[0]) / (1 - phi), 2) *
26 std::pow(phi / _phi0(t, pos)[0], 3);
27 });
28
29 return fromVector(k);
30}
31
32} // namespace MaterialPropertyLib
ParameterLib::Parameter< double > const & _k0
Initial medium permeability.
virtual PropertyDataType value() const
PropertyDataType fromVector(std::vector< double > const &values)
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