EPA SWMM Stormwater & Urban Hydrology (.inp)
@modelscript/swmm (languages/swmm) provides zero-regex parsing, 1D Saint-Venant dynamic wave hydraulic routing, DAE lowering, and Modelica 3.x projection for US EPA Stormwater Management Model (SWMM 5.x) urban drainage, sewer collection, and flood mitigation networks.
Supported Extensions & Standards
| Extension | Format | Description |
|---|---|---|
.inp | EPA SWMM Input File | Industry-standard stormwater network deck (junctions, conduits, outfalls, subcatchments, pumps, weirs, orifices) |
Key Capabilities
1. 1D Saint-Venant Dynamic Wave Routing
- Models open-channel and pressurized sewer hydraulics via the one-dimensional Saint-Venant equations of unsteady flow:
- Conservation of Mass (Continuity):
- Conservation of Momentum:
where is hydraulic head, is friction slope, and is conduit bed slope.
- Conservation of Mass (Continuity):
- Uses Manning's open-channel equation for friction slope:
where is Manning roughness, is flow cross-sectional area, and is hydraulic radius.
2. Node & Link Hydraulic Structures
- Junctions & Storage Units: Continuous water stage mass conservation:
- Conduits: Circular, rectangular, trapezoidal, and irregular natural river cross-sections with entrance/exit minor head loss coefficients.
- Outfalls: Free, normal, tidal, and fixed water elevation boundary conditions.
- Regulators: Orifices, transverse/side-flow weirs, and variable-speed lift pumps.
3. Direct DAE Lowering
- Compiles the entire stormwater collection network into
@modelscript/runtime'sDAEBuilderstruct-of-arrays linear memory arena. - Enables co-simulation of municipal drinking water networks (
@modelscript/epanet) and drainage networks within the same computational arena.
4. Bidirectional Modelica 3.x Projection
- Projects SWMM nodes and channels into
Modelica.Fluidopen-channel tanks, flow conduits, and boundary reservoirs.
Pre-Flight Diagnostics
The SWMM linter verifies network graph integrity and hydraulic feasibility before simulation:
13 rules10 error3 warning Run with msx swmm lint
| Code | Rule | Severity | Message |
|---|---|---|---|
M8201 | dangling-node-reference | error | Link '<linkId>' references undefined <role> node '<nodeId>'. |
M8202 | adverse-conduit-slope | warning | Conduit '<conduitId>' has adverse slope: inlet elevation (<value>) is lower than outlet elevation (<value>). |
M8203 | missing-cross-section | error | Conduit '<conduitId>' has no hydraulic cross-section definition in '[XSECTIONS]'. |
M8204 | unsupported-outfall-type | error | Outfall '<outfallId>' specifies unsupported boundary condition type '<type>'. |
M8205 | surcharge-overflow-risk | warning | Junction '<junctionId>' rim elevation (<value>) is lower than connected conduit crown (<value>), creating surcharge overflow risk. |
M8206 | duplicate-node-id | error | Duplicate node identifier '<nodeId>' declared in network. |
M8207 | duplicate-link-id | error | Duplicate link identifier '<linkId>' declared in network. |
M8208 | negative-roughness | error | Conduit '<conduitId>' specifies non-positive Manning's roughness coefficient (n = <n>). |
M8209 | zero-length-conduit | error | Conduit '<conduitId>' specifies non-positive length (<len>). |
M8210 | isolated-network-node | warning | Junction '<nodeId>' has no connected conduits or hydraulic links (isolated node). |
M8211 | subcatchment-outlet-not-found | error | Subcatchment '<subId>' references non-existent discharge outlet '<outletId>'. |
M8212 | weir-offset-negative | error | Weir '<weirId>' specifies negative crest height offset (<offset>). |
M8213 | invalid-discharge-coefficient | error | Link '<linkId>' specifies non-positive discharge coefficient (Cd = <cd>). |
Generated from languages/swmm/src/errors.ts. All languages →
CLI Usage
bash
# Inspect junctions, conduits, outfalls, and subcatchments
msx swmm inspect UrbanDrainage.inp
# Run pre-flight semantic diagnostics
msx swmm lint UrbanDrainage.inp
# Route steady-state hydraulic flow using Manning formulation
msx swmm route-flow UrbanDrainage.inp
# Lower network topology into ModelScript linear DAE arena
msx swmm to-dae UrbanDrainage.inp
# Project into Modelica 3.x fluid network components
msx swmm to-modelica UrbanDrainage.inp -o StormwaterNetwork.mo
