← Module 6 · Modeling Assignment M6 (OpenHydroQual)

Sorption in a bottle and in a column

An illustrated, step-by-step worked example · about 75 minutes · the latest OpenHydroQual · uses Module 6, Sections 2, 4, 5 and 6 (batch balance, isotherms, kinetics, retardation) and your Module 5 column model

What you will build

Two new OpenHydroQual objects describe sorption: an Immobile constituent that holds the sorbed chemical (it stays where it is, and the links do not carry it), and a reaction that moves mass between the dissolved and the sorbed constituent toward the isotherm. You will use them first in a single bottle, then in six bottles that make up an isotherm experiment, and finally in the 80-cell column of Module 5.

StageWhat changesWhat to look forSaved as
1one bottle, linear isotherm, first-order kinetics\(C = C_{\text{eq}} + (C_0 - C_{\text{eq}})e^{-k_s(1 + rK_d)t}\); \(C_{\text{eq}} = 5\) g/m³M6_stage1_batch_linear.ohq
2six bottles, Langmuir isothermequilibrium points on the Langmuir curve; your fit recovers \(q_{\max}\) and \(K_L\)M6_stage2_isotherm.ohq
3the Module 5 column + sorption (fast)front delayed by \(R = 3\): \(C/C_0 = \tfrac12\operatorname{erfc}\big[(Rx - vt)/(2\sqrt{DRt})\big]\)M6_stage3_column_equilibrium.ohq
4same column, slow sorptionearlier breakthrough, slower approach to \(C_0\); sorbed/dissolved below \(R - 1\)M6_stage4_column_kinetic.ohq

How the sorbed phase is represented

The Immobile constituent "Sorbed" has a concentration \(S\) in g per m³ of water, so that both constituents use the same units and the exchange conserves mass. If \(q\) is the sorbed amount per mass of solid (g/kg) and \(r\) the mass of solid per volume of water (kg/m³), then \(S = rq\). One reaction does all the work (Module 6, Section 5):

\[ \text{rate} = k_s\big(r\,q_{\text{eq}}(C) - S\big), \qquad \text{Chem: } -1,\quad \text{Sorbed: } +1 \]

When \(S\) is below the isotherm the rate is positive (sorption); above it, negative (desorption). At equilibrium \(S = r\,q_{\text{eq}}(C)\), and for a linear isotherm \(S/C = rK_d\): in a bottle \(r = M_s/V\), in a column \(r = \rho_b/n\), and then \(S/C = R - 1\).

ItemStage 1–2 (bottles)Stage 3–4 (column)
Water volume1 m³ per bottle (concentrations do not depend on it)0.4 m³ per cell (Module 5)
Solid per water, \(r\)100 kg/m³ (Stage 1, = 10 g of soil in 100 mL); 10 kg/m³ (Stage 2)\(\rho_b/n = 1600/0.4 = 4000\) kg/m³
Isotherm\(K_d = 10\) L/kg = 0.01 m³/kg (Stage 1); Langmuir \(q_{\max} = 0.5\) g/kg, \(K_L = 0.2\) L/mg = 0.2 m³/g (Stage 2)\(K_d = 0.5\) L/kg = 0.0005 m³/kg, so \(R = 1 + 4000 \times 0.0005 = 3\)
Rate constant \(k_s\)2 per day10 per day (Stage 3), 0.1 per day (Stage 4)
Simulation2 days (Stage 2: 3 days), initial time step 0.002 day100 days, initial time step 0.01 day; about 3 minutes per run
Units. OpenHydroQual does not convert units inside a rate expression. Use kg/m³ for \(r\), m³/kg for \(K_d\) (divide L/kg by 1000), g/kg for \(q_{\max}\) and m³/g for \(K_L\) (numerically the same as L/mg). Then \(r K_d\) is dimensionless and \(S\) is in g/m³. To report \(q\) in mg/kg, compute \(1000\,S/r\).

1Load the Mass Transfer plugin

Start a new model and add Mass Transfer (File → Preferences → Add plugin), as in Module 1, Step 1. It provides the Reactor, 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, 2 OK.

