fronts.BaseSolution
- class fronts.BaseSolution(sol, D)
Base class for solutions using the Boltzmann transformation.
Represents a continuously differentiable function \(\theta\) of r and t such that:
\[\dfrac{\partial\theta}{\partial t} = \nabla\cdot\left[D(\theta) \dfrac{\partial \theta}{\partial r}\mathbf{\hat{r}}\right]\]- Parameters:
sol (callable) – Solution to an ODE obtained with ode. For any float or numpy.ndarray
o
,sol(o)[0]
are the values of \(\theta\) ato
, andsol(o)[1]
are the values of the derivative \(d\theta/do\) ato
.D (callable) – Function to evaluate \(D\) at arbitrary values of the solution. Must be callable with a float or NumPy array as its argument.
See also
- __init__(sol, D)
Methods
__init__
(sol, D)d_do
([r, t, o])Boltzmann-variable derivative of the solution.
d_dr
(r, t)Spatial derivative of the solution.
d_dt
(r, t)Time derivative of the solution.
flux
(r, t)Diffusive flux.
sorptivity
(*, o)Sorptivity.
- __call__(r=None, t=None, o=None)
Evaluate the solution.
Evaluates and returns \(\theta\). May be called either with arguments r and t, or with just o.
- Parameters:
r (None or float or numpy.ndarray, shape (n,), optional) – Location(s). If this parameter is used, t must also be given.
t (None or float or numpy.ndarray, optional) – Time(s). Values must be positive.
o (None or float or numpy.ndarray, shape (n,) optional) – Value(s) of the Boltzmann variable. If this parameter is used, neither r nor t can be given.
- Return type:
float or numpy.ndarray, shape (n,)
- d_do(r=None, t=None, o=None)
Boltzmann-variable derivative of the solution.
Evaluates and returns \(d\theta/do\), the derivative of \(\theta\) with respect to the Boltzmann variable. May be called either with arguments r and t, or with just o.
- Parameters:
r (None or float or numpy.ndarray, shape (n,), optional) – Location(s). If this parameter is used, t must also be given.
t (None or float or numpy.ndarray, shape (n,), optional) – Time(s). Values must be positive.
o (None or float or numpy.ndarray, shape (n,), optional) – Value(s) of the Boltzmann variable. If this parameter is used, neither r nor t can be given.
- Return type:
float or numpy.ndarray, shape (n,)
- d_dr(r, t)
Spatial derivative of the solution.
Evaluates and returns \(\partial\theta/\partial r\).
- Parameters:
r (float or numpy.ndarray, shape (n,)) – Location(s) along the coordinate.
t (float or numpy.ndarray, shape (n,)) – Time(s). Values must be positive.
- Return type:
float or numpy.ndarray, shape (n,)
- d_dt(r, t)
Time derivative of the solution.
Evaluates and returns \(\partial\theta/\partial t\).
- Parameters:
r (float or numpy.ndarray, shape (n,)) – Location(s).
t (float or numpy.ndarray, shape (n,)) – Time(s). Values must be positive.
- Return type:
float or numpy.ndarray, shape (n,)
- flux(r, t)
Diffusive flux.
Returns the diffusive flux of \(\theta\) in the direction \(\mathbf{\hat{r}}\), equal to \(-D(\theta)\partial\theta/\partial r\).
- Parameters:
r (float or numpy.ndarray, shape (n,)) – Location(s).
t (float or numpy.ndarray, shape (n,)) – Time(s). Values must be positive.
- Return type:
float or numpy.ndarray, shape (n,)
- sorptivity(*, o)
Sorptivity.
Returns the sorptivity \(S\) of \(\theta\), equal to \(-2D(\theta)\partial\theta/\partial o\).
- Parameters:
o (float or numpy.ndarray, shape (n,)) – Value(s) of the Boltzmann variable.
- Return type:
float or numpy.ndarray, shape (n,)
References
[1] PHILIP, J. R. The theory of infiltration: 4. Sorptivity and algebraic infiltration equations. Soil Science, 1957, vol. 84, no. 3, pp. 257-264.