Statistics#
Note
Engine: OpenSWMM 6 — refactored.
Bulk views of the per-object cumulative simulation statistics —
flooding, max flows, surcharge time, etc. Reach via
Solver.statistics.
Single-object access lives on the wrapper sub-views
(Node.stats, Link.stats, Subcatchment.stats).
This page covers the bulk numpy accessors — the right tool when you
want every node’s flooded volume in one C call.
Reference: openswmm_statistics.h.
Bulk numpy properties#
Every property returns a fresh float64 numpy array, shape matching
the domain count.
Node stats#
Property |
Meaning |
|---|---|
|
Maximum depth per node. |
|
Maximum overflow rate per node. |
|
Cumulative flooded volume per node. |
|
Cumulative flooded duration (seconds) per node. |
Link stats#
Property |
Meaning |
|---|---|
|
Maximum flow rate per link. |
|
Maximum velocity per link. |
|
Maximum filling ratio per link. |
|
Cumulative flow volume per link. |
|
Cumulative surcharge duration (seconds) per link. |
Subcatchment stats#
Property |
Meaning |
|---|---|
|
Cumulative runoff volume per subcatchment. |
|
Peak runoff rate per subcatchment. |
Example#
from openswmm.engine import Solver
with Solver("model.inp") as s:
for _ in s.steps():
pass
stats = s.statistics
worst_flooded = stats.node_vol_flooded.argmax()
print(f"node {s.nodes.get_id(worst_flooded)} flooded {stats.node_vol_flooded[worst_flooded]:.1f} ft³")
When the values are meaningful#
All of these values are cumulative aggregates finalised at
Solver.end(). Reading mid-run yields partial values.
See also#
Nodes —
Node.statsfor one node at a time.Links —
Link.stats.Subcatchments —
Subcatchment.stats.Mass balance — continuity errors and flux totals.