What you will build
The biofilm biomass is an Immobile constituent: it stays in the block where you put it while water and dissolved substances flow through, and it grows by reacting with the mobile substrate and oxygen. You use it three ways: as the biomass of a completely mixed biofilm reactor, as the fixed biomass in ten thin layers of a biofilm, and as the growing film in ten segments of a trickling filter.
| Stage | What it is | What to look for | Saved as |
|---|---|---|---|
| 1 | a mixed reactor with media; thin biofilm B with Monod kinetics, decay, detachment, aeration | S falls to Smin = 0.288 mg/L; B → 173 g/m³ | M12_stage1_biofilm_reactor.ohq |
| 2 | a 200 µm biofilm split into 10 layers under a 100 µm boundary layer, exchanging substrate by diffusion only | the cosh profile; J = 0.641 g/(m²·d), Ss = 0.359 mg/L | M12_stage2_inside_biofilm.ohq |
| 3 | a 6 m trickling filter as 10 biofilm segments in series, flux-based removal a·kf·S | Se = 24.2 mg/L (tanks in series); biofilm thickest at the top | M12_stage3_trickling_filter.ohq |
The system
| Item | Value |
|---|---|
| Kinetics (all stages) | \(\hat q = 10\) d⁻¹, \(K_s = 10\) g/m³, \(Y = 0.5\), \(b = 0.10\) d⁻¹, \(b_{det} = 0.04\) d⁻¹; \(DO_{sat} = 9.09\) g/m³ |
| Stage 1 reactor | \(V = 100\) m³, \(Q = 500\) m³/d, \(S_0 = 10\) g/m³, \(K_La = 10\) d⁻¹; biofilm seed 1 g/m³ |
| Stage 2 biofilm | \(L_f = 200\) µm in 10 layers of 20 µm, \(X_f = 40{,}000\) g/m³, \(D_f = 0.8\) cm²/d; boundary layer 100 µm with \(D = 1.0\) cm²/d; bulk at \(S_b = 1\) g/m³ |
| Stage 3 filter | depth 6 m, plan area 50 m², \(a = 100\) m²/m³, \(k_f = 0.10\) m/d, \(Q = 1500\) m³/d at \(S_0 = 150\) g/m³; ventilation \(K_La = 300\) d⁻¹ |
Build: 1 Plugin 2 Constituents 3 Reactions 4 Reactor 5 Effluent 6 Settings
Stages: 1 Biofilm reactor 2 Inside a biofilm 3 Trickling filter Checkpoints Explore Troubleshooting What to submit
1Load the Mass Transfer plugin
Start a new model and add the Mass Transfer plugin (Module 1, Step 1). It provides the Reactor, the Fixed flow and Time-Dependent flow links, and the Immobile constituent.


2Four constituents, one of them immobile
Create three Chemical constituents (Module 1, Step 2): S (substrate), DO (dissolved oxygen) and Xd (detached biofilm, carried away by the water). Then create the biofilm biomass B as an Immobile constituent (per volume of water) from the same Add Objects → Chemistry menu.
3Reaction parameters, three reactions and an aeration source
Create the reaction parameters (Add Objects → Chemistry → Reaction Parameter, as in Modules 10–11): qhat = 10, K_s = 10, Y = 0.5, b = 0.1, b_det = 0.04. Then three Chemical reactions. All rates are per m³ of the block; the stoichiometric constants are the change in each constituent per unit of rate:
| Reaction | Rate Expression | S | B | DO | Xd | Meaning |
|---|---|---|---|---|---|---|
| Utilization | qhat*S/(K_s+S)*B | -1 | Y | (1.42*Y-1) | 0 | the biofilm uses S and grows; oxygen takes the electrons not built into cells |
| Decay | b*B | 0 | -1 | -1.42 | 0 | endogenous respiration (Module 11) |
| Detachment | b_det*B | 0 | -1 | 0 | 1 | shear turns attached biomass into suspended solids |

Y, 2 DO (1.42*Y-1), 3 S −1, 4 Rate Expression.
b_det*B.Here the rate of Utilization is written in units of substrate, so S has −1 and B has +Y (in Module 11 it was written per unit of biomass; both work). Type −1.42 as a number, not as (0-1.42) (Module 11, Stage 3).
Oxygen transfer is a source, as in Modules 7 and 11: Add Objects → Sources → Atmospheric Exchange, named Aeration, with Rate coefficient 10 1/day (\(K_La\)) and Saturation Concentration Level 9.09 g/m³ (\(DO_{sat}\)). It adds \(VK_La(DO_{sat} - DO)\) g/day to each block whose DO:External source names it. In Step 4 you will set it on the Biofilm reactor only.
4The biofilm reactor
Add a Reactor named Biofilm reactor. Think of it as a tank packed with plastic media that the water flows through; the media's biofilm is B.