2Two constituents: the dissolved and the sorbed chemical

Add a Chemical constituent and rename it Chem (the dissolved chemical). Then add an Immobile constituent (per volume of water) from the same menu and rename it Sorbed. (Do not pick "Sorbed constituent (per total volume)", which is a different object.)

Add Objects, Chemistry menu
1 Add Objects → 2 Chemistry → 3 Chemical constituent (for Chem).
Add Objects, Chemistry, Immobile constituent
The same menu: 1 Immobile constituent (per volume of water). Unlike a Chemical constituent it has no inflow concentration, diffusion or dispersivity: it never leaves its block.
Immobile constituent properties, renamed Sorbed
1 The new constituent under Constituents; 2 Name Sorbed.

3Reaction parameters: k_s, r and K_d

Add three Reaction Parameters (Add Objects → Chemistry → Reaction Parameter). For each, set the Value and the Name. If you did the Module 2 guide this is familiar.

Reaction parameter k_s
The first parameter: 1 Value 2, 2 Name k_s.
NameValue (Stage 1)Meaning
k_s2sorption rate constant, 1/day
r100solid per volume of water, kg/m³ (10 g of soil in 100 mL)
K_d0.01distribution coefficient in m³/kg (= 10 L/kg)

Leave the Arrhenius factor at 1 and the temperature empty: no temperature correction.

4The sorption reaction

Add a Chemical reaction (Add Objects → Chemistry → Chemical reaction). Its properties list a stoichiometric constant for every constituent and a rate expression.

Sorption reaction properties
1 Chem:Stoichiometric Constant −1; 2 Sorbed:Stoichiometric Constant 1; 3 Name Sorption; 4 Rate Expression k_s*(r*K_d*Chem-Sorbed) (the GUI shows it wrapped in brackets).

OpenHydroQual computes, in every block, rate × stoichiometric constant as the change of each concentration per day:

\[ \frac{dC}{dt} = -k_s(rK_dC - S), \qquad \frac{dS}{dt} = +k_s(rK_dC - S), \]

which is Module 6's \(dq/dt = k_s(K_dC - q)\) multiplied by \(r\), together with the batch mass balance: what the water loses the solid gains, so \(C + S\) stays constant.

5The bottle: a Reactor with no flow

Add a Reactor. It has no inflow and no links: a closed batch bottle.

Reactor icon
1 Reactor.
Bottle properties
1 Chem:Concentration 10 g/m³ (\(C_0\)); 2 Sorbed:Concentration per volume of water 0 (clean soil); 3 Initial Storage 1 m³; 4 Constant Inflow 0; 5 Name Bottle.
Why 1 m³ and not 100 mL?
Concentrations do not depend on the volume, and OpenHydroQual computes a concentration as mass/(Storage + 0.00001): with a tiny storage that small constant would matter. Think of the model bottle as 1 m³ of the same suspension.

6Simulation time and time step

Sorption in the bottle takes hours, not days, so use a finer time step than in Modules 1 and 5. In General Settings set the end time to 2 days. In Solver Settings set the initial time-step to 0.002 day and keep the maximum time-step increase factor at 5 (largest step 0.01 day ≈ 15 minutes).

Solver settings with initial time step 0.002
1 Initial time-step 0.002; 2 maximum time-step increase factor 5.

Stage 1A batch test with a linear isotherm

Save as M6_stage1_batch_linear.ohq, run, and plot Bottle → Results → Chem:Concentration and Sorbed:Concentration per volume of water (each opens its own plot window).

Run Model button
1 Run Model.
Running Model window
Close it at Finished!
Dissolved and sorbed concentrations in the bottle
The dissolved chemical falls from 10 to 5 g/m³ while the sorbed one rises from 0 to 5 g/m³ of water; the two always add up to 10.
Check it by hand

