SWMM5 Runoff Engine — Complete Explorer

Three Runoff Surfaces · Cash-Karp RK5 ODE Solver · Animated Subcatchment · Design Storms

subcatch.c — 3 surfaces odesolve.c — Cash-Karp RK5 runoff.c · infil.c · gage.c
🇺🇸 US Customary (ft, in, ac, cfs)
🌍 SI Metric (m, mm, ha, m³/s)
Hydrology/Runoff
Infiltration
ODE Solver
Routing
Core Engine

SWMM5 Runoff Computation Call Graph

The Nonlinear Reservoir — Three Surfaces (subcatch.c) SWMM5 splits each subcatchment into A1, A2, A3: A1 Imperv (no DS): dd₁/dt = i(t) − q₁(d₁) d_s = 0 A2 Imperv (w/ DS): dd₂/dt = i(t) − e(t) − q₂(d₂) d_s > 0 A3 Pervious: dd₃/dt = i(t) − e(t) − f(t) − q₃(d₃) d_s > 0, infiltration Outflow: qⱼ = Wⱼ · (1.49/nⱼ) · (dⱼ − d_sⱼ)^(5/3) · S^(1/2) [Manning's overland flow] Total Q = q₁ + q₂ + q₃ ODE Solution (odesolve.c): Each surface depth solved independently via Cash-Karp RK5. 6 function evaluations per step, embedded 4th/5th order error estimate, adaptive step-size.

Cash-Karp RK5 Adaptive Solver — odesolve.c

SWMM5 solves each surface's depth ODE with a 5th-order Runge-Kutta (Cash-Karp variant). Six stages k₁…k₆ are evaluated per step. The difference between 5th and 4th order solutions gives a truncation error estimate for adaptive step-size control.

k₁
k₂
k₃
k₄
k₅
k₆
Cash-Karp Butcher Tableau (odesolve.c) 0 | 1/5 | 1/5 3/10 | 3/40 9/40 3/5 | 3/10 −9/10 6/5 1 |−11/54 5/2 −70/27 35/27 7/8 | 1631/55296 175/512 575/13824 44275/110592 253/4096 ──────────────────────────────────────────────────────────── 5th: 37/378 0 250/621 125/594 0 512/1771 4th: 2825/27648 0 18575/48384 13525/55296 277/14336 1/4
Step-Size Control (odesolve.c) // Truncation error estimate err = max |y₅[i] − y₄[i]| / (|y₅[i]| + TINY) if (err > TOL) { h_new = SAFETY · h · err^(−0.25) // shrink h_new = max(h_new, 0.1·h) // floor } else { h_new = SAFETY · h · err^(−0.2) // grow h_new = min(h_new, 5.0·h) // ceiling } SAFETY = 0.9, TINY = 1.0e-30, TOL = 1.0e-5

Interactive RK5 Single-Step Explorer

🌧️ Design Storm

Subcatchment
Three Surfaces
A1 Imperv no DS
A2 Imperv w/ DS
A3 Pervious
A1: Imperv (no DS)
💡 Width ≈ Area / longest overland flow path
A2: Imperv (w/ DS)
A3: Pervious
Infiltration (A3 — Pervious)
Advanced
t = 0.0 hr
Speed:
t = 0.0 hr

🧮 Live RK5 Stages — Current Time Step (all 3 surfaces)

A1 Imperv (no DS)
A2 Imperv (w/ DS)
A3 Pervious

Hyetograph & Total Hydrograph

Three-Surface Outflow Breakdown

Surface Water Depths (d₁, d₂, d₃)

Infiltration & RK5 Sub-Steps

🔬 RK5 4th vs 5th Order Solutions & Error (A3 Pervious)

Shows where the embedded 4th and 5th order solutions diverge — error spikes indicate the ODE is stiffest and the solver works hardest.

💧 Water Balance Summary

📋 Subcatchment Runoff Summary (SWMM5 RPT Format)


          

📂 Compare with SWMM5 RPT File

Export the .INP above, run it in EPA SWMM5, then drop the .RPT file here to compare results side-by-side.

📄
Drop SWMM5 .RPT file here or click to browse
Parses Subcatchment Runoff Summary + Flow Routing Continuity

📊 Drop SWMM5 .OUT File — Real Time Series Overlay

The .OUT binary contains every reported time step from your SWMM5 run — node depths, link flows, subcatchment runoff. Drop the file and the app overlays the real engine's hydrograph on the in-browser RK5 simulation.

💾
Drop SWMM5 .OUT binary here or click to browse
Parses header + per-period time series for subcatchments, nodes, and links

🔗 Running SWMM Hydrology in ICM InfoWorks

InfoWorks ICM can run EPA SWMM runoff natively within an InfoWorks network. The same three-surface nonlinear reservoir model — impervious without depression storage, impervious with depression storage, and pervious with infiltration — is available as a routing model type called "SWMM" in the ICM Runoff Surface editor. This page maps every SWMM5 parameter to its ICM InfoWorks equivalent.

Step-by-Step: Setting Up SWMM Runoff in ICM InfoWorks

1
Create 3 Runoff Surfaces

In the Runoff Surface editor, create three surfaces:
Imperv_noDS — Fixed runoff (coeff=1.0), Routing=SWMM
Imperv_wDS — Fixed runoff (coeff=1.0), Routing=SWMM
Pervious — Horton or Green-Ampt volume model, Routing=SWMM
Set Manning's n in the Runoff routing value field for each.

2
Create a Land Use

In the Land Use editor, create a land use that references all three runoff surfaces. Set the area percentages for each surface to match your SWMM5 subcatchment's %Imperv and %Zero-Imperv splits.

3
Assign to Subcatchments

In the Subcatchment editor, assign the Land Use to each subcatchment. Set the total area, slope, and subcatchment width. The width applies to all three surfaces in ICM (same as SWMM5).

4
Set Infiltration

On the pervious Runoff Surface, set the infiltration parameters:
• Horton: f₀ (max rate), f∞ (min rate), k (decay)
• Green-Ampt: Ψ (suction head), Ks (conductivity), Δθ (deficit)
Set initial conditions in the Rainfall Event editor.

5
Configure Rainfall Event

Add a Rainfall Event with the appropriate profile. Set initial conditions for Horton moisture store or Green-Ampt moisture deficit. Match the subcatchment Rainfall Profile name to the event profile name.

6
Run Simulation

Create a Run with the rainfall event. ICM will use the SWMM nonlinear reservoir + Manning's overland flow equation (the same RK5 ODE solver) for each of the three surfaces on every subcatchment.

📋 Complete Parameter Mapping: SWMM5 ↔ ICM InfoWorks

EPA SWMM5 (subcatch.c)

ICM InfoWorks

Subcatchment-Level Parameters

ParameterSWMM5 INP FieldICM InfoWorks FieldEditor Location
Total Area[SUBCATCHMENTS] → Areatotal_areaSubcatchment
Outlet Node[SUBCATCHMENTS] → OutIDnode_idSubcatchment
% Impervious[SUBCATCHMENTS] → %ImpervRunoff Surface area %Land Use → surfaces
Characteristic Width[SUBCATCHMENTS] → Widthwidth (on subcatchment)Subcatchment
Slope[SUBCATCHMENTS] → %SlopeslopeSubcatchment
Rain Gage[SUBCATCHMENTS] → Rain Gagerainfall_profileSubcatchment

Surface A1: Impervious WITHOUT Depression Storage

ParameterSWMM5 INP FieldICM InfoWorks FieldEditor Location
Manning's n[SUBAREAS] → N-Impervrunoff_routing_valueRunoff Surface
Depression Storage— (d_s = 0 always)initial_loss_value = 0Runoff Surface
% of Impervious[SUBAREAS] → %Zero-Impervarea % in Land UseLand Use
Volume ModelFixed 100% runoffrunoff_volume_type = Fixed, coeff = 1.0Runoff Surface
Routing ModelNonlinear reservoirrouting_model = SWMMRunoff Surface

Surface A2: Impervious WITH Depression Storage

ParameterSWMM5 INP FieldICM InfoWorks FieldEditor Location
Manning's n[SUBAREAS] → N-Impervrunoff_routing_valueRunoff Surface
Depression Storage[SUBAREAS] → S-Impervinitial_loss_valueRunoff Surface
Initial Loss TypeDepth-basedinitial_loss_type = AbsoluteRunoff Surface
Volume ModelFixed 100% runoffrunoff_volume_type = Fixed, coeff = 1.0Runoff Surface
Routing ModelNonlinear reservoirrouting_model = SWMMRunoff Surface

Surface A3: Pervious

ParameterSWMM5 INP FieldICM InfoWorks FieldEditor Location
Manning's n[SUBAREAS] → N-Pervrunoff_routing_valueRunoff Surface
Depression Storage[SUBAREAS] → S-Pervinitial_loss_valueRunoff Surface
Volume ModelHorton / Green-Amptrunoff_volume_type = Horton / Green-AmptRunoff Surface
Routing ModelNonlinear reservoirrouting_model = SWMMRunoff Surface

Horton Infiltration Parameters (Pervious Surface Only)

ParameterSWMM5 INP FieldICM InfoWorks FieldEditor Location
Max Infil Rate (f₀)[INFILTRATION] → MaxRatehorton_max_rateRunoff Surface
Min Infil Rate (f∞)[INFILTRATION] → MinRatehorton_min_rateRunoff Surface
Decay Constant (k)[INFILTRATION] → Decayhorton_decayRunoff Surface
Drying Time[INFILTRATION] → DryTimehorton_drying_timeRunoff Surface
Initial Moisture Store[INFILTRATION] → MaxInfilSet in Rainfall Event → Initial ConditionsRainfall Event

Green-Ampt Infiltration Parameters (Pervious Surface Only)

ParameterSWMM5 INP FieldICM InfoWorks FieldEditor Location
Suction Head (Ψ)[INFILTRATION] → Suctiongreen_ampt_suctionRunoff Surface
Conductivity (Ks)[INFILTRATION] → Ksatgreen_ampt_conductivityRunoff Surface
Initial Deficit (Δθ)[INFILTRATION] → IMDSet in Rainfall Event → Initial ConditionsRainfall Event

⚠️ Key Differences & Notes

Three-Level Hierarchy: In SWMM5, surface parameters live directly on the subcatchment ([SUBAREAS] + [INFILTRATION] sections). In ICM InfoWorks, there's a three-level hierarchy: Subcatchment → Land Use → Runoff Surface. Multiple subcatchments can share the same Land Use, and multiple Land Uses can share the same Runoff Surface definitions.
Width Field: In SWMM5, the width is set once on the subcatchment and applies to all three surfaces. In ICM InfoWorks, the width is also on the subcatchment, and the SWMM routing model uses it for all surfaces. The Manning's n is always the Runoff routing value field regardless of what routing type is displayed in the UI.
Slope-Related vs Absolute Initial Loss: ICM allows both slope-related initial loss (recommended value 0.000071 m for impervious, matching Wallingford model) and absolute depth. SWMM5 always uses absolute depth for depression storage. Use Absolute type in ICM to match SWMM5 behavior exactly.
Infiltration Initial Conditions: SWMM5 puts initial moisture/deficit in the [INFILTRATION] section. ICM requires these in the Rainfall Event editor → Initial Conditions tab. This is a common gotcha during conversion — if you miss it, Horton starts fully recovered and Green-Ampt starts fully saturated.
Groundwater: ICM supports groundwater modeling but uses its own InfoWorks method rather than the SWMM5 two-zone groundwater equations. If your SWMM5 model has [GWF] sections, these need manual re-calibration in ICM.
SWMM5 Import: ICM can directly import SWMM5 .INP files. The importer automatically creates the Runoff Surfaces, Land Uses, and Subcatchment assignments. It creates one Runoff Surface per unique parameter set and shares them across subcatchments.

💎 Ruby Script: Auto-Configure SWMM Runoff Surfaces in ICM

# Ruby script to set up SWMM hydrology in ICM InfoWorks # Run from ICM UI Script → applies to current network net = WSApplication.current_network # --- Step 1: Define three SWMM Runoff Surfaces --- net.transaction_begin # Surface A1: Impervious, no depression storage s1 = net.new_row_object('hw_runoff_surface') s1['surface_id'] = 'SWMM_Imperv_noDS' s1['routing_model'] = 'SWMM' s1['runoff_volume_type'] = 'Fixed' s1['fixed_runoff_coefficient'] = 1.0 s1['runoff_routing_value'] = 0.012 # Manning's n s1['initial_loss_type'] = 'Absolute' s1['initial_loss_value'] = 0.0 # No depression storage s1.write # Surface A2: Impervious, with depression storage s2 = net.new_row_object('hw_runoff_surface') s2['surface_id'] = 'SWMM_Imperv_wDS' s2['routing_model'] = 'SWMM' s2['runoff_volume_type'] = 'Fixed' s2['fixed_runoff_coefficient'] = 1.0 s2['runoff_routing_value'] = 0.012 # Manning's n s2['initial_loss_type'] = 'Absolute' s2['initial_loss_value'] = 0.05 # 0.05 in depression storage s2.write # Surface A3: Pervious, Horton infiltration s3 = net.new_row_object('hw_runoff_surface') s3['surface_id'] = 'SWMM_Pervious' s3['routing_model'] = 'SWMM' s3['runoff_volume_type'] = 'Horton' s3['runoff_routing_value'] = 0.15 # Manning's n for overland s3['initial_loss_type'] = 'Absolute' s3['initial_loss_value'] = 0.20 # 0.20 in depression storage s3['horton_max_rate'] = 3.0 # f0 (in/hr) s3['horton_min_rate'] = 0.5 # fc (in/hr) s3['horton_decay'] = 4.0 # k (1/hr) s3.write net.transaction_commit puts "Created 3 SWMM runoff surfaces" # --- Step 2: Create Land Use referencing all 3 surfaces --- net.transaction_begin lu = net.new_row_object('hw_land_use') lu['land_use_id'] = 'SWMM_Mixed' # Set surface areas (example: 50% imperv, 25% of that has no DS) # A1 = 50% × 25% = 12.5%, A2 = 50% × 75% = 37.5%, A3 = 50% lu.write net.transaction_commit # --- Step 3: Assign to subcatchments --- net.transaction_begin net.row_objects('hw_subcatchment').each do |sc| sc['land_use_id'] = 'SWMM_Mixed' # Width comes from SWMM5 subcatchment width # sc['width'] = 500 # ft — set per subcatchment sc.write end net.transaction_commit puts "Assigned SWMM land use to all subcatchments"

🏛️ Architecture Comparison: Data Flow

EPA SWMM5 Data Structure [SUBCATCHMENTS] Name RainGage Outlet Area %Imperv Width Slope S1 RG1 J1 10 50 500 2.0 [SUBAREAS] Subcat N-Imperv N-Perv S-Imperv S-Perv %Zero Route S1 0.012 0.15 0.05 0.20 25 OUTLET [INFILTRATION] Subcat MaxRate MinRate Decay DryTime MaxInfil S1 3.0 0.5 4.0 7 0 → All 3 surfaces defined FLAT on the subcatchment → One-level structure: Subcatchment has everything
ICM InfoWorks Data Structure Runoff Surface (hw_runoff_surface) SWMM_Imperv_noDS → routing=SWMM, n=0.012, ds=0 SWMM_Imperv_wDS → routing=SWMM, n=0.012, ds=0.05 SWMM_Pervious → routing=SWMM, n=0.15, Horton Land Use (hw_land_use) SWMM_Mixed → 12.5% Imperv_noDS → 37.5% Imperv_wDS → 50.0% Pervious Subcatchment (hw_subcatchment) S1 → land_use=SWMM_Mixed, area=10ac, width=500 → Three-level hierarchy: Subcatch → LandUse → Surface → Surfaces are SHARED across subcatchments
Engman Table — Manning's n for Overland Flow (from ICM Help): Concrete/asphalt: 0.011 (0.01–0.013) | Bare sand: 0.01 (0.01–0.016) | Gravel: 0.02 (0.012–0.033) | Range (natural): 0.13 (0.01–0.32) | Bluegrass sod: 0.45 (0.39–0.63) | Short grass: 0.15 (0.10–0.20) | Bermuda grass: 0.41 (0.30–0.48)