🧱 1. What is a Node in SWMM?
In a SWMM model, a Node represents a point where flow converges, diverges, is stored, or is discharged — such as manholes, storage units, junctions, and pump inlets/outlets.
| Node Type | Description |
|---|
| Junction | General connection point for conduits (accumulates flow/level) |
| Outfall | Exit point from the system (discharge location) |
| Storage | Temporarily stores flow (e.g., detention basin) |
| Divider | Splits flow based on conditions |
| Pump Node | Inlet/outlet point for a pump |
🧠 2. What You Can Do with pyswmm.Nodes
🔍 ✅ Readable Properties
from pyswmm import Simulation, Nodes
with Simulation("model.inp") as sim:
node = Nodes(sim)["N1"]
for step in sim:
print(sim.current_time, node.depth, node.inflow, node.flooding)
| Property | Description |
|---|
depth | Current water depth (m) |
inflow | Inflow rate (cms or cfs) |
flooding | Flooding flow rate (m³/s) |
head | Hydraulic head (depth + elevation) |
overflow | Overflow discharge |
total_inflow | Total internal + external inflow |
volume | Volume of stored water (for storage units) |
⚙️ ✅ Writable Properties (for Certain Node Types)
Some nodes (e.g., Storage, pump-connected nodes) allow control during simulation:
node.target_depth = 2.5
🧪 Example: Flood Detection
from pyswmm import Simulation, Nodes
with Simulation("model.inp") as sim:
nodes = Nodes(sim)
node = nodes["J1"]
for step in sim:
if node.flooding > 0:
print(f"⚠️ Flooding at {node.nodeid} at {sim.current_time} - {node.flooding:.3f} m³/s")
| Scenario | Description |
|---|
| Track water depth at specific node | Analyze flood-prone areas |
| Monitor storage depth | Useful for LID analysis, pump control, etc. |
| Analyze inflow patterns | Understand runoff timing per catchment |
| Calculate head differences | Determine pump operation needs |
🔧 Which Nodes Can Be Controlled?
- Most node properties are read-only (e.g.,
depth, inflow)
Storage nodes allow target_depth to be set
- Pump nodes can be indirectly controlled using the
Links module (pump ON/OFF logic)