![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| class | KWSolver |
| Kinematic wave solver state. More... | |
Functions | |
| double | getLinkInflow (SimulationContext &ctx, hydstruct::StructureSolver *structures, int j, double dt) |
| Flow into the upstream end of a link under Steady/Kin. Wave routing. | |
| void | updateStorageState (SimulationContext &ctx, hydstruct::StructureSolver *structures, const std::vector< int > &order, int pos, int i, double dt) |
| Update a storage node's depth & volume by successive approximation. | |
| void | finishRouting (SimulationContext &ctx, hydstruct::StructureSolver *structures, const std::vector< int > &order, const std::vector< char > &storage_updated, const std::vector< double > &link_y1, const std::vector< double > &link_y2, double dt) |
| End-of-step node/link state for tree-layout routing (KW/steady). | |
Variables | |
| constexpr double | WX = 0.6 |
| Distance weighting factor. | |
| constexpr double | WT = 0.6 |
| Time weighting factor. | |
| constexpr double | EPSIL = 0.001 |
| Newton convergence tolerance. | |
| void openswmm::kinwave::finishRouting | ( | SimulationContext & | ctx, |
| hydstruct::StructureSolver * | structures, | ||
| const std::vector< int > & | order, | ||
| const std::vector< char > & | storage_updated, | ||
| const std::vector< double > & | link_y1, | ||
| const std::vector< double > & | link_y2, | ||
| double | dt ) |
End-of-step node/link state for tree-layout routing (KW/steady).
PARITY flowrout.c:203-205 — after every link is routed, legacy runs setNewNodeState for every node (non-storage volume integration, overflow shedding, depth reset — a junction stores nothing under KW/SF) and then setNewLinkState's updateNodeDepth raises, which lift each conduit's end-node depths to the conduit end flow depths plus offsets, with a flooded non-outfall node pinned at its full depth. A terminal storage unit (no outlet link, so never visited by the sorted-link loop) gets its updateStorageState here, as legacy does (flowrout.c:88-91).
| ctx | Simulation context. |
| structures | Structure solver (see getLinkInflow). |
| order | Topologically sorted link order. |
| storage_updated | Per-node flags set by the sorted-link loop. |
| link_y1 | Per-link flow depth at the upstream end (ft). |
| link_y2 | Per-link flow depth at the downstream end (ft). |
| dt | Routing timestep (seconds). |
| double openswmm::kinwave::getLinkInflow | ( | SimulationContext & | ctx, |
| hydstruct::StructureSolver * | structures, | ||
| int | j, | ||
| double | dt ) |
Flow into the upstream end of a link under Steady/Kin. Wave routing.
PARITY flowrout.c:517 getLinkInflow:
A non-conduit link therefore carries its own HEAD-DISCHARGE flow when it drains a storage unit, and NOTHING otherwise — never the upstream node's inflow. Passing the node inflow through gives every outlet of a node the full inflow, so N outlets manufacture N× the water.
| ctx | Simulation context. |
| structures | Structure solver used to evaluate pump/orifice/weir/ outlet discharge. May be null (structures then carry 0). |
| j | Link index. |
| dt | Routing timestep (seconds). |
| void openswmm::kinwave::updateStorageState | ( | SimulationContext & | ctx, |
| hydstruct::StructureSolver * | structures, | ||
| const std::vector< int > & | order, | ||
| int | pos, | ||
| int | i, | ||
| double | dt ) |
Update a storage node's depth & volume by successive approximation.
PARITY flowrout.c:537 updateStorageState + :611 getStorageOutflow. Called from inside the sorted-link loop, BEFORE routing the links that drain node i, so those links see the converged end-of-step depth. The outflow term is re-evaluated at each iterate because it depends on that depth — an orifice on a pond is an implicit relation, not a known rate.
order/pos locate the node's outlet links: the topological sort emits a node's outgoing links contiguously, so the scan runs forward from pos until node1 changes (matching legacy's if (Link[m].node1 != i) break).
| ctx | Simulation context. |
| structures | Structure solver (see getLinkInflow). |
| order | Topologically sorted link order. |
| pos | Current position in order. |
| i | Storage node index. |
| dt | Routing timestep (seconds). |
|
constexpr |
Newton convergence tolerance.
|
constexpr |
Time weighting factor.
|
constexpr |
Distance weighting factor.