9. Run and engines

9.1 Engines

An engine is EPA's command-line runner, runswmm.exe on Windows or runswmm elsewhere, found on disk as §1.2 describes. Each is identified by the version it reports to --version and by the SHA-256 of the executable file, and both are stamped into every run. The Run menu lists them as EPA SWMM 5.2.4 — 32-bit (x86); the SWMM panel adds runs out-of-process when the architecture differs from AquaSWMM's.

Several may be registered — 5.1.015 beside 5.2.4, or a 64-bit build you compiled beside EPA's 32-bit one — and the chosen engine is the one F5 uses. Find Engines (Run menu and panel) rescans. The choice persists for the session.

AquaSWMM never modifies an engine, links to it, or patches its results. What EPA ships is what runs.

9.2 Running

Run (F5, the toolbar button, Run → Run, or Run Model in the panel) does, in order:

  1. Validates the document. Error-level findings refuse the run with The model has errors; the list is clickable (§3.11). Warning-level findings show once, per document state, as Warnings before running — the same window as Run → Check Model… — with Run anyway and Cancel; once you have run anyway, the same warnings do not ask again until the model changes.
  2. Decides which file to run. A saved, clean model on an ASCII path runs in place. Otherwise — unsaved, dirty, or a path with characters outside ASCII, which the stock engine may not open — a scratch copy of the current text is written under %TEMP%\AquaSWMM\run\<hash>\, with the model's [FILES] and data files carried along so their relative paths still resolve, and that copy runs. The report and results land beside whichever file ran, and the Run Status window says which (Model read, Ran a scratch copy). A model with ARM subcatchments always runs a scratch copy, with their hydrographs as node inflows (§24.8).
  3. Deletes any stale .rpt and .out beside it, because runswmm appends to an existing report and a run that dies without writing could otherwise be mistaken for a success.
  4. Starts the engine on a worker thread with inp rpt out as arguments and waits. The window stays responsive; the toolbar shows a spinner and the panel says running…. Nothing else in the app runs in the background.
  5. Reads the report. runswmm exits 0 whether the run worked or not, so the exit code is recorded for the log and ignored for the verdict. A run succeeded when the report has no ERROR line and a non-empty .out exists.
  6. Reads the .out metadata (periods, step, object counts, flow units, start date) and computes the peaks for the map.
  7. Copies the run into %TEMP%\AquaSWMM\runs\<n>\ for Compare Runs; the last ten are kept.

Stop (Run menu, the SWMM panel, or the Live Results window) kills the engine and keeps the partial .rpt and .out; see chapter 23.

The Run menu also holds Check Model… (the QA pass on demand — the findings grouped as Errors — the engine will refuse or misread the model and Warnings — the model runs, but check these, each clickable to select the object) and Autosave every N min (0 = off; §1.6).

9.3 The SWMM panel

Under the Project/Layers tabs:

9.4 The Run Status window

When a run finishes, Results → Run Status… opens by itself with the whole story of the run in one window:

The Run Status window after running the Detention Pond model, with the results overlay on the map behind it

Help → SWMM Error Codes… lists the whole index — 112 codes from the EPA SWMM 5.2 User's Manual, with causes and fixes drawn from what the forum threads show people needed — with a Search box. Appendix C.

9.5 Reading the report

The report (.rpt) is the only place the engine says whether the run was any good. AquaSWMM parses:

worst continuity is the largest absolute value across the sections, and a non-finite value outranks every finite one. What the number means and what to do about it is §16.1.

9.6 ALR checks

Tools → ALR Checks (or Run ALR Checks) runs the ALR post-processor on a finished run. ALR is a separate Python package that reads the .out and the .inp beside it and evaluates conditions the engine's own report does not. AquaSWMM finds it through AQUASWMM_ALR_SCRIPT (the path to run_headless_swmm.py) and AQUASWMM_ALR_PYTHON (the interpreter, when it is not python), runs python run_headless_swmm.py <model.out> --json, and shows the verdict: a one-line summary and each failed check with its node and message. Without those variables the item does nothing useful. The .inp must be beside the .out, which a AquaSWMM run guarantees.

9.7 The command-line runner

The same engine registry, report parser and result reader are in aquaswmm-swmm, a command-line tool built with the app:

aquaswmm-swmm engines
aquaswmm-swmm run <model.inp> [--engine <id>] [--alr]
aquaswmm-swmm info <model.out>
aquaswmm-swmm series <model.out> (--node <name> | --link <name>) [--var <variable>]
aquaswmm-swmm report <model.rpt>
aquaswmm-swmm alr <model.out> [--nodes a,b] [--top N] [--all]
aquaswmm-swmm inp <model.inp>
aquaswmm-swmm compare <a.out> <b.out> [--inp <model.inp>] [--tol X] [--top N]
aquaswmm-swmm froude <model.out> [--inp <model.inp>] [--top N]
aquaswmm-swmm merge <model.inp> <other.inp> -o <merged.inp>

Unlike runswmm, it exits non-zero when a run fails — or finishes with a nan/inf continuity error, printed as NOT VALID: … — so it can drive a batch. report exits non-zero on the same two conditions. inp parses a model losslessly, proves the round trip, lists its sections and prints the validator's findings.

compare tabulates the peak differences between two results files — node max depth, total inflow and flooding; link max flow, velocity and fraction full — with the largest differences named. It is how a model already run in PCSWMM or the EPA GUI is checked here: run the .inp, then compare their .out with this one. Given the model (--inp, or a .inp beside the first file), a PCSWMM 1D-2D model's [TAGS] split every table into 1D nodes, 2D cells, Connect2D nodes, 1D links, 1D-2D coupling links and 2D-2D links, which is where two runs of a 2D model usually part ways. It exits non-zero when any difference exceeds --tol (default 1e-6).

froude lists the links with the highest Froude number at their peak flow, with the largest at any time beside it, and counts the links that were supercritical at peak flow. The method is the one in §10.3. The shapes come from --inp, or the .inp beside the .out.

merge is File → Merge Model… without the app (§13.6). It writes the merged model to -o and prints the account of renames, shared and kept objects, and what was left out. It exits non-zero, writing nothing, when the merge is refused.

Node variables are depth head volume lateral-inflow total-inflow flooding; link variables flow depth velocity volume capacity.

9.8 What the runner does not do