Chapter 1 Environmental Engineering: Water Quality Modelling#
1. Introduction#
💧 Water Quality: Importance, Measurement, Regulation, and Modeling#
Water quality refers to the chemical (changes in chemical composition e..g, contamination with harmful chemical (Nitrates, chlorine, acid rain), degradation due to oxidation, imbalance in pH level), physical visible or measurable changes in physical attributes e.g., Temp), and biological characteristics (changes caused by microorganisms or pests e.g., growth of model, bacteria, or fungi, infestation, spoilage due to biological activity) of water, determining its suitability for various uses such as drinking, recreation, agriculture, and industrial processes. Pollution affects human health, the natural ecosystem, the weather, the climate, and the socio-economy. Maintaining high water quality is essential for:
Human health – Preventing waterborne diseases and exposure to toxic substances
Ecosystem integrity – Supporting aquatic life and biodiversity
Economic activities – Ensuring safe water for agriculture, manufacturing, and tourism
Sustainable development – Protecting resources for future generations
Contaminants such as pathogens, heavy metals, nutrients (e.g., nitrogen and phosphorus), and organic pollutants can degrade water quality and pose serious risks. There are different types of water pollution, namely: 1) groundwater pollution, surface water pollution, suspended matter, oil spillage, microbiological pollution, chemical water pollution, thermal pollution, and oxygen-depletion pollution.
Environmental standards (Emission and quality standards; legally binding) and guidelines (recommendations) are effective tools in addressing the water quality issues.
🧪 Measurement of Water Quality#
Water quality is assessed through a combination of field sampling, laboratory analysis, and continuous monitoring. Key parameters include:
Physical: Temperature, turbidity, color, conductivity
Chemical: pH, dissolved oxygen (DO), biochemical oxygen demand (BOD), chemical oxygen demand (COD), nutrients (N, P), heavy metals
Biological: Coliform bacteria, E. coli, algae, macroinvertebrates
Measurement techniques include:
Grab sampling – Collecting discrete water samples for lab analysis
In-situ sensors – Real-time monitoring of parameters like DO, pH, and turbidity
Remote sensing – Satellite or drone-based observation of surface water quality indicators
Biological indices – Using species presence/absence to infer water health
⚖️ Regulatory Framework#
In the United States, the Clean Water Act [United States Environmental Protection Agency, 1972] represents the culmination of a decade-long effort to improve human health and restore aquatic ecosystems. The act aims to ensure that nations’ water is suimmable, drinkable, and fishable. The evolution of the water quality regulatory framework closely mirrors the local and regional imbalances between resource supply and demand. Two dominant philosophical approaches have shaped its development. The first approach is grounded in the belief that addressing pollution is a moral responsibility, necessitating robust federal oversight. It views water pollution as a national issue and advocates for uniform effluent standards to limit discharges from industrial and municipal sources. This perspective led to the establishment of federally mandated water quality goals and enforcement mechanisms. The second approach is more utilitarian, emphasizing the need to maximize social benefit while recognizing the natural capacity of water bodies to assimilate waste—provided they are not overloaded. This framework assumes that water quality issues are local, and therefore, states and communities should play a central role in setting and implementing water quality standards. Together, these perspectives have shaped a regulatory system that balances federal leadership with state-level flexibility, aiming to protect public health, preserve ecological integrity, and support sustainable water resource management.
In the United States, water quality is regulated under several key laws:
Clean Water Act (CWA) – Establishes the framework for regulating discharges of pollutants into U.S. waters and sets water quality standards
Safe Drinking Water Act (SDWA) – Protects public drinking water supplies by setting maximum contaminant levels (MCLs)
National Pollutant Discharge Elimination System (NPDES) – Requires permits for point source discharges
Total Maximum Daily Load (TMDL) – Defines the maximum amount of a pollutant that a water body can receive while still meeting standards
CWA is organized into six titles, each encompassing different aspects of water pollution control (research and related program, grants, standards and enforcement, permits and licenses, general provision, State WPC revolving funds. These titles have a wide range of initiatives (e.g., National water quality standards, technology-based effluent limitation, National pollutant discharge elimination system permitting program. CWA has States develop Water Quality Standards (WQS) and Monitoring Plans, often guided by the EPA, to assess compliance and prioritize restoration efforts.
🧭 Key Steps in the Clean Water Act (CWA)#
The Clean Water Act outlines a structured approach to protecting and restoring water quality in the United States. The main steps include:
Set Water Quality Goals (Water Quality Standards)
Define designated uses for water bodies (e.g., drinking, recreation, aquatic life) and establish numeric and narrative water quality standards to protect those uses.Monitor and Assess Water Quality
Evaluate water bodies by comparing observed conditions to established standards. Impaired waters are identified and listed under Section 303(d).Develop Total Maximum Daily Loads (TMDLs)
For impaired waters, calculate the maximum amount of a pollutant that can be discharged without violating water quality standards, and allocate allowable loads among sources.Manage Point Sources (Section 402 – NPDES)
Regulate discharges from identifiable sources (e.g., industrial facilities, wastewater treatment plants) through the National Pollutant Discharge Elimination System (NPDES). Permits include technology-based and water-quality-based effluent limits.Manage Nonpoint Sources (Section 319)
Address pollution from diffuse sources such as agriculture and urban runoff through voluntary, incentive-based, and state-led programs.Enforce Compliance
Ensure adherence to permits and standards through inspections, monitoring, and enforcement actions, including penalties for violations.
📊 Modeling Water Quality#
While measurement provides ground truth, water quality modeling—based on mathematical equations that incorporate physical, chemical, and biological parameters—has become a widely used approach, especially when direct monitoring is impractical. Modeling is particularly valuable when continuous monitoring is infeasible, predictive insights are needed, scenario analysis is required, or when conducting historical reconstruction and gaining system-level understanding. Water quality modeling is a powerful tool for understanding, predicting, and managing aquatic systems. Models simulate the transport, transformation, and fate of pollutants within water bodies, helping stakeholders evaluate current conditions and forecast future impacts. However, models are inherently limited by their assumptions, require careful calibration and validation, and often involve simplifications of complex environmental processes. Common modeling approaches include:
Empirical models – Rely on observed data and statistical relationships
Mechanistic models – Use physical and chemical equations to simulate environmental processes
Hydrodynamic models – Simulate flow, mixing, and transport in rivers, lakes, and estuaries
Watershed models – Predict runoff, erosion, and pollutant loading from land surfaces
Popular models include:
QUAL2K/QUAL2E – Stream water quality modeling
Streeter–Phelps Water Quality Modeling#
The Streeter-Phelps model is used to simulate the balance of dissolved oxygen (DO) in a river following the discharge of organic-rich wastewater [Davis and Cornwell, 2013, Masters and Ela, 2008, Mihelcic, 1999]. It captures the interplay between:
Microbial oxygen demand (due to decomposition of organic matter)
Reaeration (oxygen diffusion from the atmosphere into the water)
When wastewater is discharged into a river:
It introduces organic matter (e.g., BOD load).
This stimulates the growth of aerobic microorganisms.
Microbes consume dissolved oxygen to break down the organic material.
This leads to a decline in DO concentration downstream — known as the oxygen sag.
Over time, reaeration from the atmosphere replenishes oxygen.
The DO level eventually recovers, forming a DO sag curve.
📐 Governing Equation#
The classic Streeter-Phelps equation for DO deficit \(( D(t) \)) at time \(( t \)) is:
\( D(t) = \frac{k_d L_0}{k_r - k_d} \left( e^{-k_d t} - e^{-k_r t} \right) \)
Where:
\(( D(t) \)): DO deficit at time \(( t \))
\(( L_0 \)): Initial BOD concentration
\(( k_d \)): Deoxygenation rate constant
\(( k_r \)): Reaeration rate constant
The actual DO concentration is:
\( DO(t) = DO_{\text{sat}} - D(t) \)
📘 DO Deficit Equation#
Let:
\(( D_0 \)): Initial DO deficit in the river (mg/L)
\(( L_0 \)): Initial BOD concentration from the wastewater (mg/L)
\(( k_d \)): Deoxygenation rate constant (1/day)
\(( k_r \)): Reaeration rate constant (1/day)
Then the DO deficit at time \(( t \)) is:
This equation accounts for both:
The decay of the initial deficit ( D_0 )
The oxygen demand from the new BOD load ( L_0 )
⏱️ Critical Time for Minimum DO#
The critical time \(( t_c \)) (when DO is lowest) is now given by:
This expression reduces to the classic form when \(( D_0 = 0 \)).
⏱️ Critical Time for Minimum DO#
The critical time \(( t_c \)) is when the DO reaches its minimum value. It occurs where the rate of deoxygenation equals the rate of reaeration:
\( t_c = \frac{1}{k_r - k_d} \ln\left( \frac{k_r}{k_d} \right) \)
This time corresponds to the lowest point on the DO sag curve.
The minimum DO is:
Substitute \(( t_c \)) into the modified deficit equation:
–
🧠 Conceptual Insight#
\(( t_c \)) depends only on the rate constants \(( k_d \)) and \(( k_r \))
A higher \(( k_r \)) (more turbulence, faster reaeration) leads to faster recovery
A higher \(( k_d \)) (more organic load) leads to deeper oxygen sag
The lowest DO point (critical DO) occurs where oxygen consumption exceeds atmospheric replenishment.
The location and severity of the DO sag depend on:
Organic load
Flow velocity
Temperature
Turbulence (affects \(( k_r \)))
📊 Key Parameters#
Parameter |
Description |
---|---|
\(( L_0 \)) |
Initial BOD load (mg/L) |
\(( k_d \)) |
Deoxygenation rate (1/day) |
\(( k_r \)) |
Reaeration rate (1/day) |
\(( DO_{\text{sat}} \)) |
Saturation DO concentration (mg/L) |
🧪 Applications#
Designing wastewater discharge permits
Modeling river self-purification
Assessing aquatic ecosystem health
Planning aeration interventions
Foundational Literature#
[Davis and Cornwell, 2013], [Masters and Ela, 2008],[Mihelcic, 1999] —provide foundational coverage of the Streeter-Phelps model for dissolved oxygen dynamics in streams and rivers. [Masters and Ela, 2008] and [Davis and Cornwell, 2013] introduce the theory and kinetics of Biochemical Oxygen Demand (BOD), including oxygen sag modeling and its role in water quality engineering. It provides quantitative tools for analyzing pollutant decay and designing wastewater treatment systems.
2. Simulation#
This notebook provides an interactive simulation of the classic Streeter–Phelps oxygen sag model, a fundamental tool in environmental engineering and water quality analysis. It allows users to visualize and assess the impact of wastewater discharges on the dissolved oxygen (DO) profile of a river system, accounting for organic loading, deoxygenation, reaeration, and temperature effects.
Capabilities#
✅ Simulate DO depletion and recovery using Streeter–Phelps equations
✅ Adjust key environmental and wastewater parameters interactively:
Initial BOD load (L₀)
Deoxygenation rate (Kₙ)
Reaeration rate (Kᵣ)
River and wastewater temperatures
DO saturation level
Minimum DO requirement (regulatory threshold)
Flow velocity to estimate the downstream distance
✅ Automatically computes:
🕒 Time to critical DO (DOₘᵢₙ)
📍 Distance to critical point (km)
📉 Minimum DO concentration
⚠️ Warning if the DO falls below the safe threshold
🔧 Treatment recommendation: required BOD removal for compliance
Educational Outcomes#
By using this tool, students and engineers can:
Explore how temperature, flow rate, and treatment level affect DO levels in a river
Understand the interplay between decay of organic matter and oxygen replenishment
Identify the critical location where aquatic life is most at risk
Optimize BOD removal targets prior to discharge to ensure environmental compliance
import numpy as np
import matplotlib.pyplot as plt
from ipywidgets import interact, FloatSlider
from IPython.display import display
def arrhenius_k(k20, T, theta=1.047):
return k20 * theta ** (T - 20)
def streeter_phelps(t, L0, kd, kr, DO_sat):
D = (kd * L0 / (kr - kd)) * (np.exp(-kd * t) - np.exp(-kr * t))
DO = DO_sat - D
return D, DO
def plot_sag_critical(
BOD_input, DO_sat, DO_min_allowed,
T_ww, T_river, v,
kd20, kr20
):
# Time domain
t = np.linspace(0.01, 30, 500) # Avoid t=0 to prevent division issues
# Adjust decay rates using Arrhenius equation
kd = arrhenius_k(kd20, T_ww)
kr = arrhenius_k(kr20, T_river)
# Compute DO deficit and concentration
D, DO = streeter_phelps(t, BOD_input, kd, kr, DO_sat)
# Find critical time and distance
t_crit = t[np.argmax(D)]
D_crit = np.max(D)
DO_crit = DO_sat - D_crit
x_crit = v * t_crit # assuming v is in km/day
# Determine if DO_crit meets standard
status = "✅ Satisfactory" if DO_crit >= DO_min_allowed else "❌ Below Standard"
# Treatment suggestion
if DO_crit < DO_min_allowed:
L0_required = ((kr - kd) * (DO_sat - DO_min_allowed)) / (kd * (np.exp(-kd * t_crit) - np.exp(-kr * t_crit)))
BOD_to_remove = BOD_input - L0_required
treatment_msg = f"🔧 Recommended: Remove at least {BOD_to_remove:.2f} mg/L BOD before discharge."
else:
treatment_msg = "✅ No additional BOD removal required to meet DO standard."
# Plot
plt.figure(figsize=(10, 5))
plt.plot(t, DO, label="DO (mg/L)", color='teal')
plt.axhline(DO_min_allowed, color='orange', linestyle=':', label=f"Minimum DO ({DO_min_allowed} mg/L)")
plt.scatter(t_crit, DO_crit, color='red', zorder=5, label=f"Critical DO ≈ {DO_crit:.2f} mg/L")
plt.title("📉 Streeter–Phelps Oxygen Sag Curve with Critical Point")
plt.xlabel("Time (days)")
plt.ylabel("Dissolved Oxygen (mg/L)")
plt.grid(True, linestyle='--', alpha=0.5)
plt.legend()
plt.tight_layout()
plt.show()
print(f"🧭 Critical time: {t_crit:.2f} days")
print(f"📍 Critical distance: {x_crit:.2f} km")
print(f"💧 Critical DO: {DO_crit:.2f} mg/L → {status}")
print(treatment_msg)
# 🎛️ Interactive sliders
interact(
plot_sag_critical,
BOD_input=FloatSlider(value=30, min=5, max=60, step=1, description="BOD₀ (mg/L)"),
DO_sat=FloatSlider(value=9.0, min=6.0, max=12.0, step=0.1, description="DO_sat (mg/L)"),
DO_min_allowed=FloatSlider(value=5.0, min=2.0, max=7.0, step=0.1, description="Minimum DO"),
T_ww=FloatSlider(value=25.0, min=10.0, max=35.0, step=1, description="WW Temp (°C)"),
T_river=FloatSlider(value=20.0, min=5.0, max=30.0, step=1, description="River Temp (°C)"),
v=FloatSlider(value=1.0, min=0.2, max=5.0, step=0.1, description="Flow speed (km/day)"),
kd20=FloatSlider(value=0.2, min=0.05, max=0.5, step=0.01, description="Kₙ @20°C"),
kr20=FloatSlider(value=0.4, min=0.05, max=1.0, step=0.01, description="Kᵣ @20°C")
)
<function __main__.plot_sag_critical(BOD_input, DO_sat, DO_min_allowed, T_ww, T_river, v, kd20, kr20)>
3. Self-Assessment#
Educational Module – Streeter–Phelps Water Quality Model#
This self-assessment module is designed to accompany the Streeter–Phelps oxygen sag curve simulation. Use these prompts to deepen your understanding of water quality dynamics and critically evaluate your model-based insights.
Conceptual Questions#
What physical processes are represented by the terms “deoxygenation” and “reaeration” in the Streeter–Phelps model?
Why does the DO curve initially decrease and then recover downstream from a pollution source?
How does the river’s flow velocity affect the distance to the critical DO point?
Why are separate water temperatures used for calculating ( K_d ) and ( K_r ) in the model?
What assumptions does the Streeter–Phelps model make about river geometry, mixing, and pollutant distribution? When might these assumptions fail?
Reflective Prompts#
In your simulation, under what conditions did the critical DO point occur furthest downstream? What physical processes contributed to this?
What could be the ecological or regulatory consequences if the DO falls below the minimum required level?
How might increasing river temperature simultaneously impact deoxygenation and reaeration? What does this mean for water quality under climate change?
How can this model guide treatment decisions or regulatory compliance for a municipal discharge?
If a river had multiple discharge points, how could this model be extended to account for cumulative oxygen impacts?
Quiz Questions#
Q1. What does \(( K_d \)) represent in the Streeter–Phelps model?
A. Reaeration coefficient
B. Deoxygenation rate constant
C. Velocity of river flow
D. Saturation DO concentration
✅ Correct Answer: B
Q2. The critical point in the DO curve occurs when:
A. DO deficit is zero
B. Oxygen input equals consumption
C. Temperature is highest
D. Distance from the source is minimal
✅ Correct Answer: B
Q3. Increasing the temperature of the river will generally:
A. Lower the saturation DO and increase both \(( K_d \)) and \(( K_r \))
B. Increase the saturation DO
C. Decrease deoxygenation and reaeration rates
D. Eliminate the critical point entirely
✅ Correct Answer: A
Q4. If the DO at the critical point is lower than the regulatory minimum, the model:
A. Suggests increasing river depth
B. Identifies required BOD removal at the discharge
C. Computes the new saturation DO
D. Eliminates oxygen deficit
✅ Correct Answer: B
Q5. Which of the following does not affect the location of the critical DO point?
A. Initial BOD load
B. River flow speed
C. Riverbank slope
D. Reaeration rate
✅ Correct Answer: C