What you will build
A 1000 m³ aeration tank fed 4000 m³/d of wastewater at 300 mg bCOD/L. First it runs as a chemostat. Then you add a clarifier, return sludge and waste sludge, and watch the biomass rise twentyfold and the effluent improve fifty-fold. Finally you add dissolved oxygen, aerate the tank, and check that the oxygen supplied matches the oxygen requirement of Module 11, Section 4.
| Stage | What changes | What to look for | Saved as |
|---|---|---|---|
| 1 | aeration tank, no recycle (chemostat) | steady S = 43.8 mg/L, X = 99.5 mg/L at θ = 0.25 d | M11_stage1_chemostat.ohq |
| 2 | + clarifier, return sludge, waste sludge | SRT ≈ 8 d: S ≈ 0.85 mg/L, X ≈ 1950 mg/L | M11_stage2_recycle.ohq |
| 3 | + dissolved oxygen and aeration | DO ≈ 2.1 mg/L; O₂ supplied ≈ Q(S₀ − S) − 1.42PX ≈ 840 kg/d | M11_stage3_oxygen.ohq |
The system
| Item | Value |
|---|---|
| Aeration tank | \(V = 1000\) m³, completely mixed; influent \(Q = 4000\) m³/d at \(S_0 = 300\) g bCOD/m³ (HRT \(\theta = 0.25\) d = 6 h) |
| Kinetics (Module 11, Section 1) | \(\hat\mu = 6\) d⁻¹, \(K_s = 20\) g/m³, \(Y = 0.4\) g VSS/g bCOD, \(b = 0.12\) d⁻¹ |
| Clarifier (Stages 2–3) | upper compartment 50 m³, lower 2 m³, interface area 1000 m², biomass settling velocity 3000 m/d (an almost ideal clarifier) |
| Flows (Stages 2–3) | tank → clarifier 6000 m³/d; return sludge \(Q_r = 2000\) m³/d (\(R = 0.5\)); waste sludge \(Q_w = 40\) m³/d; effluent 3960 m³/d |
| Oxygen (Stage 3) | \(K_La = 120\) d⁻¹ in the aeration tank only, \(DO_{sat} = 9.09\) g/m³ (20 °C), \(K_O = 0.2\) g/m³ |
| Simulation | 0 to 10 days (Stage 1), 0 to 60 days (Stages 2–3) |
OpenHydroQual writes, for every block and constituent, the mass balance of Module 1 plus the reaction terms you define. A reaction you define runs in every block that contains its constituents: in the aeration tank, the clarifier compartments and the sinks. That matters in Stage 3.
Build: 1 Plugins 2 Constituents 3 Reactions 4 Aeration tank 5 Effluent 6 Settings
Stages: 1 Chemostat 2 Recycle and wasting 3 Oxygen Checkpoints Explore Troubleshooting What to submit
1Load two plugins: Mass Transfer and Wastewater
Start a new model and add the Mass Transfer plugin as in Module 1, Step 1. Then add a second plugin, Wastewater, the same way (the list calls it Wastewater processes): it provides the Clarifier block and the Effluent flow and Sludge flow links used in Stage 2.


2Two constituents: substrate S and biomass X
Create the substrate as a Chemical constituent (Add Objects → Chemistry, as in Module 1, Step 2) and name it S. Then create the biomass as a Solid Particle: a particle constituent has a settling velocity, so the clarifier of Stage 2 can settle it. In Stage 1 there is no clarifier and the particle simply flows with the water.
Why such a large settling velocity?
3Reaction parameters and the two reactions
As in Modules 2 and 10, the kinetics go in Reaction Parameters and Chemical reactions. Create four reaction parameters (Add Objects → Chemistry → Reaction Parameter) and set their Value:
Now two reactions (Add Objects → Chemistry → Chemical reaction). A reaction has a rate expression and one stoichiometric constant per constituent: the change in that constituent per unit of rate. We write both rates in units of biomass (g VSS/m³/d), so X has the constant +1 or −1:
| Reaction | Rate Expression | S:Stoichiometric Constant | X:Stoichiometric Constant | Meaning |
|---|---|---|---|---|
| Growth | mu_max*S/(K_s+S)*X | (0-1/Y) | 1 | each g of cells grown uses 1/Y = 2.5 g bCOD |
| Decay | b*X | 0 | -1 | cells lose mass at rate bX |

