← CEE 466 / 566 modules
CEE 466 / 566 · Environmental Processes · Module 1

Mass and Energy Balance

Self-paced · about 4 hours · prerequisites: general chemistry (moles, molecular weight) and first-order differential equations

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.

By the end of this module you should be able to:
  1. Express concentrations in mass, molar and mass-fraction units, in water and in air, and convert between them.
  2. Choose a control volume and write the mass balance: accumulation = in − out + sources − sinks.
  3. Solve steady-state mixing problems for concentration and temperature.
  4. Derive and use the solution for an unsteady well-mixed tank (filling and flushing), and interpret the hydraulic residence time.
  5. Write an energy balance for water that is heated, cooled or mixed, and compute heat rates and temperature changes.
  6. 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

requiredBelinda Sturm: Units of Concentration (ppm and %) (4 min).
requiredBelinda Sturm: Units of Concentrations (ppmV) (3 min), gas concentrations and the ideal gas law.

In water

A concentration is an amount of a substance per amount of mixture. Three kinds are used:

Nutrients are often reported "as" an element: nitrate "as N" counts only the nitrogen. To convert, multiply by the ratio of molecular weights:

\[ C_{\text{as N}} = C_{\mathrm{NO_3^-}}\,\frac{14.01}{62.00}, \qquad C_{\text{as N}} = C_{\mathrm{NH_4^+}}\,\frac{14.01}{18.04} \]
Example 1a

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

\[ C\ [\mu\text{g/m}^3] = \frac{C\ [\text{ppm}_v] \times MW\ [\text{g/mol}] \times 1000}{V_m\ [\text{L/mol}]} \]
Example 1b

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

Molar volume at 1 atm
Gas: µg/m³
Water: mol/L
Water: ppm by mass (dilute)

The same ppmv is a different µg/m³ at each temperature

2The mass balance

requiredBelinda Sturm: Mass Balance Basics (15 min).

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.

control volume V mass M = CV in: QinCin out: Q C sources (loads, production) sinks (decay, settling, volatilization)

For any substance in the control volume:

\[ \underbrace{\frac{dM}{dt}}_{\text{accumulation}} = \underbrace{\sum Q_{\text{in}}C_{\text{in}}}_{\text{in}} - \underbrace{\sum Q_{\text{out}}C_{\text{out}}}_{\text{out}} + \underbrace{S}_{\text{sources}} - \underbrace{L}_{\text{sinks}} \]

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:

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

\[ Q_1C_1 + Q_2C_2 = (Q_1 + Q_2)\,C_{\text{mix}} \quad\Longrightarrow\quad C_{\text{mix}} = \frac{Q_1C_1 + Q_2C_2}{Q_1 + Q_2} \]

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

Example 2

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?
The balance is on mass flows, \(QC\). Mixing equal volumes of two waters gives the plain average, but streams contribute in proportion to how fast they deliver water. A small, very concentrated discharge into a large river changes the river only a little, as Example 2 shows.

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

requiredEnvironmental Engineering Tutor: Transient Mass Balance (9 min).

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

\[ \frac{d(CV)}{dt} = QC_{\text{in}} - QC \quad\Longrightarrow\quad \frac{dC}{dt} = \frac{1}{\tau}\,(C_{\text{in}} - C), \qquad \tau = \frac{V}{Q} \]

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

\[ C(t) = C_{\text{in}} + (C_0 - C_{\text{in}})\,e^{-t/\tau} \]

Two special cases:

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^*\):

\[ t^* = \tau\,\ln\frac{C_0 - C_{\text{in}}}{C^* - C_{\text{in}}} \]
Example 3

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

Residence time τ = V/Q
Time to reach C*
C after 1τ, 3τ

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?
Only the ratio \(V/Q\) matters for the shape. Doubling V doubles τ and stretches the curve in time; doubling Q halves τ. The final concentration is \(C_{\text{in}}\) in every case: with no reactions, volume and flow decide only how fast the tank gets there.

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

\[ \rho c_p V\,\frac{dT}{dt} = \rho c_p\sum Q_{\text{in}}T_{\text{in}} - \rho c_p\sum Q_{\text{out}}T + \dot H \]

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:

Example 4a, thermal discharge

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.

Example 4b, mixing temperatures

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.

Example 4c, heating a feed

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?
Heat moves by conduction and through surfaces (to the air, the ground, sunlight), so real water bodies have heat source and sink terms that depend on their area and on the weather. Density and \(c_p\) also change slightly with temperature and dissolved solids. For the mixing and heating problems in this course they are taken as constant.

Mixing calculator: concentration and temperature

Downstream concentration
Downstream temperature
Load (kg/day)
Heat carried above river T (MW)

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.

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

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