← Module 7 · Modeling Assignment M7 (OpenHydroQual)

An aerated tank: reaeration, oxygen uptake and VOC stripping

An illustrated, step-by-step worked example · about 45 minutes · the latest OpenHydroQual · uses Module 7, Sections 2, 4 and 5 (DO saturation, KLa, the aerated CSTR, stripping) and the CSTR of Module 4

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)\).

StageWhat changesWhat to look forSaved as
1batch tank at 1.0 mg/L, aeration on\(C = C_s - (C_s - C_0)e^{-K_Lat}\); recover \(K_La = 3\)/hM7_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/LM7_stage2_aerated_cstr.ohq
2bBOD 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

ItemValue
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\)
SimulationStage 1: 0.1 day (2.4 h); Stages 2, 2b and 3: 1 day. Initial time step 0.0001 day (≈ 9 s)

1Load the Mass Transfer plugin

Start a new model and add Mass Transfer (File → Preferences → Add plugin), as in Module 1, Step 1.

File menu: Preferences, Add plugin
1 File → 2 Preferences → 3 Add plugin.
Select Plugin: Mass Transfer
1 Mass Transfer, 2 OK.

2The constituent: Oxygen

Add a Chemical constituent and rename it Oxygen (Module 1, Step 2).

Add Objects, Chemistry menu
1 Add Objects → 2 Chemistry → 3 Chemical constituent. Reaction Parameter and Chemical reaction (Stage 2) are in the same menu.
Constituent renamed Oxygen
1 Name Oxygen.

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:

Atmospheric Exchange source named Aeration
1 Add Objects → Sources → Atmospheric Exchange; 2 Name Aeration, 3 Rate coefficient 72 [1/day], 4 Saturation Concentration Level 9.09 [g/m³]. The new source appears in the Object Browser under Sources.
PropertyValueMeaning
Rate coefficient72 1/day\(K_La\), the volumetric transfer coefficient (3 per hour)
Saturation Concentration Level9.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.

Tank properties for the aeration test
1 Oxygen:Concentration 1; 2 Oxygen:External source Aeration; 3 Initial Storage 500; 4 Constant Inflow 0; 5 Name Tank.

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.

Solver settings with initial time step 0.0001
1 Initial time-step 0.0001; 2 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.

Run Model button
1 Run Model.
Running Model window
Close it at Finished!
DO rising toward saturation
DO rises from 1.0 toward 9.09 mg/L: 6.2 mg/L after 20 minutes, 8.7 after an hour (time axis in days: 0.0139 day = 20 min).
Check it, and recover KLa as an engineer would

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.

  1. Add a Reaction Parameter OUR = 360 (g/m³/day = 15 mg/L/h).
  2. Add a Chemical reaction O2 uptake: Oxygen stoichiometric constant −1, rate expression OUR (a zero-order rate, Module 2).
  3. Tank: Constant Inflow 2000 m³/day, Oxygen:Constant Inflow concentration 1 g/m³. Keep Oxygen:Concentration 1 (the starting value).
  4. 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).
  5. End time 1 day. Save and run.
Fixed flow icon
1 Fixed flow.
O2 uptake reaction
1 Oxygen:Stoichiometric Constant −1; 2 Name O2 uptake; 3 Rate Expression OUR.
Tank, link and Outlet
1 Tank (inflow 2000 m³/day at 1 mg/L), 2 the link Tank → Outlet, 2000 m³/day, 3 Outlet.

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}. \]
DO in the aerated CSTR
DO settles at 3.93 mg/L within about an hour (95 % at \(\ln 20/76 = 0.039\) day = 57 min). Aeration, not the 6 h residence time, sets the speed.
Check the oxygen balance

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.

  1. Delete the O2 uptake reaction and the OUR parameter.
  2. Add a Chemical constituent named BOD.
  3. Add Reaction Parameters k_B = 24 (per day) and K_O = 0.5 (g/m³).
  4. Add a Chemical reaction BOD oxidation: BOD stoichiometric constant −1, Oxygen −1, rate expression k_B*BOD*Oxygen/(K_O+Oxygen).
  5. Tank: BOD:Constant Inflow concentration 150 g/m³; BOD:Concentration 0. Leave BOD:External source empty (aeration adds oxygen, not BOD). Save and run.
