39 mooseAssert(z > 0,
"LambertW function in RichardsSeff1BWsmall called with negative argument");
70 p =
std::sqrt(2.0 * (2.7182818284590452353602874713526625 * z + 1.0));
71 w = -1.0 + p * (1.0 + p * (-0.333333333333333333333 + p * 0.152777777777777777777777));
77 for (
unsigned int i = 0; i < 10; ++i)
83 t /= e * p - 0.5 * (p + 1.0) * t / p;
89 mooseError(
"LambertW: No convergence at z= ", z,
"\n");
99 return sn + (ss - sn) * th;
109 return (ss - sn) * Utility::pow<2>(
c) / las * lamw / Utility::pow<3>(1.0 + lamw);
119 return -(ss - sn) * Utility::pow<3>(
c) / Utility::pow<2>(las) * lamw * (1.0 - 2.0 * lamw) /
120 Utility::pow<5>(1.0 + lamw);
132 const Real coef = (ks - kn) * (
c - 1.0);
133 const Real th = (s - sn) / (ss - sn);
134 const Real krelp = coef * (2.0 * th / (
c - th) + Utility::pow<2>(th) / Utility::pow<2>(
c - th));
135 return krelp / (ss - sn);
147 const Real coef = (ks - kn) * (
c - 1.0);
148 const Real th = (s - sn) / (ss - sn);
149 const Real krelpp = coef * (2.0 / (
c - th) + 4.0 * th / Utility::pow<2>(
c - th) +
150 2.0 * Utility::pow<2>(th) / Utility::pow<3>(
c - th));
151 return krelpp / Utility::pow<2>(ss - sn);
Real d2RelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Second derivative of relative permeability with respect to saturation.
Real dEffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las)
Derivative of effective saturation wrt capillary pressure.
void mooseError(Args &&... args)
Real LambertW(Real z)
Provides the Lambert W function, which satisfies W(z) * exp(W(z)) = z.
ADRealEigenVector< T, D, asd > sqrt(const ADRealEigenVector< T, D, asd > &)
Real d2EffectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las)
Second derivative of effective saturation wrt capillary pressure.
Real effectiveSaturation(Real pc, Real c, Real sn, Real ss, Real las)
Effective saturation as a function of capillary pressure If pc>=0 this will yield 1...
ADRealEigenVector< T, D, asd > abs(const ADRealEigenVector< T, D, asd > &)
const std::vector< double > x
Real dRelativePermeability(Real s, Real c, Real sn, Real ss, Real kn, Real ks)
Derivative of relative permeability with respect to saturation.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string pressure
Broadbridge-White version of relative permeability, and effective saturation as a function of capilla...