![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
Classes | |
| struct | CulvertCurve |
| Inlet-control curve coefficients for one culvert type code. More... | |
Functions | |
| OPENSWMM_KERNEL_FN double | fricSlopeHW (double velocity, double hyd_rad, double c_hw) noexcept |
| Compute Hazen-Williams friction slope from velocity and hydraulic radius. | |
| OPENSWMM_KERNEL_FN double | fricSlopeDW (double velocity, double hyd_rad, double roughness) noexcept |
| Compute Darcy-Weisbach slope with laminar or Swamee-Jain friction factor. | |
| OPENSWMM_KERNEL_FN double | culvertInflow (double q_proposed, double head, double y_full, double a_full, double slope, const CulvertCurve &cc, bool mitered, double &dqdh) noexcept |
| Limit proposed culvert flow by a three-regime inlet-control curve. | |
Variables | |
| constexpr double | kViscosity = 1.1e-5 |
| constexpr double | kGravity = 32.2 |
| Gravity in internal units, matching constants::GRAVITY. | |
|
noexcept |
Limit proposed culvert flow by a three-regime inlet-control curve.
Uses unsubmerged h/D<=0.95, submerged above derived transition, linear interpolation between. No global finite/geometry validation, donor cap or sign handling.
| [in] | q_proposed | Nonnegative proposed native cfs discharge. |
| [in] | head | Upstream headwater above invert ft; nonpositive bypasses control. |
| [in] | y_full | Positive full culvert depth ft; nonpositive bypasses. |
| [in] | a_full | Positive full area ft2; nonpositive bypasses. |
| [in] | slope | Finite conduit slope ft/ft used for inlet correction. |
| [in] | cc | Borrowed valid FHWA coefficients K/M/C/Y; K=0 bypasses, physical branches require valid positive divisors. |
| [in] | mitered | True uses-7*slope correction, false+0.5*slope. |
| [out] | dqdh | Set0 first, then derivative of the inlet curve in cfs/ft when evaluated; can remain nonzero even if q_proposed is the returned minimum. |
|
noexcept |
Compute Darcy-Weisbach slope with laminar or Swamee-Jain friction factor.
Uses diameter4R, viscosity1.1e-5ft2/s and gravity32.2ft/s2. Re<=2000 selects64/Re; higher selects explicit turbulent approximation. No transition blending or general finite guard.
| [in] | velocity | Signed native ft/s, magnitude used. |
| [in] | hyd_rad | Positive native ft radius; <=0 returns0. |
| [in] | roughness | Nonnegative absolute roughness height ft, caller-validated. |
|
noexcept |
Compute Hazen-Williams friction slope from velocity and hydraulic radius.
Uses (abs(v)/(1.318*C*R^0.63))^(1/0.54); no general finite checks or source-direction sign.
| [in] | velocity | Signed ft/s velocity; formula uses magnitude. |
| [in] | hyd_rad | Positive hydraulic radius ft; <=0 returns0. |
| [in] | c_hw | Positive Hazen-Williams C coefficient; <=0 returns0. |
|
inlineconstexpr |
Gravity in internal units, matching constants::GRAVITY.
|
inlineconstexpr |
Kinematic viscosity of water, ft²/s. Spelled here rather than included so the header stays dependency-free for the plugin build; it must equal constants::VISCOS, and a static_assert in ForceMain.cpp holds it to that.