Overview
Every model in this course, from a reaction in a beaker to nitrogen removal in a biofilm, is the same idea written out carefully: mass is conserved. What goes into a region either comes out, stays and accumulates, or is turned into something else. Energy obeys the same bookkeeping. This module sets up that bookkeeping, solves the two cases you will reuse all semester (steady mixing and the unsteady well-mixed tank), and shows you how to build the same model in OpenHydroQual.
- Express concentrations in mass, molar and mass-fraction units, in water and in air, and convert between them.
- Choose a control volume and write the mass balance: accumulation = in − out + sources − sinks.
- Solve steady-state mixing problems for concentration and temperature.
- Derive and use the solution for an unsteady well-mixed tank (filling and flushing), and interpret the hydraulic residence time.
- Write an energy balance for water that is heated, cooled or mixed, and compute heat rates and temperature changes.
- Build, run and check a well-mixed tank model in OpenHydroQual.
Notation. \(C\) is concentration (mg/L = g/m³), \(Q\) volumetric flow rate (m³/s or m³/day), \(V\) volume (m³), \(M\) mass (g), \(\dot m = QC\) mass flow rate or load (g/day), \(\tau = V/Q\) the hydraulic residence time, \(T\) temperature (°C), \(\rho\) density and \(c_p\) specific heat. A subscript "in" marks an inflow; a bare \(C\) in a well-mixed volume is also the outflow concentration.
Reading (optional): Mihelcic & Zimmerman, Environmental Engineering 3rd ed., ch. 2 (Environmental Measurements) and §4.1–4.2 (Mass and Energy Balances); Nazaroff & Alvarez-Cohen ch. 2 and ch. 5 (☐ sections not checked).
1Concentration units
In water
A concentration is an amount of a substance per amount of mixture. Three kinds are used:
- Mass per volume: mg/L, µg/L, g/m³. Note that 1 mg/L = 1 g/m³, which is why g/m³ is the natural unit for models in which volumes are in m³ (OpenHydroQual uses it).
- Molar: mol/L (M), mmol/L. Divide mass concentration by the molecular weight: \(C\,[\text{mol/L}] = C\,[\text{g/L}] / MW\,[\text{g/mol}]\). Reactions balance in moles, so kinetics and stoichiometry (Modules 2, 3 and 10) need molar units.
- Mass fraction: ppmm (parts per million by mass), ppb, %. A litre of dilute water weighs 1 kg = 10⁶ mg, so 1 mg/L ≈ 1 ppm in water. This is only true for dilute solutions near the density of water; it is not true for sludge, soil or air.
Nutrients are often reported "as" an element: nitrate "as N" counts only the nitrogen. To convert, multiply by the ratio of molecular weights:
A well has 45 mg/L of nitrate as NO₃⁻. As N it is \(45 \times 14.01/62.00 = 10.17\) mg/L, just above the U.S. drinking-water limit of 10 mg/L as N. As a molar concentration it is \(0.045/62.00 = 7.26\times10^{-4}\) mol/L.
In air
For gases, ppm usually means ppm by volume (ppmv): volumes of the pollutant per 10⁶ volumes of air. By the ideal gas law equal volumes hold equal numbers of moles, so ppmv is also a mole fraction, and it does not change with temperature or pressure. Mass per volume (µg/m³) does change. To convert, use the molar volume \(V_m = RT/P\) (24.47 L/mol at 25 °C and 1 atm; 22.41 L/mol at 0 °C):
Carbon monoxide at 9 ppmv (the 8-hour air quality standard), 25 °C and 1 atm: \(9 \times 28.01 \times 1000 / 24.47 = 10{,}300\) µg/m³ ≈ 10.3 mg/m³.
Unit converter
The same ppmv is a different µg/m³ at each temperature
2The mass balance
optional Environmental Engineering Tutor: Intro to Mass Balances for Environmental Engineers (6 min).
Control volume
A mass balance is always written for a control volume: a region you choose, with a boundary across which you can list every flow. It may be a tank, a lake, a stretch of river, one cell of an aquifer, or the air over a city. Choosing it well is half the work: put the boundary where you know the flows and concentrations, or where you want the answer.
For any substance in the control volume:
Every term has units of mass per time (g/day). \(QC\) is the mass flow rate or load: m³/day × g/m³ = g/day. Sources and sinks inside the volume include external loads (a pipe discharging straight into a lake), reactions that produce or destroy the substance (Modules 2–3), transfer to another phase (sorption, Module 6; gas transfer, Module 7) and settling (Module 8). In this module there are no reactions: the substance is conservative.
Two more assumptions are used constantly:
- Completely mixed (well-mixed): the concentration is the same everywhere in the volume, so the outflow concentration equals the concentration inside, \(C_{\text{out}} = C\), and \(M = CV\).
- Steady state: nothing changes with time, so \(dM/dt = 0\) and in + sources = out + sinks. Steady state is a statement about time, not about the absence of flow.
Steady-state mixing
Where a wastewater discharge or tributary joins a river, and the two mix completely, the mass balance on the junction with no sources or sinks and at steady state is
The mixed concentration is the flow-weighted average. The water balance \(Q_{\text{mix}} = Q_1 + Q_2\) is itself a mass balance (on water).
A river carries 10 m³/s with 2 mg/L chloride upstream of a treatment plant that discharges 0.5 m³/s at 150 mg/L. Downstream, \(C_{\text{mix}} = (10 \times 2 + 0.5 \times 150)/10.5 = 95/10.5 = 9.05\) mg/L. The chloride load is 95 g/s = 8,208 kg/day. If the downstream limit were 5 mg/L, the effluent could contain at most \((5 \times 10.5 - 10 \times 2)/0.5 = 65\) mg/L.
Why can you average concentrations by flow but not by volume?
Steady state with a source
A well-mixed lake with outflow \(Q\) and an internal source \(S\) (g/day, e.g. a direct discharge) and clean inflow reaches \(QC = S\), so \(C = S/Q\). With an inflow concentration as well, \(C = C_{\text{in}} + S/Q\). The concentration depends on the load per unit flow, not on the lake volume: volume matters only for how fast steady state is reached (next section).
3The unsteady well-mixed tank
optional LearnChemE: Transient Material Balance for a Solution (4 min).
Derivation
Take a completely mixed tank (a pond, an equalization basin, a room) with constant volume \(V\), inflow \(Q\) at concentration \(C_{\text{in}}\), and outflow \(Q\) at the tank concentration \(C\). There are no reactions. The balance is
\(\tau\) is the hydraulic residence time (or detention time): the time to deliver one tank volume of water. The equation says the concentration always moves toward the inflow concentration, at a rate proportional to how far away it is.
Solving it step by step
1. With \(C_{\text{in}}\) constant, let \(u = C - C_{\text{in}}\). Then \(du/dt = dC/dt = -u/\tau\).
2. Separate and integrate from \(t = 0\) (where \(C = C_0\)): \(\displaystyle\int_{u_0}^{u}\frac{du}{u} = -\int_0^t\frac{dt}{\tau}\), so \(\ln\dfrac{u}{u_0} = -\dfrac{t}{\tau}\).
3. Back to \(C\): \(C - C_{\text{in}} = (C_0 - C_{\text{in}})\,e^{-t/\tau}\).
Two special cases:
- Filling (step input into a clean tank, \(C_0 = 0\)): \(C = C_{\text{in}}\,(1 - e^{-t/\tau})\).
- Flushing (clean inflow, \(C_{\text{in}} = 0\)): \(C = C_0\,e^{-t/\tau}\).
After one residence time the tank has made 63.2 % of its change (\(1 - e^{-1}\)); after \(3\tau\), 95 %; after \(5\tau\), 99.3 %. A tank never quite reaches the new steady state, so we say it is "practically" there after 3 to 5 residence times. Solving for the time to reach a target \(C^*\):
A 50,000 m³ pond receives 5,000 m³/day (\(\tau = 10\) days). Its inflow suddenly starts carrying 20 mg/L of a conservative salt, and the pond was clean. After 5, 10 and 30 days the pond is at 7.87, 12.64 and 19.0 mg/L. It reaches 15 mg/L after \(t = 10\ln[(0 - 20)/(15 - 20)] = 10 \ln 4 = 13.9\) days. Later the salt stops and the pond, now at 8 mg/L, is flushed with clean water: reaching 0.5 mg/L takes \(10\ln(8/0.5) = 27.7\) days.
Well-mixed tank explorer
Tank concentration C(t), with τ, 3τ and the target marked
Try this: double the volume, then double the flow. What changes, and what does not?
4Energy balance
optional LearnChemE: Energy Balance in Open and Closed Systems (6 min).
Energy is conserved too (first law of thermodynamics). For the liquid water systems in this course, kinetic and potential energy changes are small and no work is done, so the energy balance becomes a heat balance: the internal energy of water changes only through flows of warmer or colder water and heat added or removed.
The heat content (relative to a reference temperature) of a mass \(m\) of water at temperature \(T\) is \(m c_p T\), with \(c_p = 4.186\) kJ/(kg·°C) and \(\rho = 1000\) kg/m³. A flow \(Q\) at temperature \(T\) carries heat at the rate \(\rho c_p Q T\). The balance on a well-mixed volume is
where \(\dot H\) (kW) is heat added (a heater, a power plant's waste heat) minus heat lost (to air, through walls). Compare it with the mass balance: temperature plays the role of concentration and \(\rho c_p\) multiplies every term. With \(\rho c_p\) constant, everything you learned in Sections 2 and 3 applies to temperature unchanged:
- Mixing two streams: \(T_{\text{mix}} = \dfrac{Q_1T_1 + Q_2T_2}{Q_1 + Q_2}\).
- Heating a flow: \(\dot H = \rho c_p Q\,\Delta T\), or \(\Delta T = \dot H/(\rho c_p Q)\).
- A well-mixed tank responds to a change in inflow temperature with the same \(e^{-t/\tau}\) curve.
A power plant rejects 1000 MW of waste heat to a river flowing at 100 m³/s. If all of it goes into the river, the river warms by \(\Delta T = 10^9/(1000 \times 4186 \times 100) = 2.39\) °C.
The discharge of Example 2 (0.5 m³/s) is at 25 °C and the river (10 m³/s) at 12 °C. Downstream \(T = (0.5 \times 25 + 10 \times 12)/10.5 = 12.62\) °C.
An anaerobic digester receives 100 m³/day of sludge (treat it as water) at 15 °C and must hold it at 35 °C. The heat needed just to warm the feed is \(\rho c_p Q\Delta T = 1000 \times 4.186 \times 100 \times 20 = 8.37\times10^6\) kJ/day = 96.9 kW, before any heat lost through the tank walls.
Where does the analogy break down?
Mixing calculator: concentration and temperature
Downstream concentration and temperature as the discharge flow changes
5Modeling with OpenHydroQual
OpenHydroQual is a free, open-source program for building models of water and the substances it carries out of blocks (tanks, reactors, soil layers, river reaches) joined by links (flows). Each block is a control volume: the program writes the mass balance of Section 2 for every block and constituent and solves the equations over time. You will use it in every module of this course, adding one process at a time.
- Install: download the Windows installer from www.OpenHydroQual.com. The guide uses version 2.1.
- optional OpenHydroQual channel: How to use reactions and mass-transfer in OpenHydroQual (24 min): useful now and again in Module 2.
- optional OpenHydroQual Examples: Thermal Discharge to a Flow-Through Pond: a worked model of Section 4's energy balance, with waste heat added to a pond and the Heat (temperature) constituent, checked against the exact solution.
Modeling Assignment M1 (OpenHydroQual). A well-mixed tank: filling, flushing, and mixing two streams: an illustrated step-by-step guide. You build a 1000 m³ tank with one inflow and an outflow, fill it, flush it, then add a river inflow and carry temperature as a second constituent. Every stage is checked against the formulas of Sections 2–4.
6Practice (ungraded)
New numbers every time. Aim for two correct attempts in a row on each type before taking the quiz. Watch the units: m³/s against m³/day, mg/L against g/m³ (the same), and kW against kJ/day.
A · Concentration units
B · Steady-state mixing below a discharge
C · Filling a well-mixed tank
D · Flushing after a spill
E · Energy balance: heating and thermal discharge
Concept checks
1. A tank is at steady state. Which statement must be true?
2. Pond A has V = 10,000 m³ and Q = 1,000 m³/day; pond B has V = 40,000 m³ and Q = 4,000 m³/day. Both start clean and receive the same step in inflow concentration. Which reaches 95 % of the inflow concentration first?
3. A gas is at 50 ppmv in a room. The room warms from 15 °C to 30 °C at constant pressure, with no gas added or removed. What happens?
4. In a mass balance, a pipe discharging 2 kg/day of a chemical directly into the middle of a lake is best treated as:
5. Why can the temperature of a mixed stream be found with the same formula as its concentration?
7Graded quiz, modeling assignment and Problem Set 1
When you can do every practice problem without opening the solution, go to Brightspace → Quizzes → Module 1: Mass and Energy Balance.
- Concentration units, steady-state mixing, the well-mixed tank and the energy balance; numerical questions use different numbers for every student and attempt.
- 2 attempts, highest score counts. Calculator and notes allowed.
Then complete Problem Set 1 (PDF) and the OpenHydroQual Modeling Assignment M1 (guide), and submit both in Brightspace. Build your own spreadsheet or calculations; no starter files are provided. CEE 566 students also complete the graduate problem.
Key equations
Units: \(1\ \text{mg/L} = 1\ \text{g/m}^3 \approx 1\ \text{ppm}_m\) (dilute water); \(C\,[\mu\text{g/m}^3] = C\,[\text{ppm}_v]\,MW \times 1000/V_m\), \(V_m = 24.47\) L/mol at 25 °C, 1 atm.
Mass balance: \(\dfrac{dM}{dt} = \sum Q_{\text{in}}C_{\text{in}} - \sum Q_{\text{out}}C_{\text{out}} + S - L\).
Mixing: \(C_{\text{mix}} = \dfrac{Q_1C_1 + Q_2C_2}{Q_1 + Q_2}\), and the same for \(T\).
Well-mixed tank: \(\tau = V/Q\), \(C(t) = C_{\text{in}} + (C_0 - C_{\text{in}})e^{-t/\tau}\), \(t^* = \tau\ln\dfrac{C_0 - C_{\text{in}}}{C^* - C_{\text{in}}}\).
Heat: \(\dot H = \rho c_p Q\,\Delta T\), \(c_p = 4.186\) kJ/(kg·°C), \(\rho = 1000\) kg/m³.