← Module 9 · Modeling Assignment M9 (OpenHydroQual)

Water column–bed exchange of sediment and a sorbing contaminant

An illustrated, step-by-step worked example · about 60 minutes · the latest OpenHydroQual · uses Module 9, Sections 2, 5 and 6, Module 6 (sorption kinetics) and the Module 1 guide

What you will build

A 4 km river reach with a bed of soft mud. At low flow the reach collects fine sediment; in a flood it scours its bed; and in the last stage the flood releases a PCB that was stored in the mud, part of which desorbs into the water. The reach is one completely mixed Reactor; the bed lives in the same block as an immobile constituent, and deposition, erosion and sorption are reactions. Every stage is checked against the formulas of Module 9.

StageWhat changesWhat to look forSaved as
1low flow (\(\tau_b = 0.0433\) Pa): depositionoutflow SS 50.13 g/m³; bed gains 42.6 g/(m²·day)M9_stage1_deposition.ohq
2flood (\(\tau_b = 2.5431\) Pa): erosionoutflow SS 342.9 g/m³; bed loses 9.26 kg/(m²·day)M9_stage2_flood_erosion.ohq
3+ a PCB on the bed (2 µg/g), kinetic sorptiontotal 285.7 ng/L leaving, only 10.1 % dissolvedM9_stage3_contaminant.ohq

The system

ItemLow flow (Stage 1)Flood (Stages 2–3)
Reach4000 m long, 40 m wide (bed area \(A = 160{,}000\) m²), Manning \(n = 0.030\), completely mixed
Flow, depth8 m³/s (691,200 m³/day), 2.5 m120 m³/s (10,368,000 m³/day), 4.5 m
Water volume, residence time400,000 m³, 0.579 day720,000 m³, 0.0694 day (1.7 h)
Bed shear stress (Module 9, Example 2b)0.0433 Pa2.5431 Pa
Inflow SS60 g/m³200 g/m³
Fine sediment and mud\(w_s = 1.5\) m/day, \(\tau_{cd} = 0.10\) Pa, \(\tau_{ce} = 0.40\) Pa, \(M = 1728\) g/(m²·day); erodible mud 45 kg/m² at the start
Contaminant (Stage 3)2 µg/g on the bed, \(K_d = 5000\) L/kg, sorption rate \(k_s = 2\) day⁻¹ (Module 6); clean inflow

How the bed is represented. An Immobile constituent belongs to a block but is never carried by links. Here "Bed" is the mud on the river bed, expressed per cubic metre of the water above it (g/m³), so the areal bed mass is \(m_b = \text{Bed} \times H\): 45,000 g/m² ÷ 2.5 m = 18,000 g/m³ at low flow. OpenHydroQual writes every reaction rate per unit water volume, so the Module 9 fluxes \(D\) and \(E\) (g/(m²·day)) are divided by the depth \(H\).

1Start a model and load the Mass Transfer plugin

As in the M1 guide, Step 1: File → Preferences → Add plugin → Mass Transfer. It provides the Reactor block, the Fixed flow link and the Immobile constituent.

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

2Two constituents: suspended sediment and the bed

Create a Chemical constituent named SS (as in M1, Step 2): the suspended sediment, which flows with the water. Then create the bed with Add Objects → Chemistry → Immobile constituent (per volume of water) and name it Bed.

Add Objects, Chemistry, Immobile constituent
1 Add Objects → 2 Chemistry → 3 Immobile constituent (per volume of water).

Why not a Solid Particle with a settling interface, as in Module 8? Because the bed must also give mass back to the water when it erodes, and because \(P_d\) and \(E\) depend on the shear stress. Writing deposition and erosion as reactions between SS and Bed keeps both directions in one place and conserves mass exactly: what leaves SS enters Bed.

3Reaction parameters: the physics in numbers

Create seven Reaction Parameters (Add Objects → Chemistry → Reaction Parameter), one for each quantity in the Krone and Partheniades expressions. Set the name and the Value; leave the temperature correction (Arrhenius factor) at 1.

