Aerobic microbes oxidise the food-waste substrate for energy, releasing heat:
C6H12O6 + 6 O2 → 6 CO2 + 6 H2O + heat
The pile's core temperature follows a heat balance each simulated hour:
dT/dt = (Q_gen − Q_loss) / C
Q_gen = k · S · f(T) · f(M) · f(CN) · f(O2)
Q_loss = h(size) · (T − T_ambient)
- f(T) — a bell curve: activity is low below ~20°C, peaks near 58°C (thermophilic optimum). Fix applied here: the original 3D model switched to a separate linear die-off formula above 72°C that jumped discontinuously upward right at the boundary (verified numerically: the bell curve gives ≈0.71 at T=72°C, but the linear branch evaluates to 1.0 the instant T crosses 72°C — a ~40% activity spike exactly where microbes should be dying off fastest). This 2D engine anchors the die-off branch to the bell curve's own value at 72°C so activity decays smoothly and monotonically past the peak.
- f(M) — moisture factor, optimal at 60–80%; too dry starves the microbes, too wet drowns them and starts pushing the pile anaerobic.
- f(CN) — carbon:nitrogen factor, optimal near 25–30:1; far outside that range (too much "brown" or too much "green") slows decomposition.
- f(O2) — oxygen at the core is consumed by microbial respiration and only resupplied by physically turning the pile; if it isn't turned, the core suffocates, activity collapses and the zone turns anaerobic (grey-green, slow, smelly).
- Substrate S depletes as decomposition proceeds, so heat generation eventually falls even with perfect conditions — the pile then cools and cures.
Real compost passes through mesophilic (20–45°C) → thermophilic (45–70°C, pathogen/weed-seed kill) → cooling → curing phases over weeks, exactly what this model reproduces at accelerated speed. The top canvas is a cross-section through the pile (chunks positioned and thermally colored by the same core/height math as the 3D version); the bottom canvas is a live rolling history of temperature, oxygen and decomposition — drag it left/right to scrub back through the pile's history, or hit "Jump to live" to snap back.