Terrain is a seeded random surface on a 64 × 64 grid of 100 m cells (a dome plus noise, so water leaves in several directions). Depressions are filled (priority-flood), then every cell drains to its steepest downhill neighbour (D8):
down(i) = argmax_j (z_i - z_j) / dist(i,j)
accum(i) = 1 + sum of accum(upstream cells)
Cells that drain to the same outlet form a watershed. Rain falling on every cell is split into an infiltrating share φ and an excess share 1 − φ (a constant-fraction loss, which is a simplification of real infiltration capacity).
Quick flow, time-area method:
cell c delivers (1-φ) P a during t_c ≤ t < t_c + D
t_c = sum over the flow path of dist / v (v = hillslope 0.15 m/s,
or the channel velocity where accum ≥ 40 cells)
Baseflow, linear reservoir:
dS/dt = φ P A - k S , Q_b = k S
- Quick flow rises as more distant cells start to contribute (the contributing area grows with t), peaks, then falls once the storm ends and the slowest water arrives.
- Baseflow rises slowly while the store fills and then recedes as e-kt; a smaller k gives a longer, flatter tail.
- The velocities, the 100 m cell size and the constant infiltrating share are illustrative values, not calibrated to a real catchment. There is no evapotranspiration, channel storage or routing attenuation, and rain is uniform in space.
- The checks compare the model with area conservation, closed-form volume and recession results and an independent RK4 integration of the reservoir equation.