What you will build
A 500 m³ aerated tank at 20 °C. First you run the clean-water test that engineers use to measure an aerator: start with low oxygen, switch the aeration on, and recover KLa from the curve. Then water flows through the tank and microbes consume oxygen, first at a constant rate and then by oxidizing the BOD that the inflow brings, and finally a solvent in the inflow is stripped by the same aerators. Gas transfer uses OpenHydroQual's Atmospheric Exchange source, which computes \(K_LaV(C_s - C)\).
| Stage | What changes | What to look for | Saved as |
|---|---|---|---|
| 1 | batch tank at 1.0 mg/L, aeration on | \(C = C_s - (C_s - C_0)e^{-K_Lat}\); recover \(K_La = 3\)/h | M7_stage1_reaeration.ohq |
| 2 | + flow through (τ = 6 h) and oxygen uptake 15 mg/L/h | \(C_{ss} = \dfrac{QC_{\text{in}} + K_LaVC_s - \text{OUR}\,V}{Q + K_LaV} = 3.93\) mg/L | M7_stage2_aerated_cstr.ohq |
| 2b | BOD in the inflow (150 mg/L) replaces the constant uptake; oxygen use \(k_B\,\text{BOD}\,\frac{DO}{K_O + DO}\) | DO 2.12 and BOD 25.6 mg/L at steady state (83 % of the BOD oxidized) | M7_stage2b_bod.ohq |
| 3 | + TCE in the inflow, stripped with \(\Psi = 0.6\) | \(C_{ss} = QC_{\text{in}}/(Q + \Psi K_LaV) = 8.5\) µg/L (91.5 % removed) | M7_stage3_stripping.ohq |
The system
| Item | Value |
|---|---|
| Tank | \(V = 500\) m³, completely mixed, 20 °C, 1 atm: \(C_s = 9.09\) mg/L |
| Aeration | \(K_La = 3\) per hour = 72 per day (OpenHydroQual works in days) |
| Flow (Stages 2–3) | \(Q = 2000\) m³/day (τ = 0.25 day = 6 h), inflow DO 1.0 mg/L |
| Oxygen uptake (Stages 2 and 3) | OUR = 15 mg/L/h = 360 g/m³/day, constant (zero order) |
| BOD (Stage 2b) | inflow BOD 150 mg/L; oxidation rate \(k_B\,\text{BOD}\,DO/(K_O + DO)\) with \(k_B = 24\) per day (1 per hour) and \(K_O = 0.5\) mg/L; 1 g O₂ per g BOD |
| TCE (Stage 3) | inflow 100 µg/L = 0.1 g/m³; \(K_La_{\text{TCE}} = \Psi K_La\) with \(\Psi = 0.6\) |
| Simulation | Stage 1: 0.1 day (2.4 h); Stages 2, 2b and 3: 1 day. Initial time step 0.0001 day (≈ 9 s) |
- M7_stage1_reaeration.ohq · M7_stage2_aerated_cstr.ohq · M7_stage2b_bod.ohq · M7_stage3_stripping.ohq
Build: 1 Plugin 2 Oxygen 3 Aeration source 4 What it computes 5 Tank 6 Settings
Stages: 1 Aeration test 2 Aerated CSTR 2b BOD 3 Stripping Checkpoints Explore Troubleshooting What to submit
1Load the Mass Transfer plugin
Start a new model and add Mass Transfer (File → Preferences → Add plugin), as in Module 1, Step 1.


