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

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.
 

Function Documentation

◆ computeAllConveyance()

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).

Parameters
linksSoA link data (modified in place).
Here is the call graph for this function:

◆ computeConveyance()

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:

  • beta = PHI * sqrt(|slope|) / roughness
  • rough_factor = GRAVITY * (roughness / PHI)^2
  • q_full = s_full * beta
Parameters
roughnessManning's n.
slopeConduit slope (rise/run).
s_fullSection factor at full depth (ft^8/3).
[out]betaManning conveyance factor.
[out]rough_factorHead loss coefficient.
[out]q_fullFull-pipe flow rate (ft3/s).
Here is the caller graph for this function:

◆ computeFroude()

void openswmm::link::computeFroude ( const LinkData links,
const double *  velocity,
double *  froude 
)

Compute Froude numbers for all conduit links.

Parameters
linksSoA link data.
velocity[in] Velocity array.
froude[out] Froude number array (indexed by link).
Here is the call graph for this function:

◆ computeVelocities()

void openswmm::link::computeVelocities ( const LinkData links,
double *  velocity 
)

Compute velocity for all links in batch.

Parameters
linksSoA link data.
xs_groupsShape-grouped xsect manager (for area computation).
velocity[out] Velocity array (indexed by link).
Here is the call graph for this function:

◆ getCapacity()

double openswmm::link::getCapacity ( const XSectParams xs,
double  depth 
)

Compute the capacity fraction (depth / full depth for conduits, setting for other links).

Here is the call graph for this function:

◆ getDepthFromFlow()

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).

Parameters
xsCross-section parameters.
betaManning conveyance factor.
qFlow rate (ft3/s).
Returns
Normal depth (ft).
Here is the call graph for this function:

◆ getFroude()

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.

Parameters
xsCross-section parameters.
vVelocity (ft/s).
yWater depth (ft).
Returns
Froude number (dimensionless).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVelocity()

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.

Parameters
xsCross-section parameters.
flowFlow rate (ft3/s).
depthWater depth (ft).
barrelsNumber of identical barrels (default 1).
Returns
Velocity (ft/s).
Here is the call graph for this function: