OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
DynamicWave.cpp File Reference

Dynamic wave routing – batch-oriented St. Venant equations. More...

#include "DynamicWave.hpp"
#include "Node.hpp"
#include "XSectBatch.hpp"
#include "ForceMain.hpp"
#include "../core/SimulationContext.hpp"
#include "../math/SIMD.hpp"
#include <cmath>
#include <algorithm>
#include <numeric>
Include dependency graph for DynamicWave.cpp:

Namespaces

namespace  openswmm
 
namespace  openswmm::dynwave
 

Detailed Description

Dynamic wave routing – batch-oriented St. Venant equations.

The solver follows this pattern per Picard iteration:

  1. computeLinkGeometry() – batch call to XSectGroups for ALL links:
    • depth1/depth2 from node heads and link offsets
    • Preissmann slot geometry applied when depth > y_full (closed conduits)
    • XSectGroups::computeAreas/HydRad/Widths for free-surface depths
    • Slot area/width/hrad overrides for surcharged depths
  2. solveMomentumBatch() – pure array arithmetic over ALL links:
    • velocity = old_flow / area_mid (vectorisable)
    • Froude from velocity and hydraulic depth (vectorisable)
    • sigma (inertial damping) from Froude (vectorisable)
    • full inertial damping when closed conduit is surcharged
    • friction slope dq1 = dt * roughFactor / rMid^(4/3) * |v| (vectorisable)
    • head gradient dq2 = dt * g * aMid * (h2-h1)/L (vectorisable)
    • momentum update: q = (qOld - dq2 + dq3 + dq4) / (1 + dq1)
    • under-relaxation (vectorisable)
  3. updateNodeFlows() – scatter link flows to node inflow/outflow
  4. updateNodeDepths() – per-node Picard convergence check
    • EXTRAN surcharge: dQ/dH with smooth transition near crown
    • Separate convergence tracking for surcharged vs free-surface nodes
Note
Legacy reference: src/legacy/engine/dwflow.c, dynwave.c
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License