NameValue (Stage 1)Meaning (Module 9, Section 5)
w_s1.5settling velocity of the flocs, m/day
depth2.5water depth \(H\), m (fluxes ÷ depth = rates per volume)
tau_b0.0433bed shear stress, Pa: your hand calculation \(\rho g n^2 U^2/R^{1/3}\)
tau_cd0.1critical stress for deposition, Pa
tau_ce0.4critical stress for erosion, Pa
M_e1728erosion-rate constant \(M\), g/(m²·day)
K_b1small bed-availability constant, g/m³ (see Step 4)
Reaction parameter tau_b with value 0.0433
The Reaction Parameters list in the Object Browser and the properties of tau_b: 1 Value 0.0433, 2 Name (the GUI lists Value before Name).

4Two reactions: deposition and erosion

Add a Chemical reaction (Add Objects → Chemistry → Chemical reaction). A reaction has a rate expression (g/m³/day, per unit water volume) and one stoichiometric constant per constituent, which says how much of the rate each constituent gains (+) or loses (−).

Deposition

Deposition reaction properties
Properties of the Deposition reaction.
PropertyValueMeaning
1Bed:Stoichiometric Constant1the bed gains what deposits
2SS:Stoichiometric Constant−1the water column loses it
3NameDeposition
4Rate Expressionw_s*_pos(1-tau_b/tau_cd)*SS/depth\(D/H = w_s\,P_d\,SS/H\); _pos(x) is \(\max(0, x)\). The GUI shows the expression in parentheses.

Erosion

Erosion reaction properties
Properties of the Erosion reaction: 1 Bed −1, 2 SS +1, 3 Name Erosion, 4 Rate Expression.

Rate expression: M_e*_pos(tau_b/tau_ce-1)*Bed/(Bed+K_b)/depth, which is \(E/H\) with \(E = M\max(0, \tau_b/\tau_{ce} - 1)\).

Why the factor Bed/(Bed + K_b)?
The Partheniades formula does not know how much mud is left. With \(K_b = 1\) g/m³ and a bed of thousands of g/m³, the factor is 0.9999, so it changes nothing while there is mud; when the bed runs out it goes to zero and erosion stops instead of driving the bed negative. It also matters for the Outlet block below: reactions run in every block, and the Outlet has no bed (Bed = 0), so it must not "erode".

5The reach and the outlet

Blocks toolbar: Reactor icon
1 The Reactor icon.

Add a Reactor named Reach:

Reach properties at low flow
Properties of the reach (low flow).
PropertyValueMeaning
1Bed:Concentration per volume of water18000 g/m³initial bed: 45 kg/m² ÷ 2.5 m
2SS:Concentration60 g/m³initial SS: the reach starts with inflow water
3SS:Constant Inflow concentration60 g/m³upstream SS
4Initial Storage400000 m³4000 × 40 × 2.5
5Constant Inflow691200 m³/day8 m³/s × 86,400
6NameReach

Add a large Outlet Reactor (Initial Storage 1e+06 m³, as in M1, Step 4) and a Fixed flow link from Reach to Outlet with a flow of 691200 m³/day.

Links toolbar: Fixed flow icon
1 The Fixed flow link.
Reach and Outlet joined by a Fixed flow link
1 Reach, 2 the link, 3 Outlet. The bed has no block of its own: it is inside Reach.

6Simulation time and time step

General Settings: end time 5
General Settings: 1 Simulation end time 5 days (Stages 2–3: 2).
Solver Settings
Solver Settings: 1 initial time-step 0.001 (not 0.01 as in M1), 2 maximum time-step increase factor 5.

Why a smaller first step? In the flood the reach has a residence time of only 1.7 hours (0.069 day). With a first step of 0.01 day the model lags visibly behind the exact curve for the first hours (SS about 2.4 % low at 0.1 day); with 0.001 the error drops to about 0.5 %. Use 0.001 in all three stages.

Stage 1Low flow: the reach collects mud

Save as M9_stage1_deposition.ohq, and run.

Run Model button
1 Run Model.
Running Model window
Close the run window when it says Finished!

Predict first (Module 9, Example 5a): \(\tau_b < \tau_{cd}\), so only deposition acts.

