![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Functions | |
| double | getVolume (const NodeData &nodes, int idx, double depth, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr) |
| Evaluate a node depth-volume relation in native units. | |
| double | getDepth (const NodeData &nodes, int idx, double volume, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr) |
| Convert booked storage volume to depth using native geometry. | |
| double | getSurfArea (const NodeData &nodes, int idx, double depth, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr) |
| Evaluate the raw derivative of storage volume with depth. | |
| double | getPondedArea (const NodeData &nodes, int idx, double depth, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr) |
| Select an above-rim ponded area or the raw storage surface area. | |
| double | getMaxOutflow (const NodeData &nodes, int idx, double q, double dt) |
| Limit a proposed nonnegative withdrawal by legacy node storage availability. | |
| double | getOverflow (double new_volume, double full_volume, double dt) |
| Convert excess node water volume into a timestep overflow rate. | |
| double | storeVolume (const NodeData &nodes, int idx, double depth, double volume) |
| Evaluate a transport store using an explicit depth and booked volume. | |
| double | storeVolume (const NodeData &nodes, int idx) |
| Evaluate the mixed transport store from current node state. | |
| void | computeHeads (const double *invert, const double *depth, double *head, int n) |
| Add native invert elevation and depth elementwise. | |
| void | computeVolumes (const NodeData &nodes, const double *depth, double *volume, const NodeSubtypes *subs=nullptr) |
| Evaluate every node volume with US-unit, table-free scalar geometry. | |
| void | computeOverflows (const double *new_volume, const double *full_volume, double *overflow, double dt, int n) |
| Compute per-node overflow from excess native volumes. | |
| double | getHead (double invert_elev, double depth) |
| Compute hydraulic head by adding node invert and depth. | |
| void openswmm::node::computeHeads | ( | const double * | invert, |
| const double * | depth, | ||
| double * | head, | ||
| int | n ) |
Add native invert elevation and depth elementwise.
No allocation, clamping or finite validation. Partial overlapping spans are not supported.
| [in] | invert | Readable n-element elevation array in ft. |
| [in] | depth | Readable n-element depth array in ft. |
| [out] | head | Writable n-element head array in ft; exact alias with an input is valid. |
| [in] | n | Nonnegative node count, unchecked. |
| void openswmm::node::computeOverflows | ( | const double * | new_volume, |
| const double * | full_volume, | ||
| double * | overflow, | ||
| double | dt, | ||
| int | n ) |
Compute per-node overflow from excess native volumes.
For positive dt, outputs max(new_volume-full_volume,0)/dt. Partial overlaps are unsupported; inputs are not checked for finite values.
| [in] | new_volume | Readable n-element current-volume array in ft3. |
| [in] | full_volume | Readable n-element rim-volume array in ft3. |
| [out] | overflow | Writable n-element overflow rates in ft3/s; exact alias with an input is valid. |
| [in] | dt | Timestep in seconds; <=0 zero-fills output without reading volume arrays. |
| [in] | n | Nonnegative count; pointer ranges must remain valid even for zero-fill. |
| void openswmm::node::computeVolumes | ( | const NodeData & | nodes, |
| const double * | depth, | ||
| double * | volume, | ||
| const NodeSubtypes * | subs = nullptr ) |
Evaluate every node volume with US-unit, table-free scalar geometry.
Calls getVolume with nullptr tables and unit_sys=0 for each node. Consequently referenced tabular storage returns zero unless an earlier full-volume clamp applies, and authored SI coefficients are not converted with an SI column. Use scalar calls with tables/unit_sys where those project features are required.
| [in] | nodes | Initialized node arrays; count() determines all buffer lengths. |
| [in] | depth | Readable nodes.count()-element depths in ft; may differ from nodes.depth. |
| [out] | volume | Writable nodes.count()-element volumes in ft3; exact alias with depth is valid. |
| [in] | subs | Borrowed optional subtype/LID rows used by getVolume; nullptr supplies default storage coefficients. |
| double openswmm::node::getDepth | ( | const NodeData & | nodes, |
| int | idx, | ||
| double | volume, | ||
| TableData * | tables = nullptr, | ||
| int | unit_sys = 0, | ||
| const NodeSubtypes * | subs = nullptr ) |
Convert booked storage volume to depth using native geometry.
Ordinary storage uses a tabular inverse, direct power/quadratic inverses, or safeguarded Newton in display-unit depth with tolerance 0.001. Positive full_volume clamps to full_depth. A missing referenced table falls back to full_depth*volume/full_volume, or zero without positive full_volume. Non-storage nodes always return volume/MIN_SURFAREA; this need not invert getVolume when full_volume has been overridden. LID Richards divides by surface pore area and caps at surface.top; other LID storage consumes mobile pore capacities in reverse cell order. Valid nondegenerate coefficients/cell dimensions are required; zero denominators and nonfinite input are not diagnosed.
| [in] | nodes | Initialized node arrays; all accessed arrays must contain idx. |
| [in] | idx | Valid nonnegative global node index, unchecked. |
| [in] | volume | Water volume in ft3; negative values return zero before indexing. |
| [in] | tables | Borrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors. |
| [in] | unit_sys | Valid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system. |
| [in] | subs | Borrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained. |
|
inline |
Compute hydraulic head by adding node invert and depth.
| [in] | invert_elev | Invert elevation in native ft or another unit shared by depth. |
| [in] | depth | Water depth in the same length unit. |
| double openswmm::node::getMaxOutflow | ( | const NodeData & | nodes, |
| int | idx, | ||
| double | q, | ||
| double | dt ) |
Limit a proposed nonnegative withdrawal by legacy node storage availability.
The eligibility test uses rpt_full_volume, not the internal full_volume bucket. Ordinary junctions/outfalls/dividers are therefore not capped merely because internal mixed storage has a positive capacity.
| [in] | nodes | Initialized node arrays; all accessed arrays must contain idx. |
| [in] | idx | Valid nonnegative global node index, unchecked. |
| [in] | q | Proposed flow in ft3/s; negative input is returned as zero. |
| [in] | dt | Positive timestep in seconds when rpt_full_volume is positive; unchecked. |
| double openswmm::node::getOverflow | ( | double | new_volume, |
| double | full_volume, | ||
| double | dt ) |
Convert excess node water volume into a timestep overflow rate.
| [in] | new_volume | Booked current volume in ft3. |
| [in] | full_volume | Rim capacity in ft3. |
| [in] | dt | Timestep in seconds; nonpositive values return zero. |
| double openswmm::node::getPondedArea | ( | const NodeData & | nodes, |
| int | idx, | ||
| double | depth, | ||
| TableData * | tables = nullptr, | ||
| int | unit_sys = 0, | ||
| const NodeSubtypes * | subs = nullptr ) |
Select an above-rim ponded area or the raw storage surface area.
At/below full_depth, or with exactly zero ponded_area, delegates to getSurfArea at depth. Above the rim a positive ponded_area is returned; a negative stored value falls back to getSurfArea at full_depth. No routing ponding-enable option is examined.
| [in] | nodes | Initialized node arrays; all accessed arrays must contain idx. |
| [in] | idx | Valid nonnegative global node index, unchecked. |
| [in] | depth | Water depth in ft. |
| [in] | tables | Borrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors. |
| [in] | unit_sys | Valid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system. |
| [in] | subs | Borrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained. |
| double openswmm::node::getSurfArea | ( | const NodeData & | nodes, |
| int | idx, | ||
| double | depth, | ||
| TableData * | tables = nullptr, | ||
| int | unit_sys = 0, | ||
| const NodeSubtypes * | subs = nullptr ) |
Evaluate the raw derivative of storage volume with depth.
LID storage returns the active cell mobile pore area; Richards uses surface area times porosity. Ordinary tables extrapolate and functional/quadratic coefficients are evaluated in display units before conversion. No MIN_SURFAREA floor is applied here; the routing depth update supplies its own floor.
| [in] | nodes | Initialized node arrays; all accessed arrays must contain idx. |
| [in] | idx | Valid nonnegative global node index, unchecked. |
| [in] | depth | Water depth in ft; not clamped to zero or full depth. |
| [in] | tables | Borrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors. |
| [in] | unit_sys | Valid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system. |
| [in] | subs | Borrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained. |
| double openswmm::node::getVolume | ( | const NodeData & | nodes, |
| int | idx, | ||
| double | depth, | ||
| TableData * | tables = nullptr, | ||
| int | unit_sys = 0, | ||
| const NodeSubtypes * | subs = nullptr ) |
Evaluate a node depth-volume relation in native units.
Storage LID cells take precedence: Richards retains only surface pore water; other LID cells sum depth-filled mobile pore capacity. Ordinary storage clamps to positive full_volume at full_depth, then uses tabular integration or authored functional/quadratic coefficients with per-call display-unit conversion. Other node types scale positive full_volume (or MIN_SURFAREA*full_depth) linearly with depth, without an upper clamp; nonpositive full_depth returns zero.
| [in] | nodes | Initialized node arrays; all accessed arrays must contain idx. |
| [in] | idx | Valid nonnegative global node index, unchecked. |
| [in] | depth | Water depth in ft; values <=0 return zero before node indexing. |
| [in] | tables | Borrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors. |
| [in] | unit_sys | Valid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system. |
| [in] | subs | Borrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained. |
| double openswmm::node::storeVolume | ( | const NodeData & | nodes, |
| int | idx ) |
Evaluate the mixed transport store from current node state.
Requires initialized geometry and current state arrays. No state is modified.
| [in] | nodes | Initialized node arrays; all accessed arrays must contain idx. |
| [in] | idx | Valid nonnegative global node index, unchecked. |
| double openswmm::node::storeVolume | ( | const NodeData & | nodes, |
| int | idx, | ||
| double | depth, | ||
| double | volume ) |
Evaluate a transport store using an explicit depth and booked volume.
Nonpositive full_depth returns the clamped booked volume. Outfalls retain the supplied booked volume (normally zero), rather than an artificial junction bucket. For junctions/dividers positive full_depth uses min(depth,full_depth)/full_depth; negative depth is not independently clamped. This reconstructs the mixed below-rim store that differs from legacy booked volume.
| [in] | nodes | Initialized node arrays; all accessed arrays must contain idx. |
| [in] | idx | Valid nonnegative global node index, unchecked. |
| [in] | depth | Water depth in ft; callers supply nonnegative physical depth. |
| [in] | volume | Booked node volume in ft3; clamped to >=0 before use. |