15 #include "libmesh/utility.h" 26 "Low saturation. This must be < Ss, and non-negative. This is BW's " 27 "initial effective saturation, below which effective saturation never goes " 28 "in their simulations/models. If Kn=0 then Sn is the immobile saturation. " 29 "This form of effective saturation is only correct for Kn small.");
34 "High saturation. This must be > Sn and <= 1. Effective saturation " 35 "where porepressure = 0. Effective saturation never exceeds this " 36 "value in BW's simulations/models.");
38 "C",
"C > 1",
"BW's C parameter. Must be > 1. Typical value would be 1.05.");
41 "BW's lambda_s parameter multiplied " 42 "by (fluiddensity*gravity). Must be " 43 "> 0. Typical value would be 1E5");
44 params.
addClassDescription(
"Broadbridge-white form of effective saturation for negligable Kn. " 45 "Then porepressure = -las*( (1-th)/th - (1/c)Ln((C-th)/((C-1)th))), " 46 "for th = (Seff - Sn)/(Ss - Sn). A Lambert-W function must be " 47 "evaluated to express Seff in terms of porepressure, which can be " 54 _sn(getParam<
Real>(
"Sn")),
55 _ss(getParam<
Real>(
"Ss")),
56 _c(getParam<
Real>(
"C")),
57 _las(getParam<
Real>(
"las"))
60 mooseError(
"In BW effective saturation Sn set to ",
64 " but these must obey Ss > Sn");
92 mooseAssert(z > 0,
"LambertW function in RichardsSeff1BWsmall called with negative argument");
124 p =
std::sqrt(2.0 * (2.7182818284590452353602874713526625 * z + 1.0));
125 w = -1.0 + p * (1.0 + p * (-0.333333333333333333333 + p * 0.152777777777777777777777));
131 for (i = 0; i < 10; i++)
137 t /= e * p - 0.5 * (p + 1.0) * t / p;
143 mooseError(
"LambertW: No convergence at z= ", z,
"\n");
149 Real pp = (*p[0])[qp];
161 std::vector<Real> & result)
const 165 Real pp = (*p[0])[qp];
171 result[0] = Utility::pow<2>(
_c) /
_las * lamw / Utility::pow<3>(1 + lamw);
177 std::vector<std::vector<Real>> & result)
const 181 Real pp = (*p[0])[qp];
187 result[0][0] = -Utility::pow<3>(
_c) / Utility::pow<2>(
_las) * lamw * (1.0 - 2.0 * lamw) /
188 Utility::pow<5>(1 + lamw);
RichardsSeff1BWsmall(const InputParameters ¶meters)
void dseff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< Real > &result) const
derivative of effective saturation as a function of porepressure
Base class for effective saturation as a function of porepressure(s) The functions seff...
static InputParameters validParams()
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
"Broadbridge-White" form of effective saturation for Kn small as a function of porepressure (not capi...
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
const std::vector< double > x
void d2seff(std::vector< const VariableValue *> p, unsigned int qp, std::vector< std::vector< Real >> &result) const
second derivative of effective saturation as a function of porepressure
Real _las
BW's lambda_s parameter multiplied by (fluiddensity*gravity)
static InputParameters validParams()
Real _sn
BW's initial effective saturation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _c
BW's C parameter.
Real LambertW(const double z) const
LambertW function, returned value satisfies W(z)*exp(W(z))=z.
void mooseError(Args &&... args) const
Real seff(std::vector< const VariableValue *> p, unsigned int qp) const
effective saturation as a function of porepressure
Real _ss
Effective saturation where porepressure = 0.
registerMooseObject("RichardsApp", RichardsSeff1BWsmall)