The 3D version of this sim treats the gut lumen as one well-mixed batch reactor. Real chyme, however, travels the length of the colon over hours while bacteria stay attached to the wall — so this 2D model resolves an axial coordinate x along the tube instead. Fiber, lactate/acetate and butyrate advect downstream with the flow and diffuse, while the two bacterial populations are immobile wall biofilms that only grow or die locally. That single change reproduces a real, measured feature the batch model cannot: a genuine acidification gradient along the colon, most acidic where fermentation peaks and easing toward the distal end as SCFAs are absorbed.
Every grid cell integrates the same Monod (Michaelis–Menten) kinetics as the 3D model, plus transport terms, with a stability-clamped explicit finite-difference step:
∂S/∂t = -v·∂S/∂x + D·∂²S/∂x² - k1·A·S/(Ks+S) [fiber, advects]
∂A/∂t = μ1·A·S/(Ks+S) - dA·A [fermenter biofilm, fixed]
∂M/∂t = -v·∂M/∂x + D·∂²M/∂x² + y1·k1·A·S/(Ks+S) - k2·B·M/(Km+M) - decay·M
∂B/∂t = μ2·B·M/(Km+M) - dB·B [cross-feeder biofilm, fixed]
∂P/∂t = -v·∂P/∂x + D·∂²P/∂x² + y2·k2·B·M/(Km+M) - absorption·P
pH(x) ≈ 7.2 - s·(M(x) + P(x))
Note on the 3D version: its live pseudocode documents dP/dt = y₂·k₂·B·M/(Km+M) − absorption·P, but its actual code multiplies that production term by μ₂ a second time (once through B's growth, again directly on the yield). This model implements the yield term exactly as documented — once — which is the standard stoichiometric form.
- Fiber supply — the fixed fiber concentration entering at the proximal end (x=0); it is consumed as it advects downstream, so less reaches the distal colon.
- Primary fermenter growth (μ₁) — how fast the amber biofilm converts local fiber into the lactate/acetate pool M.
- Cross-feeder efficiency (μ₂, y₂) — how effectively the teal biofilm turns local M into butyrate P.
- Epithelial absorption — uniform clearance of P by the wall along the whole tube; low absorption lets butyrate — and acidity — pile up before it reaches the distal end.
Watch the pH curve at the bottom: real colonic pH is lowest in the proximal colon (fastest fermentation, most substrate) and rises toward the distal colon as fiber is exhausted and SCFAs are absorbed — exactly the shape this model produces from first principles, not a scripted animation.