Concepts
This page introduces the StorAge Selection (SAS) framework at a level appropriate for users of the package. For the full mathematical treatment, see Harman (2015) and Benettin et al. (2022) and Harman and Xu Fei (2024).
What is StorAge Selection?
StorAge Selection (SAS) is a framework for modeling transport through a control volume — a catchment, a soil column, a lake, or any system where fluid enters, is stored, and eventually leaves.
The key idea is simple: at each moment in time, the water leaving a system is a mixture of water that entered at different times in the past. The SAS function describes which ages of water are preferentially selected for discharge.
Age-ranked storage
The foundation of SAS is the concept of age-ranked storage. At any time \(t\), the water in storage can be sorted by how long it has been in the system. We define:
where \(s_T(\tau, t)\) is the density of water of age \(\tau\) in storage at time \(t\), and \(S_T(T, t)\) is the cumulative storage up to age \(T\). The total storage is \(S(t) = S_T(\infty, t)\).
The SAS function
The SAS function \(\Omega_Q(S_T, t)\) is a cumulative distribution function that maps age-ranked storage to cumulative probability:
When \(\Omega_Q\) is a straight line from 0 to \(S(t)\), all ages of water are equally likely to be discharged — this is the well-mixed case. When \(\Omega_Q\) rises steeply at small \(S_T\), young water is preferentially discharged. When it rises steeply near \(S(t)\), old water is preferred.
The backward transit time distribution for outflow \(Q\) is:
Types of SAS functions
MESAS supports several types of SAS functions:
- Piecewise-linear
Defined by breakpoints in \((S_T, P)\) space. The simplest is a uniform distribution:
"ST": [0, S_max]. Adding more breakpoints creates more complex shapes.- Gamma distribution
A flexible family with shape, scale, and location parameters (
a,scale,loc). The shape parameter \(a\) controls whether young water (\(a < 1\)) or intermediate-aged water (\(a > 1\)) is preferentially discharged. Specified with"func": "gamma".- Beta distribution
Defined over a finite interval, useful when total storage volume is known. Has two shape parameters \(a\) and \(b\). Specified with
"func": "beta".- Kumaraswamy distribution
Similar to the beta but with a closed-form CDF, making it computationally efficient. Specified with
"func": "kumaraswamy".
All distribution-based SAS functions accept loc and scale
parameters that shift and stretch the distribution along the
\(S_T\) axis.
Solute transport
Once the water fluxes are solved, solute transport follows directly. The concentration of water of a given age in storage determines the concentration of the outflow:
where \(m_T(T,t)\) is the age-ranked solute mass in storage.
MESAS also supports:
First-order reactions via
k1andC_eqparametersEvapoconcentration via the
alphaparameterMultiple solutes tracked simultaneously
Time-varying parameters
Any SAS function or solute parameter can be made time-varying by
setting its value to a string that names a column in the input
DataFrame. For example, setting "scale": "S_0" in a gamma
specification causes the scale parameter to be read from the "S_0"
column at each timestep.
Further reading
Harman (2015) — Original SAS theory paper
Harman and Xu Fei (2024) — mesas.py model description paper (GMD)
Benettin et al. (2022) — Transport with SAS functions: a unified framework (GMD)
HydroLearn course — Free online course on SAS theory