Bacteria eat the organic waste in a river (biochemical oxygen demand, BOD) and use up dissolved oxygen (DO), while the river re-absorbs oxygen from the air. The classic Streeter-Phelps model tracks the oxygen deficit D = DOsat - DO:
dL/dt = -kd L, dD/dt = kd L - ka D ⇒ D(t) = kd L0/(ka-kd) (e^(-kd t) - e^(-ka t)) + D0 e^(-ka t)
The deficit peaks at the critical time tc = ln[ (ka/kd)(1 - D0(ka-kd)/(kd L0)) ] / (ka-kd): the "oxygen sag". Travel time converts to distance by x = u t. Rates depend on temperature, k(T) = k20 θ^(T-20) (θ = 1.047 for kd, 1.024 for ka), and the saturation DO falls as water warms. The reaeration rate uses the O'Connor-Dobbins formula ka20 = 3.93 u^0.5 / H^1.5 (u in m/s, H in m, result per day): fast and shallow rivers re-aerate faster. Wastewater treatment cuts the BOD load before it is mixed into the river (flow-weighted mixing).
Simplifications: one-dimensional steady plug flow, a single point source, no photosynthesis, sediment oxygen demand, nitrification or dispersion. Fish thresholds (4 and 2 mg/L) are typical guideline values, not species-specific.