11 #include "libmesh/utility.h"
40 mooseAssert(z > 0,
"LambertW function in RichardsSeff1BWsmall called with negative argument");
42 const Real eps = 4.0e-16;
71 p = std::sqrt(2.0 * (2.7182818284590452353602874713526625 * z + 1.0));
72 w = -1.0 + p * (1.0 + p * (-0.333333333333333333333 + p * 0.152777777777777777777777));
78 for (
unsigned int i = 0; i < 10; ++i)
84 t /= e * p - 0.5 * (p + 1.0) * t / p;
86 if (std::abs(t) < eps * (1.0 + std::abs(w)))
90 mooseError(
"LambertW: No convergence at z= ", z,
"\n");
98 const Real x = (c - 1.0) * std::exp(c - 1.0 - c *
pressure / las);
99 const Real th = c / (1.0 +
LambertW(x));
100 return sn + (ss - sn) * th;
108 const Real x = (c - 1.0) * std::exp(c - 1.0 - c *
pressure / las);
110 return (ss - sn) * Utility::pow<2>(c) / las * lamw / Utility::pow<3>(1.0 + lamw);
118 const Real x = (c - 1.0) * std::exp(c - 1.0 - c *
pressure / las);
120 return -(ss - sn) * Utility::pow<3>(c) / Utility::pow<2>(las) * lamw * (1.0 - 2.0 * lamw) /
121 Utility::pow<5>(1.0 + lamw);
133 const Real coef = (ks - kn) * (c - 1.0);
134 const Real th = (s - sn) / (ss - sn);
135 const Real krel = kn + coef * Utility::pow<2>(th) / (c - th);
148 const Real coef = (ks - kn) * (c - 1.0);
149 const Real th = (s - sn) / (ss - sn);
150 const Real krelp = coef * (2.0 * th / (c - th) + Utility::pow<2>(th) / Utility::pow<2>(c - th));
151 return krelp / (ss - sn);
163 const Real coef = (ks - kn) * (c - 1.0);
164 const Real th = (s - sn) / (ss - sn);
165 const Real krelpp = coef * (2.0 / (c - th) + 4.0 * th / Utility::pow<2>(c - th) +
166 2.0 * Utility::pow<2>(th) / Utility::pow<3>(c - th));
167 return krelpp / Utility::pow<2>(ss - sn);