2The constituent: Oxygen
Add a Chemical constituent and rename it Oxygen (Module 1, Step 2).
3Gas transfer: the Atmospheric Exchange source
The Mass Transfer plugin has a ready-made source for gas exchange with the air: Add Objects → Sources → Atmospheric Exchange. Add one, rename it Aeration, and give it values in days:
| Property | Value | Meaning |
|---|---|---|
| Rate coefficient | 72 1/day | \(K_La\), the volumetric transfer coefficient (3 per hour) |
| Saturation Concentration Level | 9.09 g/m³ | \(C_s\), DO saturation at 20 °C and 1 atm (Module 7, Section 2) |
4What the source computes
A source does nothing until a block uses it. In each block whose Oxygen:External source is set to Aeration, OpenHydroQual adds \(V K_La (C_s - C)\) g/day of oxygen, where \(V\) is the block's storage. Dividing by \(V\): \(dC/dt = K_La(C_s - C)\), the per-volume transfer rate of Module 7, Section 4. When the water is below saturation the rate is positive (oxygen enters); above saturation it is negative (oxygen leaves).
5The tank
Add a Reactor named Tank: Initial Storage 500 m³, Oxygen:Concentration 1 g/m³ (the deoxygenated start), Oxygen:External source = Aeration (this switches the aerators on: double-click the value cell of Oxygen:External source and pick Aeration from the drop-down list of the model's sources), Constant Inflow 0.
6Simulation time and time step
Aeration acts in minutes, so the time step must be much shorter than in earlier modules. General Settings: end time 0.1 day. Solver Settings: initial time-step 0.0001 day, maximum time-step increase factor 5.
Rule of thumb: the time step should be well below \(1/K_La = 20\) minutes. With 0.0001 day (9 s), rising to about 0.0005 day (43 s), the model is within 1 % of the formula after the first 15 minutes.
Stage 1A clean-water aeration test
Save as M7_stage1_reaeration.ohq, run, and plot Tank → Results → Oxygen:Concentration.


The formula \(C = 9.09 - 8.09\,e^{-3t}\) (t in hours) gives 6.11, 7.29 and 8.69 mg/L at 20, 30 and 60 minutes; the model gives 6.06, 7.24 and 8.67.
Now pretend you do not know \(K_La\). Export or read \(C\) every 10 minutes from 10 to 60 minutes, plot \(\ln[(C_s - C)/(C_s - C_0)]\) against \(t\) (hours), and fit a straight line (Module 7, Section 4). The model's points give a slope of −2.95 per hour, i.e. \(K_La = 2.95\)/h, within 2 % of the 3/h you entered (the small difference is the time step during the first minutes).
Stage 2Flow through the tank, and microbes that use oxygen
Save a copy as M7_stage2_aerated_cstr.ohq.
- Add a Reaction Parameter OUR = 360 (g/m³/day = 15 mg/L/h).
- Add a Chemical reaction O2 uptake: Oxygen stoichiometric constant −1, rate expression OUR (a zero-order rate, Module 2).
- Tank: Constant Inflow 2000 m³/day, Oxygen:Constant Inflow concentration 1 g/m³. Keep Oxygen:Concentration 1 (the starting value).
- Add a large Reactor Outlet (1e+06 m³) and a Fixed flow link from Tank to Outlet with 2000 m³/day (Module 1, Steps 4–5).
- End time 1 day. Save and run.


Predict first (Module 7, Section 4, all rates per day):
\[ C_{ss} = \frac{2000(1.0) + 72(500)(9.09) - 360(500)}{2000 + 72(500)} = \frac{29{,}240}{38{,}000} = 3.93\ \text{mg/L}, \qquad \lambda = \frac{Q}{V} + K_La = 4 + 72 = 76\ \text{per day}. \]
At steady state the aerators transfer \(K_La(C_s - C)V = 72(9.09 - 3.93)(500) = 185.9\) kg/day. The microbes use \(\text{OUR}\,V = 180\) kg/day, and the water leaves with \(Q(C - C_{\text{in}}) = 5.9\) kg/day more than it brought. In = out: 185.9 = 180 + 5.9.
Stage 2bMicrobes that oxidize the BOD in the inflow
In Stage 2 the microbes used oxygen at a fixed rate, whatever the oxygen level. Real microbes use oxygen to oxidize the organic matter (BOD) that the water brings in, and they slow down when oxygen runs short. Stage 2b replaces the constant uptake with exactly that:
\[ r = k_B\,\text{BOD}\,\frac{DO}{K_O + DO} \qquad (\text{g/m}^3\text{/day; 1 g O}_2\text{ used per g BOD oxidized}), \]first order in BOD (Module 2) times a Monod-type oxygen factor (Module 2, Section 6) that goes to zero as DO goes to zero.
Save a copy of Stage 2 as M7_stage2b_bod.ohq.
- Delete the O2 uptake reaction and the OUR parameter.
- Add a Chemical constituent named BOD.
- Add Reaction Parameters k_B = 24 (per day) and K_O = 0.5 (g/m³).
- Add a Chemical reaction BOD oxidation: BOD stoichiometric constant −1, Oxygen −1, rate expression k_B*BOD*Oxygen/(K_O+Oxygen).
- Tank: BOD:Constant Inflow concentration 150 g/m³; BOD:Concentration 0. Leave BOD:External source empty (aeration adds oxygen, not BOD). Save and run.
k_B*BOD*Oxygen/(K_O+Oxygen) (the GUI shows it wrapped in brackets).Predict first. At steady state two balances must hold at once, one for BOD and one for oxygen (\(f = DO/(K_O + DO)\), \(\tau = V/Q = 0.25\) day):
\[ \text{BOD} = \frac{\text{BOD}_{\text{in}}}{1 + k_Bf\tau}, \qquad Q(DO_{\text{in}} - DO) + K_LaV(C_s - DO) = k_Bf\,\text{BOD}\,V. \]They are coupled through \(f\), so solve them by trial (guess DO, compute \(f\) and BOD, check the oxygen balance) or with Goal Seek: DO = 2.12 mg/L and BOD = 25.6 mg/L.
Comparing curves is easier on a single panel. Open the first curve (right-click Tank → Results → Oxygen:Concentration) and keep that plot window open. Open the second curve (BOD:Concentration) in its own plot window, right-click its chart → Copy curve, then right-click the chart of the first window → Paste. The pasted curve gets its own colour and legend entry and the axes rescale; close the second window and repeat for more curves. (In a window that already holds several curves the item reads Copy Curves and copies all of them.)

OpenHydroQual keeps the copied curve, and the open plot windows, when you open another file, so this works across models: keep the Stage 2b DO plot open, open the Stage 2 file, plot its DO, Copy curve, and Paste it into the Stage 2b window to see what the BOD load changes. You do not need to rerun a model to plot it again: every run saves all results to output.txt in the model's folder. Open the model, choose Model → Load Results, pick output.txt and click OK at "Output file loaded successfully!"; Results → … then works as after a run. The next run in the same folder overwrites output.txt, so rename it (for example output_stage2.txt) if you want to keep it.
Stage 3Stripping a solvent
The system
Go back to the Stage 2 tank (constant oxygen uptake). Suppose the water it treats is contaminated with trichloroethylene (TCE), a volatile industrial solvent, at 100 µg/L. TCE is not biodegraded here, but it is volatile: the air bubbles that dissolve oxygen also pick TCE up and carry it to the atmosphere. This is stripping (Module 7, Section 5). The air contains essentially no TCE, so its saturation level is 0 and the transfer only goes one way, out of the water.
Why the TCE concentration rises with time. At the start the tank is full of clean water (TCE = 0). TCE enters with the inflow at \(QC_{\text{in}} = 200\) g/day. It leaves in two ways, with the outflow (\(QC\)) and to the air (\(K_La_{\text{TCE}}VC\)), and both grow with the tank concentration \(C\). So \(C\) climbs until the two losses together equal what comes in, and then stays there. The steady value is far below the inflow concentration because the stripping loss is large.
Save a copy of Stage 2 as M7_stage3_stripping.ohq.
- Add a Chemical constituent named TCE.
- Add a second Atmospheric Exchange source named Stripping: Rate coefficient \(K_La_{\text{TCE}} = \Psi K_La = 0.6 \times 72 =\) 43.2 1/day and Saturation Concentration Level 0 (the air holds no TCE). It computes \(VK_La_{\text{TCE}}(0 - C)\): TCE only leaves.
- Tank: TCE:Constant Inflow concentration 0.1 g/m³; TCE:Concentration 0; TCE:External source = Stripping.
- Check that the O2 uptake reaction has TCE stoichiometric constant 0. Save and run.
The model gives 8.47 µg/L. The air above the tank receives \(K_La_{\text{TCE}}CV = 183\) g of TCE per day, out of 200 g/day entering: removal from the water is mostly transfer to the atmosphere, not destruction.
Checkpoints
Read these from your own runs; small differences in the last digit are normal. The model lags slightly (by up to 1 %) during the first ~30 minutes because of the time step.
| Stage | Quantity | Model | Formula |
|---|---|---|---|
| 1 | DO at 20 / 30 / 60 / 120 min (mg/L) | 6.06 / 7.24 / 8.67 / 9.07 | 6.11 / 7.29 / 8.69 / 9.07 |
| 1 | KLa from the ln-deficit regression, 10–60 min | 2.95 per hour | 3.0 per hour |
| 2 | DO at 10 / 30 / 60 min (mg/L) | 2.18 / 3.31 / 3.80 | 2.20 / 3.33 / 3.80 |
| 2 | Steady-state DO (mg/L) | 3.927 | 3.927 |
| 2 | O₂ transferred at steady state (kg/day) | 185.9 (= 180 used + 5.9 leaving with the water) | |
| 2b | DO / BOD at 0.1 day (mg/L) | 2.95 / 22.0 | approaching steady state |
| 2b | Steady-state DO / BOD (mg/L); BOD oxidized | 2.118 / 25.62; 82.9 % | 2.118 / 25.62; 82.9 % (the two balances) |
| 2b | O₂ used at steady state (kg/day) | 248.8 | |
| 3 | TCE at 30 / 60 / 120 min (µg/L) | 5.27 / 7.26 / 8.30 | 5.31 / 7.29 / 8.31 |
| 3 | Steady-state TCE (µg/L); removal | 8.47; 91.5 % | 8.47; 91.5 % |
Explore
- A summer day. At 28 °C, \(C_s = 7.83\) mg/L (Module 7, Section 2). Change the Aeration source's Saturation Concentration Level in Stage 2 and predict the new steady DO before you run. What KLa would keep 2 mg/L?
- Overloaded tank. In Stage 2, raise OUR until the formula gives a negative DO. What does the model do? (A zero-order uptake cannot stop by itself: the model goes negative.) Then in Stage 2b raise the inflow BOD to 200 mg/L: DO falls to about 0.6 mg/L and only 77 % of the BOD is oxidized. Why does DO not go negative there?
- A less volatile compound. For a compound with low Hcc the gas film matters and Ψ is much smaller. Set Ψ = 0.05 (Stripping Rate coefficient 0.05 × 72 = 3.6 1/day) and find the removal. Compare with the formula \(1/(1 + \Psi K_La\tau)\).
- A river reach. Use the tank as a 1 km river reach 1.5 m deep with \(K_2 = 1.17\) per day (Module 7, Example 4c) and no OUR: how long does a slug of water at 4 mg/L take to recover to 8 mg/L?
Troubleshooting
| DO stays at 1.0. | The Tank's Oxygen:External source is not set to Aeration. |
| DO jumps to 9.09 almost at once. | KLa was entered as 72 per hour thinking of days, or the parameter is per day but the value is 1728. In OpenHydroQual all rates are per day: 3/h = 72/day. |
| DO falls below zero (Stage 2). | OUR is larger than the aerators can supply (or entered in mg/L/h as 15 instead of 360 per day, which would make it too small). Check the formula. |
| The curve is jagged or overshoots. | The time step is too long: initial time-step 0.0001 day and factor 5. |
| TCE does not decrease below the inflow value. | The Tank's TCE:External source must be Stripping (Saturation 0). |
| The tank empties. | The link flow must equal the inflow, 2000 m³/day. |
What to submit
- Your four
.ohqfiles. - Stage 1: the DO curve with the formula, and your ln-deficit regression with the fitted KLa.
- Stage 2: the DO curve with the steady-state value marked; the oxygen balance at steady state.
- Stage 2b: DO and BOD on one plot (copy and paste the curves into one panel); check the steady state against the two mass balances.
- Stage 3: the TCE curve with the formula; the mass of TCE sent to the air per day.
- Short answers (2–4 sentences each): (a) Why does the DO in Stage 2 settle in about an hour although the residence time is 6 hours? (b) What KLa would hold 2.0 mg/L in Stage 2, and how much TCE would then be removed? (c) Is stripping a treatment process for TCE in the sense of destroying it? (d) Your result for one Explore item.
Submit everything in one PDF plus the .ohq files in Brightspace → Assignments → Modeling Assignment M7.