\[ P_d = 1 - \frac{0.0433}{0.10} = 0.567,\quad k_{dep} = \frac{1.5(0.567)}{2.5} = 0.340\ \text{day}^{-1},\quad SS = \frac{60}{1 + 0.340(0.579)} = 50.13\ \text{g/m}^3 \]

The reach approaches it from 60 with the rate constant \(1/\tau + k_{dep} = 1.728 + 0.340 = 2.07\) day⁻¹.

Right-click Reach, Results, SS:Concentration
Right-click Reach → 1 Results → 2 SS:Concentration.
Reach SS falling from 60 to 50.1
SS falls from 60 to 50.13 g/m³ within about two days.
Reach Bed concentration rising linearly
Results → Bed:Concentration per volume of water rises steadily: 18,000 → 18,087 g/m³ in 5 days. Times the depth: \(17.05 \times 2.5 = 42.6\) g/(m²·day), the deposition flux \(w_sP_dSS\).

Stage 2A flood scours the bed

Save a copy as M9_stage2_flood_erosion.ohq. Nothing in the reactions changes; only the numbers that describe the flood do. First compute the flood's bed shear stress yourself (Module 9, Example 2b): \(U = 120/(40 \times 4.5) = 0.667\) m/s, \(R = 180/49 = 3.673\) m, \(\tau_b = 1000(9.81)(0.03)^2(0.667)^2/3.673^{1/3} = 2.5431\) Pa. Then change:

ObjectPropertyLow flowFlood
tau_bValue0.04332.5431
depthValue2.54.5
ReachInitial Storage400000720000 m³
ReachConstant Inflow69120010368000 m³/day
ReachSS:Concentration and SS:Constant Inflow concentration60200 g/m³
ReachBed:Concentration per volume of water1800010000 g/m³ (45 kg/m² ÷ 4.5 m)
Reach → OutletFlow rate69120010368000 m³/day
SettingsSimulation end time52 days
Reach properties in the flood
The reach in the flood: 1 Bed 10000, 2 SS 200, 3 inflow SS 200, 4 storage 720000 and 5 inflow 10368000 (the GUI shows it as 1.0368e+07).

Predict (Module 9, Example 5b): \(\tau_b > \tau_{ce}\), so only erosion acts, at \(E = 1728(2.5431/0.40 - 1) = 9258\) g/(m²·day):

\[ SS = SS_{\text{in}} + \frac{E\,A}{Q} = 200 + \frac{9258 \times 160{,}000}{10{,}368{,}000} = 342.9\ \text{g/m}^3, \qquad \frac{d\,\text{Bed}}{dt} = -\frac{E}{H} = -2057\ \text{g/m}^3/\text{day} \]
Reach SS rising to 343 and the bed falling linearly
Left: SS rises from 200 to 342.9 g/m³ within a few hours (\(\tau\) = 1.7 h). Right: the bed falls in a straight line, from 10,000 to about 5,880 g/m³ in two days; times 4.5 m, the reach has lost 18.5 of its 45 kg/m² of mud.

Stage 3The flood releases a PCB stored in the bed

Save a copy of Stage 2 as M9_stage3_contaminant.ohq. The mud carries 2 µg/g of a PCB. We follow the PCB in three pools; all concentrations are in µg/m³ = ng/L (OpenHydroQual labels them g/m³, as in M1 with temperature: enter and read the numbers in ng/L):

Add the three constituents, two parameters K_d = 5000 (L/kg) and k_s = 2 (day⁻¹), set Reach Cb:Concentration per volume of water = 20000 (everything else 0, including the inflow: the river upstream is clean), and three reactions:

