Wastewater flows into an aerated tank where bacteria eat the dissolved organic load (BOD), then into a clarifier where the sludge settles. Most of it is returned to the tank; a little is wasted. The wasting rate sets the sludge age, which sets how clean the water leaves. Typical textbook constants, not a design tool.
Sweeps the waste flow, lets the full dynamic model settle at each setting (ideal clarifier) and compares its steady effluent BOD with the closed form at the measured sludge age.
Press the button.
The science
Growth. Heterotrophic bacteria grow at the Monod rate μ = μmax S/(Ks+S), where S is the dissolved BOD. Yield Y turns eaten BOD into new cells, decay kd removes some. Rates follow temperature as kT = k20 θT-20 (θ = 1.07 for growth, 1.04 for decay).
Mass balances (completely-mixed tank, volume V). V dS/dt = Q(S0-S) - VμX/Y and V dX/dt = QrXr - (Q+Qr)X + V(μ-kd)X. The clarifier splits the flow: (Q+Qr)X = (Q-Qw)Xe + (Qr+Qw)Xr. The model is integrated with RK4 and sub-stepping (Monod uptake is stiff when S is small).
Sludge age. θc = V X / (QwXr + (Q-Qw)Xe) (SRT). At steady state with a perfect clarifier μ = 1/θc + kd, so S = Ks(1+kdθc) / (θc(μmax-kd) - 1) and X = (θc/τ) Y (S0-S)/(1+kdθc) (τ = V/Q). If θc is below θmin = 1/(μmaxS0/(Ks+S0) - kd) the bacteria are washed out faster than they grow and treatment collapses. These closed forms are the independent check of the time-march.
Oxygen and sludge. Net sludge production Px = Y Q (S0-S)/(1+kdθc) and oxygen demand Ro = Q(S0-S) - 1.42 Px (1.42 g O2 per g cells). Aeration power uses an illustrative 1.8 kg O2/kWh transfer efficiency. F/M = Q S0/(V X).
Settleability. The thickened sludge cannot exceed about Xr,max = 106/SVI mg/L. If the plant needs more, solids spill over the weir (bulking): the clarifier then follows Xe = [(Q+Qr)X - (Qr+Qw)Xr,max]/(Q-Qw).
What is simplified. Carbonaceous BOD only (no nitrification, phosphorus or denitrification); one bacterial group; constant influent; no dissolved-oxygen limit; the clarifier is an ideal splitter with an SVI cap instead of a solids-flux model; BOD carried by escaped solids is ignored in the effluent-BOD readout; waste sludge is taken from the recycle line. Constants are typical textbook-range values (to be spot-checked against a handbook): μmax=4/d, Ks=20 mg/L, Y=0.5, kd=0.1/d at 20 °C. The 3D view is schematic: bubbles and flocs scale with oxygen demand and biomass, flow dots move with the flows, the tank front is a cutaway.
Plant built in Blender and rendered with Three.js. Educational model.