\(rK_d = 100 \times 0.01 = 1\), so \(C_{\text{eq}} = 10/(1 + 1) = 5\) g/m³ and \(q_{\text{eq}} = K_dC_{\text{eq}} = 10 \times 5 = 50\) mg/kg (model: \(1000\,S/r = 1000 \times 5/100 = 50\)). The approach has the rate constant \(k_s(1 + rK_d) = 4\) per day:

\[ C(t) = 5 + 5\,e^{-4t}: \quad 6.84,\ 5.68,\ 5.09\ \text{g/m}^3 \text{ at } 0.25,\ 0.5,\ 1 \text{ day}. \]

The model gives 6.87, 5.70 and 5.10. Half of the change happens in \(\ln 2/4 = 0.17\) day (4.2 h).

Stage 2An isotherm experiment: six bottles, Langmuir

Save a copy as M6_stage2_isotherm.ohq. A real isotherm experiment uses several bottles with different starting concentrations. You will do the same, with a Langmuir isotherm in the rate expression.

  1. Change parameter r to 10 (1 g of soil in 100 mL). Add two parameters: q_max = 0.5 (g/kg = 500 mg/kg) and K_L = 0.2 (L/mg). K_d is no longer used.
  2. Change the rate expression of Sorption to k_s*(r*q_max*K_L*Chem/(1+K_L*Chem)-Sorbed).
  3. Rename the bottle Bottle1 and give it Chem:Concentration 1. Copy and paste it five times (or add five Reactors with Initial Storage 1 m³) and name them Bottle2 … Bottle6 with Chem:Concentration 2.5, 5, 10, 20 and 40 g/m³.
  4. End time 3 days. Save and run.
Langmuir rate expression
1 The Langmuir rate expression.
Six bottles on the canvas
1 The six bottles: no links between them.

For each bottle read Chem:Concentration (\(C\)) and Sorbed:Concentration (\(S\)) at 3 days, compute \(q = 1000\,S/r\) (mg/kg), and fit the Langmuir isotherm as in Module 6, Example 4b: regress \(C/q\) on \(C\).

Compare the bottles on one plot. Right-click Bottle1 → Results → Chem:Concentration and keep that plot window open. Open Bottle2's Chem:Concentration in a second window, right-click its chart → Copy curve, then right-click the chart of the Bottle1 window → Paste. Close the second window and repeat for Bottle3 … Bottle6 (more on this in the card of Stage 3).

Chem concentration in the six bottles on one plot
Chem:Concentration in the six bottles on one panel (Bottle1 plotted, the others pasted in). From top to bottom, Bottle6 (\(C_0 = 40\)) levels off at 35.6 g/m³, Bottle5 at 16.2, Bottle4 at 7.07, Bottle3 at 3.09, Bottle2 at 1.40 and Bottle1 (\(C_0 = 1\)) at 0.52, all within about two days. The more chemical in the bottle, the smaller the fraction that sorbs: 48 % in Bottle1 but only 11 % in Bottle6, because the sorption sites fill up.
Check it by hand: Bottle4

At equilibrium \(C_0 = C + r\,q_{\max}K_LC/(1 + K_LC)\). Rearranged, \(K_LC^2 + (1 + K_Lrq_{\max} - K_LC_0)\,C - C_0 = 0\). With \(rq_{\max} = 5\) g/m³, \(K_L = 0.2\) and \(C_0 = 10\): \(0.2C^2 + (1 + 1 - 2)\,C - 10 = 0\), so \(C = \sqrt{50} = 7.07\) g/m³ and \(q = (10 - 7.07)/10 \times 1000 = 293\) mg/kg (model: 7.07 and 293).

Your fit through all six model bottles should give \(q_{\max} \approx 499\) mg/kg and \(K_L \approx 0.20\) L/mg, the values you put in. That is the point of the exercise: the bottles are a "virtual experiment" whose answer you know.

Stage 3Sorption in the Module 5 column

