The substrate is modelled as a single water-storage bucket, tracked in millimetres of water depth over the roof — the exact same reservoir model driving the 3D version of this simulator:
S_max = depth × 0.30 (max storable water, mm)
S_fc = S_max × fieldCapacity (drainage threshold, mm)
dS/dt = P(t) − D(t) (mm/min)
D(t) = k·(S − S_fc) if S > S_fc, else 0
overflow = S − S_max if S would exceed S_max
Q_green = D + overflow (drained + saturation-excess outflow)
Q_bare = P(t) (bare roof: instant runoff)
Rain falls according to the chosen hyetograph (triangular, steady block, or a front-loaded burst that peaks early and tails off). Below field capacity the substrate simply absorbs water — no drainage. Once storage exceeds field capacity, a linear reservoir releases the excess at rate k·(S − S_fc), delaying and smoothing the outflow relative to the rain hitting the roof. If the substrate fully saturates (S ≥ S_max), any further rain leaves immediately as saturation-excess overflow, and the green roof stops offering any attenuation — exactly the moment its cross-section on the left shows blue water sheeting off just like the bare roof on the right.
- Substrate depth — deeper media stores more water before it starts draining or overflows.
- Peak rainfall intensity / duration — shapes the storm hyetograph (the "Bare roof" curve on the graph).
- Field capacity — the storage level, as a % of max, above which gravity drainage begins.
- Peak flow reduction — how much lower the green roof's peak outflow is than the bare-roof peak, the headline stormwater-management metric for real installations, computed here directly from the two simulated curves (not scripted).
- Drainage lag — the delay between the rainfall peak and the drained-outflow peak, which is what protects downstream sewers from a sudden surge.
Real-world relevance: this is the same bucket / linear-reservoir logic used in stormwater engineering software (e.g. SWMM's LID controls) to size green roofs against a design storm.