(0-1/Y), 2 X:Stoichiometric Constant 1, 3 Name, 4 Rate Expression.
b*X. S:Stoichiometric Constant stays 0.Write a negative expression as (0-1/Y); a plain negative number can be typed directly (−1, −1.42).
4The aeration tank: a Reactor with an inflow
Add a Reactor (Module 1, Step 3) and set:
| Property | Value | Meaning | |
|---|---|---|---|
| 1 | S:Concentration | 0 | initial substrate |
| 2 | S:Constant Inflow concentration | 300 g/m³ | \(S_0\) |
| 3 | Initial Storage | 1000 m³ | \(V\) |
| 4 | X:Concentration | 100 g/m³ | initial biomass (a seed; any value above zero works) |
| 5 | Constant Inflow | 4000 m³/day | \(Q\) |
| 6 | Name | Aeration |
Leave X:Constant Inflow concentration at 0: there is no biomass in the influent, as the formulas assume. Leave Bottom elevation at 0.
5Effluent: a large Reactor and a Fixed flow
Add a second Reactor named Effluent with Initial Storage 1e+06 m³ (a sink, as the Outlet in Module 1) and Bottom elevation −10 m. Draw a Fixed flow link from Aeration to Effluent with Flow rate 4000 m³/day.
Why a bottom elevation for the sink?
6Simulation time and time step
As in Module 1, Step 6: General Settings → Simulation end time 10 (days); Solver Settings → initial time-step 0.01 and Maximum allowable time-step increase factor 5.

Stage 1A chemostat
Save as M11_stage1_chemostat.ohq, close and press Run Model.

Predict the answer first (Module 11, Example 11a): with \(\theta = 0.25\) d,
\[ S = \frac{20(1 + 0.12\times0.25)}{0.25(6 - 0.12) - 1} = 43.8\ \text{g/m}^3, \qquad X = \frac{0.4(300 - 43.8)}{1 + 0.12\times0.25} = 99.5\ \text{g/m}^3. \]
Stage 2Clarifier, return sludge and waste sludge
Save a copy as M11_stage2_recycle.ohq. Delete the link Aeration → Effluent (select it, press Delete). Change the Aeration tank's X:Concentration to 1500 g/m³ (a closer starting point, so the run is shorter) and the end time to 60 days.
2a · The clarifier
Click the Clarifier icon in the Blocks toolbar (it appears once the Wastewater plugin is loaded). The Clarifier is a composite block: it creates two settling compartments, Upper and Lower, joined by an interface through which the biomass settles and the underflow passes. On the canvas it is a single Clarifier icon; the Object Browser lists its members Clarifier__Lower, Clarifier__Upper and Clarifier__interface.


| Property | Value | Meaning | |
|---|---|---|---|
| 1 | Elevation of the clarifier floor | −1 m | bottom of the lower compartment |
| 2 | Elevation of the interface between the two compartments | 0 m | bottom of the upper compartment |
| 3 | Initial volume of water in the lower compartment | 2 m³ | kept small: biomass held here also reacts |
| 4 | Name | Clarifier | |
| 5 | Cross-sectional area of the compartment interface | 1000 m² | plan area over which solids settle |
| 6 | Flow drawn from the upper into the lower compartment | 2040 m³/day | underflow = \(Q_r + Q_w\) |
| 7 | Initial volume of water in the upper compartment | 50 m³ |
Add a third large Reactor, Waste (1e+06 m³, bottom elevation −10 m), below the Effluent sink.
2b · Four links
The Wastewater plugin adds two link types that behave like a Fixed flow but attach to the right compartment: an Effluent flow leaves the upper compartment and a Sludge flow leaves the lower one. Draw:

