29 const double krel_min)
34 S_L_for_krel_min_(computeSaturationForMinimumRelativePermeability())
45 const double S_L = std::clamp(
62 "RelPermNonWettingPhaseVanGenuchtenMualem::dValue is implemented "
63 "for the derivative with respect to liquid saturation only.");
66 const double S_L = std::get<double>(
77 const double S_L)
const
80 return std::sqrt(1.0 - Se) *
81 std::pow(1.0 - std::pow(Se, 1.0 /
m_), 2.0 *
m_);
85 const double S_L)
const
87 if (std::fabs(S_L -
S_L_max_) < std::numeric_limits<double>::epsilon())
94 const double val1 = std::sqrt(1.0 - Se);
95 const double val2 = 1.0 - std::pow(Se, 1.0 /
m_);
97 return (-0.5 * std::pow(val2, 2.0 *
m_) / val1 -
98 2.0 * std::pow(Se, -1.0 + 1.0 /
m_) * val1 *
99 std::pow(val2, 2.0 *
m_ - 1.0)) /
108 for (
int iterations = 0; iterations < 1000; ++iterations)
116 return S_for_k_rel_min;
121 "The given minimum relative permeability, {:g}, is not "
122 "associated with the saturation in the range of '('{:f}, {:f}')'. "
123 "Please try another one in '(0, 1)', which should be close to zero",
virtual PropertyDataType value() const
double computeValue(const double S_L) const
const double S_L_for_krel_min_
Liquid saturation that gives krel_min_.
const double m_
Exponent .
const double S_L_r_
Residual saturation of wetting phase.
double computeSaturationForMinimumRelativePermeability() const
RelPermNonWettingPhaseVanGenuchtenMualem(std::string name, const double S_L_r, const double S_n_r, const double m, const double krel_min)
double computeDerivative(const double S_L) const
const double S_L_max_
Maximum saturation of wetting phase.
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
const double krel_min_
Minimum relative permeability.
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
std::array< VariableType, static_cast< int >(Variable::number_of_variables)> VariableArray
void checkVanGenuchtenExponentRange(const double m)
static double const tolerance