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 attheta
. It can also be called asC(theta, n)
withn
equal to 1 or 2, in which case the firstn
derivatives of the function evaluated at the sametheta
are included (in order) as additional return values. While mathematically a scalar function, C operates in a vectorized fashion with the same semantics whentheta
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 attheta
. It can also be called askr(theta, n)
withn
equal to 1 or 2, in which case the firstn
derivatives of the function evaluated at the sametheta
are included (in order) as additional return values. While mathematically a scalar function, kr operates in a vectorized fashion with the same semantics whentheta
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\) attheta
D(theta, 1)
returns both the value of \(D\) and its first derivative attheta
D(theta, 2)
returns the value of \(D\), its first derivative, and its second derivative attheta
In all cases, the argument
theta
may be a single float or a NumPy array.- Return type:
callable