Lesson 39 (Capstone 3): Subsurface Remediation — Ogata–Banks erfc Plume Breakthrough & Aquifer Retardation

Courses Integrated: Heat & Mass Transfer (Module 7 Mass Diffusivity) · Pre-Calculus & Calculus I · Hydrogeology & Geostatistics
Companion Datasets: HMT_Diffusivity_Henry_Solubility.csv

Governing Subsurface Transport Model

When a landfill or leaky storage tank releases organic solvents (TCE, Benzene) into groundwater moving at Darcy pore velocity \(v_x = \frac{K i}{n}\), sorption onto organic aquifer soil slows the chemical front by Retardation Factor \(R\): \[R = 1 + \frac{\rho_b K_d}{n}, \qquad v_c = \frac{v_x}{R}, \qquad D^* = \frac{D_L}{R}\] With longitudinal dispersion \(D_L = \alpha_L v_x + D_{\text{eff}}\), the exact 1D Ogata–Banks analytical solution for continuous source \(C_0\) uses scipy.special.erfc: \[\frac{C(x,t)}{C_0} = \frac{1}{2}\left[\operatorname{erfc}\!\left(\frac{x - v_c t}{2\sqrt{D^* t}}\right) + \exp\!\left(\frac{v_c x}{D^*}\right)\operatorname{erfc}\!\left(\frac{x + v_c t}{2\sqrt{D^* t}}\right)\right]\]

from pathlib import Path
def data_file(name):
    """Locate a dataset file whether running from SRC_DIR, module folder, HOMEWORK, or EXAMS."""
    for p in [
        Path("datasets") / name,
        Path("../datasets") / name,
        Path("../../datasets") / name,
    ]:
        if p.exists():
            return p
    raise FileNotFoundError(f"Missing dataset {name} in datasets/")
import numpy as np
import pandas as pd
from scipy.special import erfc
from scipy.optimize import brentq
import matplotlib.pyplot as plt

# Sandy Aquifer Parameters
K_hyd, grad_i, porosity_n, rho_bulk = 12.0, 0.016, 0.32, 1750.0  # m/d, -, -, kg/m^3
v_pore = K_hyd * grad_i / porosity_n    # 0.60 m/day groundwater seepage!
alpha_L = 1.65                          # Longitudinal dispersivity [m]
C0_source = 50.0                        # Continuous landfill leachate source [mg/L]

def ogata_banks(x_m, t_d, Kd_m3_kg):
    R = 1.0 + (rho_bulk * Kd_m3_kg) / porosity_n
    vc = v_pore / R
    D_star = (alpha_L * v_pore) / R
    t_safe = np.maximum(t_d, 1e-6)
    z1 = (x_m - vc * t_safe) / (2.0 * np.sqrt(D_star * t_safe))
    z2 = (x_m + vc * t_safe) / (2.0 * np.sqrt(D_star * t_safe))
    # Safe evaluation avoids exp(huge)*erfc(huge)=inf*0 NaN when Pe >> 100!
    term1 = 0.5 * erfc(z1)
    arg_exp = (vc * x_m) / D_star
    term2 = np.where(arg_exp < 500.0, 0.5 * np.exp(np.minimum(arg_exp, 500.0)) * erfc(z2), 0.0)
    return C0_source * (term1 + term2), R, vc

t_days = np.linspace(1.0, 1800.0, 300)
species = [
    ("Chloride Tracer (Kd=0)",     0.0,     "#0284c7", "-"),
    ("Benzene (Kd=1.8e-4 m^3/kg)", 1.8e-4,  "#d97706", "--"),
    ("TCE (Kd=4.2e-4 m^3/kg)",     4.2e-4,  "#dc2626", "-."),
]

fig, ax = plt.subplots(figsize=(7.8, 4.2))
print("=== Monitoring Well (x = 120 m Downgradient) Breakthrough Audit ===")
for label, kd_v, col, ls in species:
    c_curve, R_val, vc_val = ogata_banks(120.0, t_days, kd_v)
    t_5ppb = brentq(lambda td: ogata_banks(120.0, td, kd_v)[0] - 0.005, 1.0, 3000.0)
    print(f"  {label:<28s} | R={R_val:4.2f} | vc={vc_val:.3f} m/d | First 5 ug/L MCL hit @ Day {t_5ppb:5.1f}")
    ax.plot(t_days, c_curve, color=col, ls=ls, lw=2.3, label=f"{label} (R={R_val:.2f})")

ax.axhline(25.0, color="#64748b", ls=":", lw=1.2, label="50% Advective Front (25 mg/L)")
ax.set_title("Ogata-Banks Groundwater Breakthrough @ Well x = 120 m (With Inf*0 Guard)")
ax.set_xlabel("Time Since Release [days]"); ax.set_ylabel("Well Concentration [mg/L]")
ax.grid(True, alpha=0.3); ax.legend(fontsize=8.5); fig.tight_layout()
Subsurface Remediation — Ogata–Banks erfc Plume Breakthrough & Aquifer Retardation Output Plot 1
=== Monitoring Well (x = 120 m Downgradient) Breakthrough Audit ===
  Chloride Tracer (Kd=0)       | R=1.00 | vc=0.600 m/d | First 5 ug/L MCL hit @ Day 107.8
  Benzene (Kd=1.8e-4 m^3/kg)   | R=1.98 | vc=0.302 m/d | First 5 ug/L MCL hit @ Day 213.9
  TCE (Kd=4.2e-4 m^3/kg)       | R=3.30 | vc=0.182 m/d | First 5 ug/L MCL hit @ Day 355.3

Watch Out! Classic exp(large) * erfc(large) = NaN Overflow Trap

Notice that line np.where(arg_exp < 500.0, ...) inside ogata_banks! At \(x = 120\text{ m}\) and \(\alpha_L = 1.65\text{ m}\), Peclet number \(vx / D \approx 73\)—at longer \(x = 1500\text{ m}\), np.exp(900) * erfc(...) evaluates inf * 0 = NaN in IEEE floating-point unless guarded!


Concept Check Questions

  1. Why did Chloride arrive at the monitoring well \(3.3\times\) earlier than TCE?
  2. Notice the 5 ppb (\(0.005\text{ mg/L}\)) EPA drinking-water violation occurs long before the center of mass \(t_{50} = x / v_c\): what physical process spreads trace contaminants ahead of the average front?
  3. Link to Heat & Mass Transfer Module 7: how does organic solvent vapor pressure / Henry’s constant govern soil vapor extraction (SVE)?

Guided Practice Problem 1: Cleanup Compliance Barrier Well Distance

At \(t = 500\text{ days}\), evaluate TCE concentration across \(x \in [10, 300]\text{ m}\) (Kd = 4.2e-4 m^3/kg), and find the exact furthest downgradient distance x_safe where concentration remains at 0.005 mg/L (5 ppb MCL) using brentq!

# Guided Practice 1 Starter
x_mcl_500 = brentq(lambda xm: ogata_banks(xm, 500.0, 4.2e-4)[0] - 0.005, 5.0, 500.0)
print(f"Day 500 TCE 5 ug/L Plume Edge has already reached x = {x_mcl_500:.1f} m downgradient!")
Day 500 TCE 5 ug/L Plume Edge has already reached x = 156.5 m downgradient!