HydroCouple Logo

OpenSWMM#

Open Storm Water Management Model — Python bindings.

OpenSWMM is a community-driven, open-source continuation of the EPA Storm Water Management Model (SWMM) — a dynamic hydrology / hydraulics / water quality simulation model used for single-event and long-term simulation of runoff quantity and quality from primarily urban areas.

The openswmm package ships two engines that share the same package namespace:

OpenSWMM 6 — Refactored Engine

openswmm.engine

The new reentrant C++20 engine. Domain-split API (Nodes, Links, Forcing, Controls, …), bulk numpy accessors, programmatic model construction, in-place editing, plugin SDK. Recommended for all new work.

Legacy SWMM 5 — Compatibility Layer

openswmm.legacy.engine and openswmm.legacy.output

The original EPA SWMM 5.x solver and binary-output reader, preserved verbatim for backward compatibility with existing scripts. No new development; bug fixes only.

If you are coming from a SWMM 5 codebase, see Migrating from SWMM 5 to v6 for a side-by-side translation.


Where to start#

New to OpenSWMM

A 10-minute walkthrough using the v6 engine: install, run, query, plot.

Coming from SWMM 5?

Side-by-side translation guide.

User Guide

Topic-by-topic guides for every domain class in the v6 engine.

API Reference

Full class & method reference, generated from the Cython type stubs. Both engines.



Project at a glance#

Audience

Hydrologists, stormwater engineers, researchers, app developers.

Engines

OpenSWMM 6 (reentrant C++20, openswmm.engine) and the preserved SWMM 5.x solver (openswmm.legacy.engine).

Language

Python ≥ 3.9 with NumPy ≥ 1.21 (NumPy 2.x supported).

Platforms

macOS (arm64 + x86_64), Linux (x86_64 + aarch64), Windows (x64).

Build system

scikit-build-core + CMake + Cython.

License

MIT.