![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
The analytic shape formulas — the single definition of each. More...
Functions | |
| OPENSWMM_KERNEL_FN double | rectAofY (double y, double w_max) |
| Compute rectangular area as depth times width. | |
| OPENSWMM_KERNEL_FN double | trapezAofY (double y, double y_bot, double s_bot) |
| Compute trapezoid area as (bottom width+side slope*depth)*depth. | |
| OPENSWMM_KERNEL_FN double | triangAofY (double y, double s_bot) |
| Compute triangular area from depth and side slope. | |
| OPENSWMM_KERNEL_FN double | parabAofY (double y, double r_bot) |
| Compute parabolic area using its square-root depth relation. | |
| OPENSWMM_KERNEL_FN double | powerfuncAofY (double y, double s_bot, double r_bot) |
| Compute power-function section area. | |
| OPENSWMM_KERNEL_FN double | rectClosedRofA (double a, double w_max, double a_full) |
| Compute closed rectangular hydraulic radius with near-crown perimeter correction. | |
| OPENSWMM_KERNEL_FN double | rectOpenRofA (double a, double w_max, double s_bot) |
| Compute open rectangular radius excluding selected side banks. | |
| OPENSWMM_KERNEL_FN double | trapezRofY (double y, double y_bot, double s_bot, double r_bot) |
| Compute trapezoid hydraulic radius from depth. | |
| OPENSWMM_KERNEL_FN double | triangRofY (double y, double s_bot, double r_bot) |
| Compute triangular hydraulic radius from its side geometry. | |
| OPENSWMM_KERNEL_FN double | rectClosedWofY (double y_norm, double w_max) |
| Apply the closed rectangular crown top-width convention. | |
| OPENSWMM_KERNEL_FN double | trapezWofY (double y, double y_bot, double s_bot) |
| Compute trapezoid top width from depth. | |
| OPENSWMM_KERNEL_FN double | triangWofY (double y, double s_bot) |
| Compute triangular top width from depth. | |
| OPENSWMM_KERNEL_FN double | parabWofY (double y, double r_bot) |
| Compute parabolic top width from depth. | |
| OPENSWMM_KERNEL_FN double | powerfuncWofY (double y, double s_bot, double r_bot) |
| Compute power-function top width as the area-depth derivative. | |
The analytic shape formulas — the single definition of each.
These are the shapes whose geometry is a closed-form expression rather than a table lookup. They live outside XsectEval because they need no tables at all, which lets the two consumers that are shaped differently share them:
XsectEval's per-element methods (host DW scalar fallbacks, FV, device), which unpack an XSectParams; andxsect_batch's SoA loops (XSectBatch.cpp), which DWSolver's computeLinkGeometry STEP B/D runs on and which read parallel arrays.Both call the same function on the same operands, so the two paths cannot drift — which is the point (plan §5.1, Phase 4b). Each body is legacy xsect.c verbatim, including operand order and the guards: multiplication is not associative in IEEE-754, so y*y*sBot and sBot*y*y are different computations and only the first is legacy's.
The y/a guards are legacy's own (xsect_getRofA's a <= 0 early return for the rect family, trapez_getRofY's y == 0). STEP A floors every conduit depth at FUDGE before STEP B/D sees it, so on the DW path they are unreachable either way; they are here so the shared body is complete rather than context-dependent.
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::parabAofY | ( | double | y, |
| double | r_bot ) |
Compute parabolic area using its square-root depth relation.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | r_bot | Positive inverse sqrt(parabola coefficient), units sqrt(ft). |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::parabWofY | ( | double | y, |
| double | r_bot ) |
Compute parabolic top width from depth.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | r_bot | Positive inverse sqrt(parabola coefficient), sqrt(ft). |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::powerfuncAofY | ( | double | y, |
| double | s_bot, | ||
| double | r_bot ) |
Compute power-function section area.
No finite/power-domain checks.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | s_bot | Positive depth exponent (inverse authoring exponent), dimensionless. |
| [in] | r_bot | Positive area coefficient, units ft^(1-s_bot). |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::powerfuncWofY | ( | double | y, |
| double | s_bot, | ||
| double | r_bot ) |
Compute power-function top width as the area-depth derivative.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | s_bot | Positive depth exponent, dimensionless. |
| [in] | r_bot | Positive coefficient with units ft^(1-s_bot). |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::rectAofY | ( | double | y, |
| double | w_max ) |
Compute rectangular area as depth times width.
No clamp to full depth.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | w_max | Positive section width in ft. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::rectClosedRofA | ( | double | a, |
| double | w_max, | ||
| double | a_full ) |
Compute closed rectangular hydraulic radius with near-crown perimeter correction.
Above RECT_ALFMAX full-area fraction, adds a linearly increasing crown width to wetted perimeter.
| [in] | a | Finite nonnegative wetted area in ft2; caller supplies valid initialized geometry. |
| [in] | w_max | Positive section width in ft. |
| [in] | a_full | Positive full section area ft2. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::rectClosedWofY | ( | double | y_norm, |
| double | w_max ) |
Apply the closed rectangular crown top-width convention.
Does not clamp negative/overfull normalized depths.
| [in] | y_norm | Normalized depth y/y_full; exact1 denotes crown. |
| [in] | w_max | Positive section width in ft. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::rectOpenRofA | ( | double | a, |
| double | w_max, | ||
| double | s_bot ) |
Compute open rectangular radius excluding selected side banks.
Perimeter is width+(2-s_bot)*depth.
| [in] | a | Finite nonnegative wetted area in ft2; caller supplies valid initialized geometry. |
| [in] | w_max | Positive section width in ft. |
| [in] | s_bot | Number of excluded wetted banks, convention0,1 or2; caller validates. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::trapezAofY | ( | double | y, |
| double | y_bot, | ||
| double | s_bot ) |
Compute trapezoid area as (bottom width+side slope*depth)*depth.
No full-depth clamp.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | y_bot | Nonnegative bottom width ft, with valid positive section dimensions. |
| [in] | s_bot | Average horizontal/vertical side slope, dimensionless. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::trapezRofY | ( | double | y, |
| double | y_bot, | ||
| double | s_bot, | ||
| double | r_bot ) |
Compute trapezoid hydraulic radius from depth.
No nonzero-denominator validation.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | y_bot | Bottom width ft. |
| [in] | s_bot | Average horizontal/vertical side slope. |
| [in] | r_bot | Positive sum of sloped side lengths per unit depth, dimensionless. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::trapezWofY | ( | double | y, |
| double | y_bot, | ||
| double | s_bot ) |
Compute trapezoid top width from depth.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | y_bot | Nonnegative bottom width ft. |
| [in] | s_bot | Average horizontal/vertical side slope. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::triangAofY | ( | double | y, |
| double | s_bot ) |
Compute triangular area from depth and side slope.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | s_bot | Positive horizontal/vertical side slope, dimensionless. |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::triangRofY | ( | double | y, |
| double | s_bot, | ||
| double | r_bot ) |
Compute triangular hydraulic radius from its side geometry.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | s_bot | Positive horizontal/vertical side slope. |
| [in] | r_bot | Positive side-length/depth factor sqrt(1+s_bot*s_bot). |
| OPENSWMM_KERNEL_FN double openswmm::xsect::shape::triangWofY | ( | double | y, |
| double | s_bot ) |
Compute triangular top width from depth.
| [in] | y | Finite nonnegative water depth in ft; caller keeps input within the intended geometric branch. |
| [in] | s_bot | Positive horizontal/vertical side slope. |