| Link | Type | From → To | Flow rate (m³/day) |
|---|---|---|---|
| Aeration - Clarifier | Fixed flow | Aeration → Clarifier | 6000 (\(Q + Q_r\)) |
| Effluent | Effluent flow | Clarifier → Effluent | 3960 (\(Q - Q_w\)) |
| Return sludge | Sludge flow | Clarifier → Aeration | 2000 (\(Q_r\)) |
| Waste sludge | Sludge flow | Clarifier → Waste | 40 (\(Q_w\)) |
Check the water balance before you run: the aeration tank gets 4000 + 2000 and sends 6000; the clarifier gets 6000 and sends 3960 + 2000 + 40. Predict the SRT for an ideal clarifier (\(X_e = 0\)) with Module 11, Section 3:
\[ X_r = X\frac{Q + Q_r}{Q_r + Q_w} = 2.94X, \qquad \theta_x = \frac{VX}{Q_wX_r} = \frac{1000}{40 \times 2.94} = 8.5\ \text{d}. \]
2c · Compute the actual SRT from your results
Effluent solids are wasting too. With your day-60 values of X, \(X_r\) and \(X_e\):
\[ \theta_x = \frac{VX}{Q_wX_r + (Q - Q_w)X_e} = \frac{1000(1945)}{40(5713) + 3960(3.88)} = 8.0\ \text{d}. \]Now compute S and X with the Lawrence–McCarty equations at \(\theta_x = 8.0\) d and compare with the model (Checkpoints).
Stage 3Dissolved oxygen and aeration
Save a copy as M11_stage3_oxygen.ohq.
3a · A new constituent and an aeration source
Add DO, a Chemical constituent (dissolved oxygen, g/m³). Then add the aeration itself as a source, the same one you used for gas transfer in Module 7: Add Objects → Sources → Atmospheric Exchange. Rename it Diffusers and set Rate coefficient 120 1/day (\(K_La\)) and Saturation Concentration Level 9.09 g/m³ (\(DO_{sat}\) at 20 °C). A source acts only in the blocks that name it, so the clarifier and the sinks stay unaerated.
3b · Parameters and reactions
Add one reaction parameter, K_O = 0.2. Then edit the two reactions:
| Reaction | Rate Expression | S | X | DO |
|---|---|---|---|---|
| Growth | mu_max*S/(K_s+S)*DO/(K_O+DO)*X | (0-1/Y) | 1 | (1.42-1/Y) |
| Decay | b*DO/(K_O+DO)*X | 0 | -1 | -1.42 |
The DO coefficients are the oxygen bookkeeping of Module 11, Section 4: growing 1 g of cells consumes \(1/Y = 2.5\) g bCOD, of which 1.42 g ends up in the cells, so \(2.5 - 1.42 = 1.08\) g O₂ is used; decaying 1 g of cells uses 1.42 g O₂. The factor \(DO/(K_O + DO)\) slows both reactions when oxygen runs low, which is what keeps DO from going negative in the clarifier, where there is no aeration.

