![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Enumerations | |
| enum class | FrictionModel : int { HAZEN_WILLIAMS = 0 , DARCY_WEISBACH = 1 } |
Functions | |
| double | getFricSlope_HW (double velocity, double hyd_rad, double c_hw) |
| Compute friction slope for Hazen-Williams. | |
| double | getFricSlope_DW (double velocity, double hyd_rad, double roughness) |
| Compute friction slope for Darcy-Weisbach. | |
| double | getFricFactor (double r_bot, double hrad, double re) |
| Compute friction factor f (Darcy-Weisbach) for fully-turbulent flow. | |
| double | getEquivN (FrictionModel model, double r_bot, double y_full, double slope, double n_raw) |
| Compute equivalent Manning's n for a force main (Gap #22). | |
| double | getRoughFactor (FrictionModel model, double r_bot, double length_factor) |
| Compute roughness adjustment factor for a force main (Gap #22). | |
| void | batchFricSlope (const double *velocity, const double *hyd_rad, const double *param, double *fric_slope, FrictionModel model, int count) |
| Batch compute friction slopes for all force mains — VECTORISABLE. | |
Variables | |
| constexpr double | VISCOS = 1.1e-5 |
| Kinematic viscosity @ 20C (ft2/sec) | |
|
strong |
| void openswmm::forcemain::batchFricSlope | ( | const double * | velocity, |
| const double * | hyd_rad, | ||
| const double * | param, | ||
| double * | fric_slope, | ||
| FrictionModel | model, | ||
| int | count | ||
| ) |
Batch compute friction slopes for all force mains — VECTORISABLE.
| velocity | [in] Velocity array (indexed by force-main group). |
| hyd_rad | [in] Hydraulic radius array. |
| param | [in] C_HW or roughness height, depending on model. |
| fric_slope | [out] Friction slope array. |
| model | Hazen-Williams or Darcy-Weisbach. |
| count | Number of force mains. |
| double openswmm::forcemain::getEquivN | ( | FrictionModel | model, |
| double | r_bot, | ||
| double | y_full, | ||
| double | slope, | ||
| double | n_raw | ||
| ) |
Compute equivalent Manning's n for a force main (Gap #22).
For DW routing with a force main, the Manning's n equivalent that produces the same full-pipe normal flow as the HW or DW formula. Matches legacy forcemain_getEquivN() in forcmain.c.
| model | Friction model (HAZEN_WILLIAMS or DARCY_WEISBACH). |
| r_bot | Hydraulic radius parameter stored in xsect (rBot in legacy): for HW: the C-factor; for DW: roughness height (ft). |
| y_full | Full-pipe depth (ft). |
| slope | Conduit slope (ft/ft, positive). |
| n_raw | Raw Manning's roughness (fallback if model unrecognized). |
| double openswmm::forcemain::getFricFactor | ( | double | r_bot, |
| double | hrad, | ||
| double | re | ||
| ) |
Compute friction factor f (Darcy-Weisbach) for fully-turbulent flow.
Used internally by getEquivN for DW force mains. Matches legacy forcemain_getFricFactor() in forcmain.c at Re=1e12.
| r_bot | Roughness height (ft). |
| hrad | Hydraulic radius (ft). |
| re | Reynolds number (use 1e12 for fully turbulent). |
| double openswmm::forcemain::getFricSlope_DW | ( | double | velocity, |
| double | hyd_rad, | ||
| double | roughness | ||
| ) |
Compute friction slope for Darcy-Weisbach.
| velocity | Flow velocity (ft/sec). |
| hyd_rad | Hydraulic radius (ft). |
| roughness | Pipe roughness height (ft). |
| double openswmm::forcemain::getFricSlope_HW | ( | double | velocity, |
| double | hyd_rad, | ||
| double | c_hw | ||
| ) |
Compute friction slope for Hazen-Williams.
| velocity | Flow velocity (ft/sec). |
| hyd_rad | Hydraulic radius (ft). |
| c_hw | Hazen-Williams C coefficient. |
| double openswmm::forcemain::getRoughFactor | ( | FrictionModel | model, |
| double | r_bot, | ||
| double | length_factor | ||
| ) |
Compute roughness adjustment factor for a force main (Gap #22).
The returned value is stored in xsect_s_bot and used by getFricSlope_HW / getFricSlope_DW to compute friction slope. Matches legacy forcemain_getRoughFactor() in forcmain.c.
| model | Friction model. |
| r_bot | rBot parameter (C for HW, roughness height for DW). |
| length_factor | Factor by which the conduit was artificially lengthened. |
|
constexpr |
Kinematic viscosity @ 20C (ft2/sec)