BOD oxidation reaction
The BOD oxidation reaction: 1 BOD:Stoichiometric Constant −1; 2 Oxygen:Stoichiometric Constant −1; 3 Name BOD oxidation; 4 Rate Expression 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.

DO and BOD in the tank on one plot
DO and BOD in the Tank on one panel (Oxygen:Concentration plotted, BOD:Concentration pasted into the same plot window). BOD rises from 0 to 25.6 mg/L as the inflow brings it in. DO starts at 1 mg/L and first climbs to about 5.6 mg/L within the first half hour, while there is still little BOD to oxidize and aeration wins; as the BOD builds up its oxidation pulls DO back down, and it settles at 2.12 mg/L. Both are steady after about 0.3 day.
Put several curves on one plot: copy and paste

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.)

Right-click menu of a plot window: Copy curve and Paste
The right-click menu of a plot window: 1 Copy curve in the window you copy from, 2 Paste in the window that collects the curves (greyed out until something has been copied).

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.

Tank, V = 500 m³ completely mixed: C_TCE, DO air bubbles from the diffusers inflow Q = 2000 m³/d TCE 100 µg/L, DO 1 mg/L outflow Q, at the tank concentrations TCE to the air: K_La,TCE V C O₂ from the air: K_La V (C_s − DO)
Stage 3: one aerated tank. Water carrying TCE flows in and out; the same bubbles that dissolve oxygen carry TCE out to the atmosphere.

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.

  1. Add a Chemical constituent named TCE.
  2. 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.
  3. Tank: TCE:Constant Inflow concentration 0.1 g/m³; TCE:Concentration 0; TCE:External source = Stripping.
  4. Check that the O2 uptake reaction has TCE stoichiometric constant 0. Save and run.
Stripping source and the Tank's TCE External source
1 Source Stripping: Rate coefficient 43.2 [1/day] and Saturation Concentration Level 0; 2 Tank: TCE:External source Stripping (picked from the same drop-down list). In the Tank panel the TCE rows follow Initial Storage.
TCE in the tank
TCE in the tank (and so in the effluent) rises to 0.0085 g/m³ = 8.5 µg/L: 91.5 % of what enters is stripped. The DO curve is unchanged from Stage 2.
Check it by hand \[ K_La_{\text{TCE}} = 0.6 \times 72 = 43.2\ \text{per day}, \qquad C_{ss} = \frac{QC_{\text{in}}}{Q + K_La_{\text{TCE}}V} = \frac{2000(100)}{2000 + 43.2(500)} = 8.47\ \mu\text{g/L} \]

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.

The three stages against the formulas
The three stages from headless runs (solid) against the Module 7 formulas (dashed).

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.

StageQuantityModelFormula
1DO at 20 / 30 / 60 / 120 min (mg/L)6.06 / 7.24 / 8.67 / 9.076.11 / 7.29 / 8.69 / 9.07
1KLa from the ln-deficit regression, 10–60 min2.95 per hour3.0 per hour
2DO at 10 / 30 / 60 min (mg/L)2.18 / 3.31 / 3.802.20 / 3.33 / 3.80
2Steady-state DO (mg/L)3.9273.927
2O₂ transferred at steady state (kg/day)185.9 (= 180 used + 5.9 leaving with the water)
2bDO / BOD at 0.1 day (mg/L)2.95 / 22.0approaching steady state
2bSteady-state DO / BOD (mg/L); BOD oxidized2.118 / 25.62; 82.9 %2.118 / 25.62; 82.9 % (the two balances)
2bO₂ used at steady state (kg/day)248.8
3TCE at 30 / 60 / 120 min (µg/L)5.27 / 7.26 / 8.305.31 / 7.29 / 8.31
3Steady-state TCE (µg/L); removal8.47; 91.5 %8.47; 91.5 %

Explore

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