(1.42-1/Y), 2 Rate Expression with the oxygen factor.3c · Aerate the aeration tank
Predict before you run. The oxygen requirement at \(\theta_x = 8\) d is about \(Q(S_0 - S) - 1.42P_X \approx 1197 - 1.42(250) \approx 840\) kg O₂/d, and \(K_La = 120\) d⁻¹ supplies \(120 \times 1000 \times (9.09 - DO)\) g/d, so DO should settle near \(9.09 - 840{,}000/120{,}000 = 2.1\) g/m³.
Check the oxygen balance with your day-60 results: the oxygen transferred is \(K_LaV(DO_{sat} - DO)\), and with \(P_X = Q_wX_r + (Q - Q_w)X_e\) the requirement is \(Q(S_0 - S) - 1.42P_X\). Then check S and X: at DO = 2.07 the oxygen factor is \(f = 2.07/2.27 = 0.912\), so use \(f\hat\mu\) and \(fb\) in the Lawrence–McCarty equations.
Checkpoints
Read these from your own runs; small differences in the last digit are normal. The formulas assume no reaction in the clarifier; the model's small clarifier holds about 1 % of the biomass, which explains the remaining 0.5 % differences.
| Stage | Quantity | Model | Formula |
|---|---|---|---|
| 1 | Aeration S at 1 / 2 / 10 days (g/m³) | 45.04 / 43.86 / 43.83 | 43.83 (steady) |
| 1 | Aeration X at 1 / 2 / 10 days (g/m³) | 98.63 / 99.47 / 99.48 | 99.48 (steady) |
| 2 | X / Xr / Xe at 60 days (g/m³) | 1945 / 5713 / 3.88 | Xr/X: 2.937 (ideal 2.941) |
| 2 | SRT (d) | 8.02 (from the model's X, Xr, Xe) | 8.50 if Xe = 0 |
| 2 | Aeration S at 60 days (g/m³) | 0.854 | 0.850 at SRT = 8.02 d |
| 2 | Aeration X at 60 days (g/m³) | 1945 | 1957 at SRT = 8.02 d |
| 2 | Sludge production PX (kg VSS/d) | 243.9 | 243.9 |
| 3 | Aeration DO at 60 days (g/m³) | 2.07 | ≈ 2.1 (prediction) |
| 3 | Aeration S / X at 60 days (g/m³) | 0.898 / 2033 | 0.894 / 2045 (with f = 0.912) |
| 3 | O₂ transferred / required (kg/d) | 842.7 | 834.4 + 10.5 carried out as DO |
Explore
Save a copy with File → Save as and change one thing at a time.
- Washout. In Stage 1, raise the inflow and the link to 6000 m³/d (θ = 4 h, below θmin = 4.4 h). Plot X: it decays toward zero and S climbs back to 300 g/m³.
- The operator's knob. In Stage 2, double the waste flow to 80 m³/d (and lower the clarifier underflow to 2080 and the effluent to 3920). Predict the new SRT (about 4.2 d), S (about 1.3 g/m³) and X (about 1330 g/m³) before you run. Then halve it to 20 m³/d.
- A poor clarifier. In Stage 2, lower X's settling velocity to 300 m/d. Effluent solids rise to about 30 g/m³, and the SRT falls to about 5.2 d although you did not touch the waste flow. Which steady-state quantity changes most?
- Not enough air. In Stage 3, set the Diffusers' Rate coefficient (\(K_La\)) to 60 d⁻¹. How low does DO go, and why does the substrate rise only a little while the oxygen factor drops?
Troubleshooting
| No Clarifier icon, or no Effluent flow / Sludge flow links. | The Wastewater plugin is not loaded (Step 1). |
| X falls to zero in Stage 2. | X was created as a Chemical constituent instead of a Solid Particle, so it does not settle and the plant runs as a chemostat with a tiny HRT. Or the settling velocity is too small: the panel should show 0.0347222[m/s], which is 3000 m/day. |
| The clarifier fills up or empties. | Flows do not balance: the underflow must equal return + waste (2040), and the clarifier's inflow (6000) must equal effluent + underflow (3960 + 2040). |
| S and X look right but DO goes negative somewhere. | The oxygen factor \(DO/(K_O + DO)\) is missing from one of the rate expressions. |
| DO is far above 2 g/m³ in Stage 3. | Check the DO stoichiometric constants: growth (1.42-1/Y), decay -1.42. |
| The clarifier and sinks are aerated too. | Their DO:External source is set to Diffusers; only the aeration tank should name it. |
What to submit
- Your three
.ohqfiles. - Stage 1: plots of S and X with the steady-state formula values marked.
- Stage 2: plots of S, X and Xr; your day-60 values; the SRT computed from them; and the formula S and X at that SRT, with the percent difference.
- Stage 3: the DO plot; the oxygen balance (transferred vs. required) and the S and X check with the oxygen factor.
- Short answers (2–4 sentences each): (a) Why did adding recycle lower S fifty-fold without changing the tank volume or the flow? (b) In Stage 2, why is the actual SRT shorter than the 8.5 days predicted from the waste flow? (c) Your result for one Explore item, with a sentence explaining it.
Submit everything in one PDF plus the .ohq files in Brightspace → Assignments → Modeling Assignment M11.