OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::forcemain Namespace Reference

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)
 

Enumeration Type Documentation

◆ FrictionModel

enum class openswmm::forcemain::FrictionModel : int
strong
Enumerator
HAZEN_WILLIAMS 
DARCY_WEISBACH 

Function Documentation

◆ batchFricSlope()

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.

Parameters
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.
modelHazen-Williams or Darcy-Weisbach.
countNumber of force mains.
Here is the call graph for this function:

◆ getEquivN()

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.

Parameters
modelFriction model (HAZEN_WILLIAMS or DARCY_WEISBACH).
r_botHydraulic radius parameter stored in xsect (rBot in legacy): for HW: the C-factor; for DW: roughness height (ft).
y_fullFull-pipe depth (ft).
slopeConduit slope (ft/ft, positive).
n_rawRaw Manning's roughness (fallback if model unrecognized).
Returns
Equivalent Manning's n.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFricFactor()

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.

Parameters
r_botRoughness height (ft).
hradHydraulic radius (ft).
reReynolds number (use 1e12 for fully turbulent).
Returns
Darcy-Weisbach friction factor f.
Here is the caller graph for this function:

◆ getFricSlope_DW()

double openswmm::forcemain::getFricSlope_DW ( double  velocity,
double  hyd_rad,
double  roughness 
)

Compute friction slope for Darcy-Weisbach.

Parameters
velocityFlow velocity (ft/sec).
hyd_radHydraulic radius (ft).
roughnessPipe roughness height (ft).
Returns
Friction slope Sf (dimensionless).
Here is the caller graph for this function:

◆ getFricSlope_HW()

double openswmm::forcemain::getFricSlope_HW ( double  velocity,
double  hyd_rad,
double  c_hw 
)

Compute friction slope for Hazen-Williams.

Parameters
velocityFlow velocity (ft/sec).
hyd_radHydraulic radius (ft).
c_hwHazen-Williams C coefficient.
Returns
Friction slope Sf (dimensionless).
Here is the caller graph for this function:

◆ getRoughFactor()

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.

Parameters
modelFriction model.
r_botrBot parameter (C for HW, roughness height for DW).
length_factorFactor by which the conduit was artificially lengthened.
Returns
Roughness factor stored in xsect.sBot.
Here is the caller graph for this function:

Variable Documentation

◆ VISCOS

constexpr double openswmm::forcemain::VISCOS = 1.1e-5
constexpr

Kinematic viscosity @ 20C (ft2/sec)