Open your M5_stage2_dispersion.ohq (80 cells, dispersivity 2 m, step input 100 g/m³ into Cell(1:1)) and save it as M6_stage3_column_equilibrium.ohq. Then:

  1. Keep the Tracer: it does not sorb, so it is your reference. Add a Chemical constituent Chem with the same dispersivity, 2 m, and the Immobile constituent Sorbed (Step 2).
  2. Give Cell(1:1) Chem:Constant Inflow concentration 100, the same as the Tracer. Chem and Tracer now enter the column together; only Chem sorbs.
  3. Add the parameters k_s = 10, r = 4000 (\(\rho_b/n = 1600/0.4\) kg/m³) and K_d = 0.0005 (0.5 L/kg), and the reaction Sorption of Step 4 with the linear rate expression.
  4. Set the end time to 100 days and the initial time-step back to 0.01.
  5. Save and run (about 3 minutes).
Column parameters
The parameter 1 r = 4000. In the column \(r\) is the mass of grains per volume of pore water.

Before you run, predict: \(R = 1 + \rho_bK_d/n = 1 + 1600 \times 0.0005/0.4 = 3\). The middle of the Tracer front should reach Cell(20:1) at \(x/v = 20\) days, and the middle of the Chem front at \(Rx/v = 60\) days.

Tracer and Chem concentration in Cell(20:1) on one plot, Stage 3
Tracer and Chem in Cell(20:1) on one panel: plot Tracer:Concentration, open Chem:Concentration in a second window, right-click it → Copy curve, and right-click the Tracer plot → Paste. The Tracer passes 50 g/m³ at 20 days; the sorbing Chem at 59 days, three times later, and its front is three times wider in time. This delay is retardation.
Put several curves on one plot: copy and paste

Open each curve in its own plot window (right-click the block → Results → the quantity). In the window you want to copy from, right-click the chart → Copy curve (it reads Copy Curves when the window holds several). In the window that collects the curves, right-click the chart → Paste. The pasted curve gets its own colour and legend entry and the axes rescale; close the source window and repeat.

OpenHydroQual keeps the copied curve when you open another file, so this also works across models: copy the Stage 3 curve, open the Stage 4 file and paste it into a Stage 4 plot. 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_stage3.txt) if you want to keep it.

Check it by hand: Cell(20:1)

Module 6, Section 6 with the model's dispersivity \(\alpha + \Delta x/2 = 2.5\) m (Module 5), \(D = 2.5\) m²/day:

\[ \frac{C}{C_0} = \frac12\operatorname{erfc}\!\left(\frac{3(20) - 1(45)}{2\sqrt{2.5 \times 3 \times 45}}\right) = \frac12\operatorname{erfc}(0.408) = 0.282 \ \text{ at } t = 45 \text{ days}. \]

The model gives 28.4 g/m³ at 45 days, 51.0 at 60 and 68.8 at 75 (formula 28.2, 50.0, 67.3).

Also plot Sorbed:Concentration per volume of water in Cell(20:1): at every time it is twice the dissolved concentration (\(S/C = rK_d = R - 1 = 2\)); at 100 days, \(S = 172.8\) and \(C = 86.4\) g/m³. In mg/kg of grains, \(q = nS/\rho_b \times 1000 = 43.2\) mg/kg, the same as \(K_dC\). Two thirds of the chemical in the column is on the grains.

Stage 4Slow sorption

Save a copy as M6_stage4_column_kinetic.ohq, set k_s to 0.1 per day, save, and run. Plot Cell(20:1) Chem:Concentration and compare it with Stage 3 on one panel: before you open the Stage 4 file, plot the Stage 3 Cell(20:1) Chem:Concentration and right-click it → Copy curve; after the Stage 4 run, right-click the Stage 4 plot → Paste. (Or open Stage 3 later and load its saved outputs, as in the card above.)

Chem concentration in Cell(20:1), Stages 3 and 4 on one plot
Chem:Concentration in Cell(20:1) from Stage 4, with the Stage 3 curve pasted into the same plot window. Both curves carry the same legend name, Cell(20:1)_Chem:concentration: the first entry is the Stage 4 curve, the second the pasted Stage 3 curve (the steeper one). With slow sorption the chemical arrives much earlier (10 g/m³ at 19 days instead of 32), crosses 50 g/m³ a little earlier (56 days instead of 59) and then approaches 100 more slowly (81 g/m³ at 100 days instead of 86).