| Property | Value | Meaning | |
|---|---|---|---|
| 1 | B:Concentration per volume of water | 1 g/m³ | a seed of biofilm (with 0 it could never grow) |
| 2 | DO:Concentration | 9.09 g/m³ | starts saturated |
| 2 | DO:External source | Aeration | oxygen transfer, \(VK_La(DO_{sat} - DO)\); double-click the value cell and pick Aeration |
| 3 | S:Constant Inflow concentration | 10 g/m³ | \(S_0\) |
| 4 | Initial Storage | 100 m³ | \(V\) |
| 5 | Constant Inflow | 500 m³/day | \(Q\) |
| 6 | Name | Biofilm reactor |
5The effluent
Add a Reactor Effluent with Initial Storage 1e+06 m³ and a Fixed flow link Biofilm reactor → Effluent of 500 m³/day (Module 1, Steps 4–5). The water, S, DO and Xd flow through the link; B does not.
6Simulation time and time step
Simulation end time 60 days; initial time-step 0.01 and maximum time-step increase factor 5 (Module 1, Step 6).

Stage 1A biofilm reactor reaches Smin
Save as M12_stage1_biofilm_reactor.ohq and run (Run Model, Module 1). Predict first with Module 12, Section 4: the film is thin, so

Check the oxygen with a COD balance (Module 11, Section 4): the bCOD removed, \(Q(S_0 - S) = 4856\) g/d, either leaves as detached biomass, \(1.42QX_d = 985\) g/d, or is passed to oxygen, 3871 g/d. The aeration supplies \(K_LaV(DO_{sat} - DO)\), which must equal the oxygen used plus the DO carried out, \(Q\cdot DO\).
Stage 2Inside a biofilm: diffusion and reaction
Start a new model (Mass Transfer plugin) and save it as M12_stage2_inside_biofilm.ohq. Here the biofilm itself is split into 10 layers, each a Reactor, and substrate moves between them only by diffusion.
2a · A diffusing substrate and a fixed biofilm
- Chemical constituent S with Diffusion Coefficient 8e-05 m²/day (choose m^2/day in the unit box first; it equals \(D_f = 0.8\) cm²/d). The panel then shows the value converted to m²/s, 9.25926e-10.
- Immobile constituent Xf: the biofilm density, held fixed in this stage so the result can be compared with the cosh solution.
- Reaction parameters qhat = 10, K_s = 10, and one reaction Utilization: rate
qhat/K_s*Xf*S(first order, \(k_1S\) with \(k_1 = \hat qX_f/K_s\)), S −1, Xf 0.
2b · The bulk liquid
Add a Reactor Bulk with Initial Storage 1e+08 m³ and S:Concentration 1. It is so large that the biofilm hardly changes it: a bulk liquid held at \(S_b = 1\) g/m³.
2c · Ten layers with the Array Generator
Open Add Objects → Create 2D Array (Module 5, Step 3) and generate a row of 10 × 1 Reactors joined by Time-Dependent flow links. A Time-Dependent flow link with no flow time series carries no water, only diffusion: \(D\cdot\text{area}/\text{length}\cdot(C_1 - C_2)\).
Why 0.2 m³ layers and 10,000 m² of biofilm?
2d · The boundary layer
Draw one more Time-Dependent flow link from Bulk to Layer(1:1) with area 10000 m² and length 9e-05 m.
2e · Run and compare
Predict with Module 12, Example 12c: \(J = 0.641\) g/(m²·d), \(S_s = 0.359\) g/m³, and inside the film \(S(z) = S_s\cosh((L_f - z)/\tau)/\cosh\varphi\), \(\tau = 44.7\) µm, \(\varphi = 4.47\).
The flux is the boundary-layer link's S:Mass transfer rate divided by the area: 6357 g/d ÷ 10,000 m² = 0.636 g/(m²·d), within 1 % of 0.641. The small difference is the layering: ten layers per 200 µm approximate the smooth curve.
Stage 3A trickling filter
Open your Stage 1 model and save it as M12_stage3_trickling_filter.ohq. It already has S, DO, Xd, B, the three reactions and the Aeration source.
3a · From thin to deep: change the Utilization rate
A trickling filter's biofilm is deep (Module 12, Section 5): its flux is \(J = k_fS\) per m² of film, whatever its thickness. With \(a\) m² of film per m³ of filter, the removal per m³ is \(a\,k_f\,S\). Add reaction parameters a_v = 100 (m²/m³) and k_f = 0.1 (m/d), set the Aeration source's Rate coefficient to 300 1/day (the ventilation), and change only the Utilization rate expression:
a_v*k_f*S. The stoichiometry is unchanged: the biofilm B still grows with yield Y from the substrate it removes.3b · Ten filter segments
Delete the Biofilm reactor (the Effluent stays). Use Create 2D Array again: 10 × 1 Reactors named Filter, Initial Storage 30 m³ (6 m × 50 m² / 10), all concentrations 0, DO:External source Aeration, joined by Fixed flow links of 1500 m³/day.
Give Filter(1:1) the influent: Constant Inflow 1500 m³/day and S:Constant Inflow concentration 150. Draw a Fixed flow of 1500 m³/day from Filter(10:1) to Effluent and raise the Effluent's storage to 1e+07 m³. Set the end time to 80 days.
Storage is the filter volume, not the water volume. Does that matter?
3c · Run and compare
Predict with Module 12, Section 5: each segment is a mixed tank with \(k\tau = a\,k_fV_{seg}/Q = 10(30)/1500 = 0.2\), so \(S_i = 150/1.2^i\): 125, 104, …, 24.2 g/m³ in segment 10 (plug flow would give 20.3). At steady state the biofilm in segment \(i\) is \(B_i = Ya\,k_fS_i/b'\).
Checkpoints
Read these from your own runs; small differences in the last digit are normal.
| Stage | Quantity | Model | Formula |
|---|---|---|---|
| 1 | S at 5 / 20 / 60 days (g/m³) | 0.720 / 0.313 / 0.2882 | Smin = 0.2881 |
| 1 | B at 60 days (g/m³) | 173.37 | 173.43 |
| 1 | DO / Xd at 60 days (g/m³) | 3.480 / 1.387 | 3.479 / 1.387 |
| 2 | flux J (g/(m²·d)) | 0.636 | 0.641 |
| 2 | S in Layer(1:1) / (5:1) / (10:1) (g/m³) | 0.285 / 0.0487 / 0.0086 | 0.287 / 0.0483 / 0.0084 |
| 3 | S in Filter(1:1) / (5:1) / (10:1) at 80 days (g/m³) | 125.0 / 60.28 / 24.23 | 125.0 / 60.28 / 24.23 |
| 3 | B in Filter(1:1) / (10:1) (g/m³) | 4464 / 865 | 4464 / 865 |
| 3 | DO in Filter(1:1) / (10:1) (g/m³) | 4.945 / 8.424 | 4.944 / 8.424 |
| 3 | detached solids leaving Filter(10:1) (g/m³) | 17.97 | \(b_{det}\sum B_iV_i/Q\) = 17.97 |
Explore
- A bigger load. In Stage 1, double the inflow and the link (1000 m³/d). Predict: S stays at Smin and B doubles. Why can a biofilm reactor not wash out?
- Below Smin. In Stage 1, set the influent to 0.2 g/m³ and B's initial value to 173. Watch the biofilm die away.
- A thin film. In Stage 2, make the film 20 µm: layer storage 0.02 m³, internal link lengths 2e-06 m, boundary link 8.1e-05 m. Compare J with the fully penetrated value \(k_1L_fS_s\) and with Example 12b.
- No boundary layer. In Stage 2, set the Bulk → Layer(1:1) length to 1e-05 m (half a layer). How much does the flux rise, and what does that say about stirring?
- Not enough air. In Stage 3, set the Aeration source's Rate coefficient (\(K_La\)) to 60 d⁻¹. DO goes negative in the top segments. Why is that impossible in reality, and what is missing from the model? (Module 11 used the factor DO/(KO + DO).)
Troubleshooting
| B stays at its initial value. | B was created as a Chemical constituent (it then washes out) or the Utilization stoichiometry for B is 0. Or B's initial value is 0: a biofilm needs a seed. |
| Stage 2: every layer stays at S = 0, or the flux is far from 0.64. | A link area was left at its default 1e-09 m², which switches diffusion off; or the diffusion coefficient unit is m²/s instead of m²/day (8e-05 m²/s is 86,400 times too large); or a link length is in the wrong unit (2e-05 m, not 2e-05 ft). |
| Stage 2: the layers have the bulk concentration. | Xf:Concentration was not set in the layers, so nothing reacts. |
| Stage 3: S drops in the first segment only. | The Utilization rate still contains B (thin-film Monod): the biofilm then grows until S = Smin in segment 1. Use a_v*k_f*S. |
| The Array Generator offers no Time-Dependent flow. | Draw the nine links by hand (Links toolbar → Time-Dependent flow) and set area and length on each. |
What to submit
- Your three
.ohqfiles. - Stage 1: plots of S, B, DO and Xd, with Smin, B, Xd computed by hand and the COD balance.
- Stage 2: a plot of S against z in the ten layers with the cosh solution, and the flux compared with Example 12c.
- Stage 3: S, B and DO in the ten segments (a table), compared with the tanks-in-series and steady-biofilm formulas, and the plug-flow effluent for comparison.
- Short answers (2–4 sentences each): (a) Why does the Stage 1 effluent settle at Smin regardless of the flow, while the Stage 3 effluent depends on the flow? (b) In Stage 2, which resistance (boundary layer or biofilm) is larger, and how can you tell from the model? (c) Your result for one Explore item.
Submit everything in one PDF plus the .ohq files in Brightspace → Assignments → Modeling Assignment M12.