ReactionRate expressionStoichiometryMeaning
Sorptionk_s*(K_d*SS*0.000001*Cd-Cp)Cd −1, Cp +1Module 6 kinetics toward \(C_p = K_d\,SS\,C_d\); negative = desorption
Contaminant_depositionw_s*_pos(1-tau_b/tau_cd)*Cp/depthCp −1, Cb +1particulate PCB deposits with the particles (zero in the flood)
Contaminant_erosionM_e*_pos(tau_b/tau_ce-1)*Cb/(Bed+K_b)/depthCp +1, Cb −1eroded mud brings its PCB: \((E/H)\times C_b/\text{Bed} = (E/H)\,w_b\)
Object Browser with five constituents and five reactions
1 Constituents SS, Cd, Cp, Bed, Cb; 2 the five reactions; 3 the nine reaction parameters.
Sorption reaction properties
The Sorption reaction: 1 Cd −1, 2 Cp +1 (all other stoichiometric constants 0), 3 rate expression (the GUI displays 0.000001 as 1e-06).

Predict the steady state. Adding the balances for Cd and Cp, sorption cancels, so the total leaving equals what erosion supplies; the split then follows from the Cd balance:

\[ C_T = \frac{E\,A\,w_b}{Q} = \frac{9258 \times 160{,}000 \times 2}{10{,}368{,}000} = 285.7\ \text{ng/L}, \qquad \frac{C_d}{C_T} = \frac{k_s\tau}{1 + k_s\tau + k_sK_d\,SS\,\tau} = \frac{0.139}{1 + 0.139 + 0.238} = 0.101 \]

so \(C_d = 28.8\) ng/L and \(C_p = 256.9\) ng/L. At equilibrium with 343 mg/L of SS the dissolved share would be \(1/(1 + K_dSS) = 36.8\) %: the water spends only 1.7 hours in the reach, much less than the 12-hour sorption time scale \(1/k_s\).

Dissolved and particulate PCB in the reach
Reach Cd (left) and Cp (right): both rise within hours to 28.8 and 256.9 ng/L and then stay there while the bed lasts. Plot Cb as well: it falls in proportion to Bed, so their ratio stays at 2 µg/g.

Checkpoints

Read these from your own runs; small differences in the last digit are normal. The "formula" column is the exact solution (Stages 1–2) or, for times before steady state in Stage 3, a numerical solution of the same equations (fourth-order Runge–Kutta, computed by the instructor).

StageQuantityModelFormula
1Reach SS at 0.5 / 1 / 5 days (g/m³)53.66 / 51.39 / 50.1353.64 / 51.38 / 50.13
1Reach Bed at 5 days (g/m³) and areal bed (kg/m²)18,086.9 (45.22)18,086.9 (45.22)
1Bed gain per day × depth, days 3–5 (g/(m²·day))42.642.6
2Reach SS at 0.25 / 0.5 / 2 days (g/m³)338.45 / 342.72 / 342.85338.97 / 342.77 / 342.85
2Reach Bed at 2 days (g/m³) and areal bed (kg/m²)5,885.8 (26.49)5,885.8 (26.49)
3Reach Cd at 0.25 / 1 / 2 days (ng/L)26.35 / 28.82 / 28.8226.58 / 28.82 / 28.82
3Reach Cp at 0.25 / 1 / 2 days (ng/L)250.6 / 256.9 / 256.9251.3 / 256.9 / 256.9
3Cb/Bed at any time (µg/g)2.00002.0000

The bed in Stage 2 agrees with the exact solution at 2 days, and its rate of loss after the first hour agrees with \(E\) to within 0.02 %. Cd and Cp lag the exact curve by up to about 1 % in the first hours (Step 6), so compare from 0.5 day on for the closest match.

Explore

Save a copy with File → Save as and change one thing at a time.

Troubleshooting

SS does not change.A reaction's stoichiometric constants are both 0, or tau_b is in the dead band between tau_cd and tau_ce. Check the rate expression for typos: parameter names are case-sensitive.
The bed goes negative.The erosion expression is missing the factor Bed/(Bed+K_b), or K_b is 0.
The Outlet gains SS from nowhere.Same cause: without the bed factor, the Erosion reaction also runs in the Outlet, which has no bed.
The bed or SS change much too fast.The depth parameter is missing from the denominator, or the flood values were entered in m³/s instead of m³/day.
Stage 3: Cd and Cp stay at 0.Cb:Concentration per volume of water in the Reach is 0, or the Contaminant_erosion stoichiometry is reversed.
The first hour is off in Stage 2.Use an initial time step of 0.001 (Step 6).

What to submit