# fronts.D.richards¶

fronts.D.richards(C, kr, Ks=None, k=None, nu=1e-06, g=9.81)

Return a moisture diffusivity function for a Richards equation problem.

Given K_S and the functions C and $$k_r$$ (whose argument is either water content or saturation), returns the function:

$D(\theta) = \frac{K_S k_r(\theta)}{C(\theta)}$

This function helps transform problems of the horizontal Richards equation (for which $$K_S$$, $$k_r$$, and C are known parameters) into problems of the moisture diffusivity equation that can be solved with this library.

Parameters
• C (callable) – Capillary capacity function (also known as hydraulic capacity function). A twice-differentiable function that maps values of $$\theta$$ to positive values. It can be called as C(theta) to evaluate it at theta. It can also be called as C(theta, n) with n equal to 1 or 2, in which case the first n derivatives of the function evaluated at the same theta are included (in order) as additional return values. While mathematically a scalar function, C operates in a vectorized fashion with the same semantics when theta is a numpy.ndarray.

• kr (callable) – $$k_r$$, the relative permeability function (also known as relative conductivity function). A twice-differentiable function that maps values of $$\theta$$ to positive values (usually between 0 and 1). It can be called as kr(theta) to evaluate it at theta. It can also be called as kr(theta, n) with n equal to 1 or 2, in which case the first n derivatives of the function evaluated at the same theta are included (in order) as additional return values. While mathematically a scalar function, kr operates in a vectorized fashion with the same semantics when theta is a numpy.ndarray.

• Ks (None or float, optional) – $$K_S$$, the saturated hydraulic conductivity. Must be positive. If neither Ks nor k are given, the saturated hydraulic conductivity is assumed to be 1.

• k (None or float, optional) – Intrinsic permeability of the porous medium. Can be given in place of Ks, which results in the saturated hydraulic conductivity being computed using $$K_S = kg/\nu$$. Must be positive.

• nu (float, optional) – $$\nu$$, the kinematic viscosity of the wetting fluid. Only used if k is passed instead of Ks. Must be positive. Defaults to 1e-6, approximately the kinematic viscosity of water at 20°C in SI units.

• g (float, optional) – Magnitude of the gravitational acceleration. Only used if k is passed instead of Ks. Must be positive. Defaults to 9.81, the gravity of Earth in SI units.

Returns

D

Function to evaluate $$D$$ and its derivatives:

• D(theta) evaluates and returns $$D$$ at theta

• D(theta, 1) returns both the value of $$D$$ and its first derivative at theta

• D(theta, 2) returns the value of $$D$$, its first derivative, and its second derivative at theta

In all cases, the argument theta may be a single float or a NumPy array.

Return type

callable