Why? The water spends about 1 day in each cell, but the chemical needs \(1/k_s = 10\) days to sorb. Some of it passes cells before it has had time to sorb, so it runs ahead of the equilibrium front; the grains behind it are still "hungry" and keep taking chemical out of the water long after the front has passed, so the curve creeps up to \(C_0\). Check it in Cell(20:1): the ratio Sorbed/Chem is only 1.35 at 40 days and 1.61 at 60 days, below the equilibrium value of 2, and is still rising (1.86) at 100 days.

A deeper check (CEE 566): kinetics change the shape, not the mean
For linear sorption the mean arrival time of the front, \(\int_0^\infty(1 - C/C_0)\,dt\), does not depend on \(k_s\). Running both stages to 250 days (with \(k_s = 0.2\) per day) gives 66.0 days at Cell(20:1), the same as the equilibrium value \(R(x + \alpha)/v = 3(20 + 2)/1 = 66\) days for a cell concentration with this kind of inlet. Within 100 days neither tail is complete, so the integrals are not yet equal.
All four stages against the formulas
The four stages from headless runs. Black dashed: the Module 6 formulas.

Checkpoints

Read these from your own runs; small differences in the last digit are normal.

StageQuantityModelFormula
1Bottle C at 0.25 / 0.5 / 1 day (g/m³)6.87 / 5.70 / 5.106.84 / 5.68 / 5.09
1C and S at 2 days (g/m³); q (mg/kg)5.00, 5.00; 50.05, 5; 50
2C at 3 days, Bottles 1–6 (g/m³)0.525 / 1.404 / 3.091 / 7.074 / 16.19 / 35.630.525 / 1.404 / 3.090 / 7.071 / 16.18 / 35.62
2q at 3 days, Bottles 1–6 (mg/kg)47.5 / 109.6 / 190.9 / 292.6 / 381.2 / 437.447.5 / 109.6 / 191.0 / 292.9 / 382.0 / 438.5
2Langmuir fit (C/q vs C)qmax 499 mg/kg, KL 0.201 L/mg500, 0.2
3Cell(20:1) C at 45 / 60 / 75 days (g/m³)28.4 / 51.0 / 68.8retarded erfc 28.2 / 50.0 / 67.3
3Tracer (no sorption), Cell(20:1): C at 15 / 20 / 25 days; time to 50 g/m³28.3 / 50.9 / 68.8; 19.8 derfc with R = 1: 28.2 / 50.0 / 67.3; \(x/v = 20\) d
3Cell(20:1) time to 50 g/m³ (days)59.3\(Rx/v = 60\)
3Cell(30:1) C at 67.5 / 90 days24.4 / 51.024.0 / 50.0
3Cell(20:1) S/C at 40 / 100 days1.99 / 2.00\(R - 1 = 2\)
4Cell(20:1) C at 20 / 40 / 60 / 100 days (g/m³)10.4 / 32.3 / 53.4 / 81.3(Stage 3: 1.2 / 20.8 / 51.0 / 86.4)
4Cell(20:1) S/C at 40 / 60 / 100 days1.35 / 1.61 / 1.86below 2 (not at equilibrium)

Explore

Troubleshooting

Nothing sorbs; Chem stays at 10.The rate expression refers to a name the model does not know: check the spelling of Chem, Sorbed and the parameters (upper/lower case matters).
Chem drops to a much lower value than 5.K_d was entered in L/kg (10) instead of m³/kg (0.01).
Chem and Sorbed do not add up to the starting value.The stoichiometric constants must be −1 (Chem) and +1 (Sorbed).
The column front still arrives at 20 days.A reaction parameter name is misspelled in the rate expression, or r is 1600 instead of 4000 (use \(\rho_b/n\)).
Sorbed chemical moves along the column."Sorbed" was created as a Chemical constituent instead of an Immobile constituent.
The batch curve is jagged in the first hour.The time step is too long: set the initial time-step to 0.002 day.

What to submit