![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Functions | |
| double | getVelocity (const XSectParams &xs, double flow, double depth, int barrels=1) |
| Compute flow velocity from flow and depth. | |
| double | getFroude (const XSectParams &xs, double v, double y) |
| Compute Froude number from velocity and depth. | |
| void | computeConveyance (double roughness, double slope, double s_full, double &beta, double &rough_factor, double &q_full) |
| Compute Manning conveyance coefficients for a conduit. | |
| double | getDepthFromFlow (const XSectParams &xs, double beta, double q) |
| Compute normal-flow depth from flow rate (inverse Manning). | |
| double | getCapacity (const XSectParams &xs, double depth) |
| Compute the capacity fraction (depth / full depth for conduits, setting for other links). | |
| void | computeVelocities (const LinkData &links, double *velocity) |
| Compute velocity for all links in batch. | |
| void | computeFroude (const LinkData &links, const double *velocity, double *froude) |
| Compute Froude numbers for all conduit links. | |
| void | computeAllConveyance (LinkData &links) |
| Compute Manning conveyance for all conduit links. | |
| void openswmm::link::computeAllConveyance | ( | LinkData & | links | ) |
Compute Manning conveyance for all conduit links.
Sets links.beta, links.rough_factor, links.q_full for each conduit link. Must be called once after slope/roughness/xsect are set (at init time, not each timestep).
| links | SoA link data (modified in place). |
| void openswmm::link::computeConveyance | ( | double | roughness, |
| double | slope, | ||
| double | s_full, | ||
| double & | beta, | ||
| double & | rough_factor, | ||
| double & | q_full | ||
| ) |
Compute Manning conveyance coefficients for a conduit.
Sets:
| roughness | Manning's n. | |
| slope | Conduit slope (rise/run). | |
| s_full | Section factor at full depth (ft^8/3). | |
| [out] | beta | Manning conveyance factor. |
| [out] | rough_factor | Head loss coefficient. |
| [out] | q_full | Full-pipe flow rate (ft3/s). |
| void openswmm::link::computeFroude | ( | const LinkData & | links, |
| const double * | velocity, | ||
| double * | froude | ||
| ) |
Compute Froude numbers for all conduit links.
| links | SoA link data. |
| velocity | [in] Velocity array. |
| froude | [out] Froude number array (indexed by link). |
| void openswmm::link::computeVelocities | ( | const LinkData & | links, |
| double * | velocity | ||
| ) |
Compute velocity for all links in batch.
| links | SoA link data. |
| xs_groups | Shape-grouped xsect manager (for area computation). |
| velocity | [out] Velocity array (indexed by link). |
| double openswmm::link::getCapacity | ( | const XSectParams & | xs, |
| double | depth | ||
| ) |
Compute the capacity fraction (depth / full depth for conduits, setting for other links).
| double openswmm::link::getDepthFromFlow | ( | const XSectParams & | xs, |
| double | beta, | ||
| double | q | ||
| ) |
Compute normal-flow depth from flow rate (inverse Manning).
Given Q, find y such that Q = beta * S(y). S = Q / beta → A = getAofS(xs, S) → y = getYofA(xs, A).
| xs | Cross-section parameters. |
| beta | Manning conveyance factor. |
| q | Flow rate (ft3/s). |
| double openswmm::link::getFroude | ( | const XSectParams & | xs, |
| double | v, | ||
| double | y | ||
| ) |
Compute Froude number from velocity and depth.
Fr = |V| / sqrt(g * D_h) where D_h = A/T (hydraulic depth). Returns 0 for dry or fully-full closed conduits.
| xs | Cross-section parameters. |
| v | Velocity (ft/s). |
| y | Water depth (ft). |
| double openswmm::link::getVelocity | ( | const XSectParams & | xs, |
| double | flow, | ||
| double | depth, | ||
| int | barrels = 1 |
||
| ) |
Compute flow velocity from flow and depth.
V = Q / (barrels * A(y)), where A is the cross-sectional area. Returns 0 if depth < 0.01 ft or area < FUDGE.
| xs | Cross-section parameters. |
| flow | Flow rate (ft3/s). |
| depth | Water depth (ft). |
| barrels | Number of identical barrels (default 1). |