![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| struct | Gradients |
| struct | Mesh |
| struct | State |
| struct | Transfers |
Functions | |
| void | gradients (const Mesh &mesh, const State &state, const Gradients &grad, const IView &cells, int count, double dry) |
| Launch connected-wet-neighbor reconstruction for eta, velocity and depth gradients. | |
| void | faces (const Mesh &mesh, const State &state, const Gradients &grad, const Transfers &acc, const IView &face_list, int count, const IView &face_tier, double dt, double dry, double beta, bool second_order, bool global_step) |
| Launch one Euler stage's interior-face water and momentum receipt booking. | |
| void | gather (const Mesh &mesh, const State &state, const Transfers &acc, const IView &cells, int count, const DView &dmx, const DView &dmy) |
| Gather and clear selected cells' owned interior-face receipt sides. | |
| void | momentum (const Mesh &mesh, const State &state, const IView &cells, int count, const DView &dmx, const DView &dmy, const IView &wall_ptr, const IView &wall_slot, const DView &roughness, double dt, double dry) |
| Launch selected-cell momentum adoption with physical-wall pressure and Manning friction. | |
| void | averageLedger (const DView &initial, const DView &live) |
| Retain half the two-stage increment of a cumulative RK2 ledger. | |
|
inline |
Retain half the two-stage increment of a cumulative RK2 ledger.
| [in] | initial | Device snapshot before either Euler stage, with the same extent as live. |
| [in,out] | live | Device ledger after both stage increments; each entry becomes initial + 0.5*(live-initial), in the ledger's own physical units. |
|
inline |
Launch one Euler stage's interior-face water and momentum receipt booking.
| [in] | mesh | Prepared SI unique-face geometry, CSR-related metadata, cell areas/counts and finite nonnegative conveyance, with all view extents covering referenced cells/faces. |
| [in] | state | Stable head/depth m, volume m3, momentum qx/qy m2/s and integer cell tiers. |
| [in] | grad | Prepared four-block x/y gradients, required when second_order is true. |
| [in,out] | acc | Device per-face receipt views. Adds signed water m3 and integrated x/y momentum m4/s to left/right sides, and overwrites discharge m2/s. A blocked face only sets its discharge to zero; previously queued receipt accumulators remain for their owner's gather. |
| [in] | face_list | Device list with at least count valid distinct interior-face indices. |
| [in] | count | Nonnegative number of listed faces. |
| [in] | face_tier | Device tier per face. In LTS mode giver tier minus face tier must be a valid nonnegative int shift count; hierarchy/refire consistency belongs to the caller. |
| [in] | dt | Finite nonnegative face interval s. |
| [in] | dry | Finite positive wet/dry threshold m. |
| [in] | beta | Finite donor availability fraction in [0,1], divided across giver faces/refires. |
| [in] | second_order | True reconstructs eta/velocity/depth at faces; false uses cell states. |
| [in] | global_step | True uses one refire, otherwise tier differences scale each face's budget. |
Riemann pressure corrections are not multiplied by conveyance; donor limiting scales water and advective/Riemann momentum together. Equal/opposite water receipts preserve pairing; this kernel changes neither cell volume nor canonical qx/qy.
|
inline |
Gather and clear selected cells' owned interior-face receipt sides.
| [in] | mesh | Prepared CSR incidence/side-sign views with valid unique-face indices. |
| [in,out] | state | Adds gathered water to selected volume m3 and floors at zero; head/depth and qx/qy are untouched and must be refreshed/advanced by the stage owner. |
| [in,out] | acc | Consumes and zeros each listed cell's left or right water/momentum receipts. The opposite cell's side and instantaneous discharge are retained. |
| [in] | cells | Device list of at least count valid distinct cells. |
| [in] | count | Nonnegative selected cell count. |
| [out] | dmx | Device per-cell x integrated momentum increment m4/s; selected entries overwritten. |
| [out] | dmy | Device per-cell y integrated momentum increment m4/s; selected entries overwritten. |
Performs no closure, boundary wall pressure, friction, source update or RK averaging. Receipt views and outputs must not alias state or each other in conflicting ways.
|
inline |
Launch connected-wet-neighbor reconstruction for eta, velocity and depth gradients.
| [in] | mesh | Prepared SI cell/unique-face/CSR geometry. Per-cell arrays span n, CSR row pointers n+1, incidence arrays their terminal pointer and padded boundary/slot arrays 4*n. Cells have three/four vertices, valid reciprocal faces, positive finite area and distinct centroids. |
| [in] | state | Stable cell head/depth m, qx/qy m2/s and active mask spanning n=depth.extent(0). |
| [out] | grad | Device x/y output views, each at least 4*n doubles, in contiguous blocks for eta, u, v and depth; gradient units are dimensionless, 1/s, 1/s and dimensionless respectively. |
| [in] | cells | Device list with at least count valid distinct cell indices. |
| [in] | count | Nonnegative number of selected cells to overwrite; unlisted gradients are retained. |
| [in] | dry | Finite positive wet/dry depth threshold m. Cells <=10*dry get zero gradients; dry/inactive/disconnected neighbors are excluded, with conditioned wet-neighbor fits at shore. |
Physical boundaries complete the Green-Gauss sum by self extrapolation. Shore velocity gradients remain zero; BJ bounds and omitted-face depth positivity constrain reconstructed fields.
|
inline |
Launch selected-cell momentum adoption with physical-wall pressure and Manning friction.
| [in] | mesh | Prepared positive cell areas m2 and padded four-slot boundary geometry. |
| [in,out] | state | Selected qx/qy m2/s are updated from gathered increments and wall receipts; depth/head must already reflect current volume/source closure and remain stable through this call. Cells at/below dry have both momentum components reset to zero. |
| [in] | cells | Device list with at least count valid distinct selected cells. |
| [in] | count | Nonnegative selected cell count. |
| [in] | dmx | Device per-cell integrated x momentum receipts m4/s from gather(). |
| [in] | dmy | Device per-cell integrated y momentum receipts m4/s. |
| [in] | wall_ptr | Device CSR pointers, n+1, into wall_slot, enumerating only physical WALL slots. |
| [in] | wall_slot | Device padded slot indices matching each selected cell's physical boundaries. |
| [in] | roughness | Device finite nonnegative Manning n per cell, s/m^(1/3). |
| [in] | dt | Finite nonnegative momentum/friction interval s. |
| [in] | dry | Finite positive dry-depth threshold m. |
Adds reflected-ghost wall pressure, divides integrated momentum by cell area and applies friction. Non-wall boundary forcing and live node exchange are separately ordered stage work.