An Offline Chlorine Dosing Calculator for Water Main and Tank Disinfection

The Problem

Disinfecting a new water main or storage tank is a small arithmetic problem wrapped in a big consequences problem. AWWA C651 and C652 tell you the target dose — 25 mg/L continuous feed, 100 mg/L for a slug, 10 mg/L to fill a tank — but the number the crew actually needs is how many gallons of bleach go in the tap. Under-dose and the segment fails its bacteriological sample and you flush and start over. Over-dose and you have created a dechlorination and discharge headache that the SWPPP now cares about [1].

The conversion is not hard, but it is exactly the kind of thing that gets done wrong on a phone at the bottom of a trench with one bar of signal, from a formula half-remembered off a laminated card. I wanted a single page that does the whole chain — volume, chlorine mass, product quantity — and keeps my last inputs when the browser inevitably gets killed.

The Approach

Everything hangs off the “pounds formula.” A gallon of water weighs 8.34 lb, so dosing one part per million into a million gallons takes 8.34 lb of available chlorine:

lb Cl₂ = V (MG) × dose (mg/L) × 8.34

Pipe volume comes from the geometry, V = (π/4)(d/12)² × L × 7.4805 gal, which is the same thing as the field shortcut V ≈ 0.0408 · d² · L. From the required chlorine mass you divide by the product strength to get gallons of liquid hypochlorite or pounds of granular cal-hypo. The one wrinkle worth stating out loud: 12.5% sodium hypochlorite delivered to the drum is not 12.5% by the time it has sat in the yard in July, so the tool lets you dial the real strength in.

The pipeline tab of the calculator showing segment volume, available chlorine required, and gallons of sodium hypochlorite to inject
Figure 1: The pipeline (C651) tab converting a 12-inch main segment straight through to gallons of hypochlorite.

It ended up as four tabs: pipeline (C651), tank (C652), a generic batch-solution mixer for spray and swab solutions, and a dechlorination tab that reproduces the C651 neutralization table so you can size the sulfite or thiosulfate for the flush water before it hits the ground [1][4].

The dechlorination rates baked in (lb chemical per mg/L residual per 100,000 gal)
Sulfur dioxide          0.8 lb
Sodium bisulfite        1.2 lb
Sodium sulfite          1.4 lb
Sodium thiosulfate      1.2 lb
Ascorbic acid           2.1 lb

These are stoichiometric. Thiosulfate in particular reacts slowly at low pH, so the field habit is to add some excess and confirm non-detect with a test kit before releasing — the tool sizes the theoretical minimum, not the field pour.

The whole thing is a single HTML file with vanilla JS and no dependencies; inputs persist in localStorage and nothing leaves the browser. It is a field arithmetic aid, not the disinfection plan — the contract spec and the standard still govern contact time, residuals, and sampling.

The tool: Chlorine Dosing & Disinfection Calculator.

References

  1. [1] AWWA C651 — Disinfecting Water Mains. https://www.awwa.org/
  2. [2] AWWA C652 — Disinfection of Water-Storage Facilities.
  3. [3] AWWA C653 — Disinfection of Water Treatment Plants.
  4. [4] AWWA C655 — Field Dechlorination.