Environmental Chemistry: pH, Oxygen, BOD & Equilibria

The chemistry behind water and air quality. Learn concentration units, pH and acid–base equilibria, the carbonate system and alkalinity, hardness, dissolved oxygen and temperature, BOD, COD and TOC, first-order BOD kinetics, nitrogen and phosphorus, Henry's law and gas transfer, and natural rain pH — with Python for BOD, DO saturation and rainwater pH.

Whether a river supports fish, whether water is safe to drink, and whether a treatment process works all depend on chemistry: how acidic the water is, how much oxygen it holds, how much organic matter bacteria will consume, and how gases move between air and water.

Environmental engineers measure these parameters daily and use simple equilibrium and kinetic models to design treatment and predict impacts.

An analogy

BOD is like a restaurant bill for the river's bacteria: the more organic 'food' in the water, the more oxygen they 'spend' eating it — and if the bill exceeds the river's oxygen budget, fish suffocate.

Key water-quality parameters

Routinely measured:

Acids, bases and the carbonate system

CO₂ dissolves to carbonic acid, which dissociates to bicarbonate and carbonate; these species buffer natural waters. Alkalinity (mostly bicarbonate) measures the capacity to neutralise acid; hardness (Ca²⁺, Mg²⁺) causes scaling. Coagulation, softening, corrosion control and nitrification all depend on pH and alkalinity.

Oxygen demand

BOD measures oxygen consumed by microbes degrading organics (5 days, 20 °C); COD uses strong chemical oxidation (fast, includes non-biodegradable matter); TOC measures organic carbon directly. Domestic sewage has BOD₅ ≈ 200–300 mg/L; secondary treatment reduces it below 20–30 mg/L. Nitrogenous BOD from ammonia oxidation adds demand later.

Gas transfer and chemical fate

Henry's law governs the air–water partitioning of O₂, CO₂, H₂S and volatile organics — the basis of aeration, air stripping and volatilisation. Two-film theory gives transfer rates (K_La). Other fate processes: sorption (K_d, K_oc), photolysis, hydrolysis, redox reactions (Eh–pH diagrams for metals), and bioaccumulation (octanol–water partition K_ow).

Formulas

Worked example: Ultimate BOD

Given: BOD₅ = 200 mg/L, k = 0.23/d

Find: L₀.

Answer: 293 mg/L

Worked example: Hardness

Given: Ca²⁺ 60 mg/L, Mg²⁺ 12 mg/L

Find: Total hardness.

Answer: 199 mg/L as CaCO₃ (hard water)

Worked example: pH

Given: [H⁺] = 3.2 × 10⁻⁶ M

Find: pH.

Answer: 5.49

BOD kinetics, DO saturation and rainwater pH

import math
# BOD: first-order exertion, ultimate BOD from BOD5
BOD5, k = 200.0, 0.23              # mg/L, 1/day (base e)
L0 = BOD5 / (1 - math.exp(-5 * k))
print(f"ultimate BOD L0 = {L0:.0f} mg/L; BOD remaining after 10 days {L0*math.exp(-10*k):.0f} mg/L")
# Saturation DO vs temperature (approximate APHA fit, fresh water)
def DOsat(T):
    return 14.652 - 0.41022 * T + 0.0079910 * T**2 - 0.000077774 * T**3
for T in (10, 20, 30):
    print(f"DO saturation at {T} C = {DOsat(T):.2f} mg/L")
# Henry's law: CO2 in rain at 420 ppm, KH = 0.034 mol/(L*atm) -> pH of rain
KH, pCO2, Ka1 = 0.034, 420e-6, 4.45e-7
H2CO3 = KH * pCO2
H = math.sqrt(Ka1 * H2CO3)
print(f"natural rain pH = {-math.log10(H):.2f}")
# ultimate BOD L0 = 293 mg/L; BOD remaining after 10 days 29 mg/L
# DO saturation at 10 C = 11.27 mg/L
# DO saturation at 20 C = 9.02 mg/L
# DO saturation at 30 C = 7.44 mg/L
# natural rain pH = 5.60

BOD₅ is only ~68% of the total oxygen demand here. Warm water holds much less oxygen — why summer fish kills happen. Even unpolluted rain is slightly acidic (pH 5.6) from dissolved CO₂; 'acid rain' means pH below that, from SO₂ and NOₓ.

Common mistakes

Applications

Key takeaways

Going further