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

Classes

struct  Design
 One inlet design in INTERNAL units (legacy TInletDesign, inlet.c:66-74). More...
 
struct  Geom
 Street / channel geometry seen by one inlet, in INTERNAL units. More...
 
struct  InletSoA
 
class  InletSolver
 
struct  UsageParams
 The per-placement half of one usage row (legacy TInlet fields). More...
 

Enumerations

enum class  InletType : int {
  GRATE = 0 ,
  CURB = 1 ,
  COMBO = 2 ,
  SLOTTED = 3 ,
  DROP_GRATE = 4 ,
  DROP_CURB = 5 ,
  CUSTOM = 6
}
 
enum class  GrateType : int {
  P_BAR_50 = 0 ,
  P_BAR_50x100 = 1 ,
  P_BAR_30 = 2 ,
  CURVED_VANE = 3 ,
  TILT_BAR_45 = 4 ,
  TILT_BAR_30 = 5 ,
  RETICULINE = 6 ,
  GENERIC = 7
}
 Legacy enum GrateType (inlet.c:124-127). More...
 
enum class  Placement : int {
  AUTOMATIC = 0 ,
  ON_GRADE = 1 ,
  ON_SAG = 2
}
 
enum class  ThroatAngle : int {
  HORIZONTAL = 0 ,
  INCLINED = 1 ,
  VERTICAL = 2
}
 Legacy enum ThroatAngleType (inlet.c:131) — InletStore::curb_throat. More...
 
enum class  CurveKind : int {
  UNRESOLVED = 0 ,
  DIVERSION = 1 ,
  RATING = 2
}
 InletStore::curve_kind codes for a CUSTOM design. More...
 

Functions

double getEo (double sr, double ts, double w)
 Compute the depressed-gutter flow ratio using HEC-22 Eq4-4.
 
double getFlowSpread (const Geom &g, double Q)
 Compute approach flow spread with crown limiting and depressed-gutter iteration.
 
double getGutterFlowRatio (const Geom &g, double w)
 Compute the fraction of street flow above a selected gutter width.
 
double getGutterAreaRatio (const Geom &g, double grate_width, double area)
 Compute the grate-width correction to depressed-gutter intercepted flow.
 
double getSplashOverVelocity (int grate_type, double grate_length)
 Evaluate the standard grate splash-over velocity polynomial.
 
double getGrateInletCapture (const Design &d, Geom &g, double Q)
 Compute one on-grade grate's frontal and side capture.
 
double getCurbInletCapture (const Geom &g, double Q, double opening_length)
 Compute on-grade curb-opening capture from equivalent cross slope.
 
double getOnGradeInletCapture (const Design &d, Geom &g, double Q, double depth)
 Compute a single on-grade inlet or combination sweeper/grate capture.
 
double getOnGradeCapturedFlow (const Design &d, const UsageParams &u, Geom &g, double q, double depth)
 Compute series inlet capture across the current street sides.
 
void findOnSagGrateFlows (const Design &d, const Geom &g, double depth, double *weir_flow, double *orifice_flow)
 Compute the active grate weir or orifice contribution for one sag inlet.
 
double getCurbOrificeFlow (double flow_depth, double opening_height, double opening_length, int throat_angle)
 Compute sag curb-opening orifice flow using throat-adjusted head.
 
void findOnSagCurbFlows (const Design &d, const Geom &g, double depth, double opening_length, double *weir_flow, double *orifice_flow)
 Compute sag curb-opening weir/orifice contributions with transition blending.
 
double getOnSagSlottedFlow (const Design &d, double depth)
 Compute one sag slotted-drain weir or orifice capacity.
 
double getOnSagInletCapture (const Design &d, const Geom &g, double depth)
 Combine one sag inlet's grate, sweeper and curb-orifice contributions.
 
double getOnSagCapturedFlow (const Design &d, const UsageParams &u, const Geom &g, double depth, int nsides_prev)
 Scale sag capacity using usage factors and legacy carried-over street sides.
 
double getCustomCapturedFlow (const UsageParams &u, const Geom &g, const Table &curve, int curve_kind, double q, double depth, double ucf_flow, double ucf_len)
 Compute custom inlet capture from authored diversion or rating curves.
 
double getInletArea (const Design &d, const UsageParams &u)
 Compute the usage's effective open inlet area for backflow weighting.
 

Variables

constexpr double MIN_RUNOFF_FLOW = 0.001
 Legacy MIN_RUNOFF_FLOW (consts.h:203) — cfs.
 
constexpr double INLET_FUDGE = 0.0001
 Legacy FUDGE (consts.h:272).
 
constexpr double INLET_BIG = 1.0e10
 Legacy BIG (consts.h:118).
 

Enumeration Type Documentation

◆ CurveKind

enum class openswmm::inlet::CurveKind : int
strong

InletStore::curve_kind codes for a CUSTOM design.

Enumerator
UNRESOLVED 
DIVERSION 
RATING 

◆ GrateType

enum class openswmm::inlet::GrateType : int
strong

Legacy enum GrateType (inlet.c:124-127).

Enumerator
P_BAR_50 
P_BAR_50x100 
P_BAR_30 
CURVED_VANE 
TILT_BAR_45 
TILT_BAR_30 
RETICULINE 
GENERIC 

◆ InletType

enum class openswmm::inlet::InletType : int
strong

Legacy enum InletType (inlet.c:119-122) — the COMBO slot is the merged GRATE+CURB design the legacy parser encodes as two [INLETS] lines.

Enumerator
GRATE 
CURB 
COMBO 
SLOTTED 
DROP_GRATE 
DROP_CURB 
CUSTOM 

◆ Placement

enum class openswmm::inlet::Placement : int
strong

Legacy enum InletPlacementType (inlet.c:129) — matches the token order of [INLET_USAGE] / [INLET_JUNCTIONS] and InletUsageStore::placement.

Enumerator
AUTOMATIC 
ON_GRADE 
ON_SAG 

◆ ThroatAngle

enum class openswmm::inlet::ThroatAngle : int
strong

Legacy enum ThroatAngleType (inlet.c:131) — InletStore::curb_throat.

Enumerator
HORIZONTAL 
INCLINED 
VERTICAL 

Function Documentation

◆ findOnSagCurbFlows()

void openswmm::inlet::findOnSagCurbFlows ( const Design & d,
const Geom & g,
double depth,
double opening_length,
double * weir_flow,
double * orifice_flow )

Compute sag curb-opening weir/orifice contributions with transition blending.

Uses uniform/long-opening or depressed-gutter weir, then blends toward orifice at1.4*curb_height. Caller supplies nondegenerate transition depths and positive root domains; no automatic output clearing, unit conversion or pointer checks.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]depthNonnegative finite local water depth ft unless explicitly stated otherwise.
[in]opening_lengthCurb length ft; <=0 leaves both outputs unchanged, DROP_CURB multiplies it by4.
[in,out]weir_flowNon-NULL cfs destination initialized by caller; untouched on pure-orifice/no-opening branch.
[in,out]orifice_flowNon-NULL cfs destination initialized by caller; untouched on pure-weir/no-opening branch.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findOnSagGrateFlows()

void openswmm::inlet::findOnSagGrateFlows ( const Design & d,
const Geom & g,
double depth,
double * weir_flow,
double * orifice_flow )

Compute the active grate weir or orifice contribution for one sag inlet.

DROP_GRATE uses all-four-side perimeter; gutter grate adjusts wetted width and mean depth. Transition is depth<=1.79*open_area/perimeter; outputs cfs. Caller supplies positive nondegenerate geometry and valid root/power domains; no full output reset or pointer validation.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]depthNonnegative finite local water depth ft unless explicitly stated otherwise.
[in,out]weir_flowNon-NULL scalar initialized by caller, typically0; assigned only on weir branch, otherwise preserved.
[in,out]orifice_flowNon-NULL scalar initialized by caller, typically0; assigned only on orifice branch, otherwise preserved.
Here is the caller graph for this function:

◆ getCurbInletCapture()

double openswmm::inlet::getCurbInletCapture ( const Geom & g,
double Q,
double opening_length )

Compute on-grade curb-opening capture from equivalent cross slope.

Depressed gutters modify equivalent slope through Eo; full-capture length uses HEC-22 Eq4-22a. Requires positive slope/roughness and valid spread; no independent geometry/finite checks.

Parameters
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]QPositive finite approach discharge cfs; low-level formula does not validate it.
[in]opening_lengthNonnegative curb/slotted opening length ft.
Returns
Approach Q times capture efficiency clamped0..1, cfs.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getCurbOrificeFlow()

double openswmm::inlet::getCurbOrificeFlow ( double flow_depth,
double opening_height,
double opening_length,
int throat_angle )

Compute sag curb-opening orifice flow using throat-adjusted head.

No finite/domain guard or source-flow cap.

Parameters
[in]flow_depthWater depth ft; must leave nonnegative head after throat correction.
[in]opening_heightPositive curb-opening height ft.
[in]opening_lengthNonnegative effective opening length ft.
[in]throat_angleHORIZONTAL subtracts height/2, INCLINED0.7071*height/2; other codes use full depth.
Returns
0.67*height*length*sqrt(64.32*effective_head), cfs.
Here is the caller graph for this function:

◆ getCustomCapturedFlow()

double openswmm::inlet::getCustomCapturedFlow ( const UsageParams & u,
const Geom & g,
const Table & curve,
int curve_kind,
double q,
double depth,
double ucf_flow,
double ucf_len )

Compute custom inlet capture from authored diversion or rating curves.

DIVERSION loops replicates on bypassed per-side flow, applying clog, per-inlet limit and bypass upper cap. RATING multiplies depth-curve output by replicates/clog/sides without applying q or flow_limit caps. No name binding, finite check or inventory booking.

Parameters
[in]uBorrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited).
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]curveBorrowed resolved table with valid shape/sample units; table_lookupEx extrapolation rules apply.
[in]curve_kindDIVERSION means captured versus approach flow; RATING means captured versus depth; other codes return0.
[in]qNonnegative native approach flow cfs.
[in]depthNonnegative finite local water depth ft unless explicitly stated otherwise.
[in]ucf_flowPositive project-display flow units per cfs, for curve x/y conversion.
[in]ucf_lenPositive project-display length units per ft, for rating curve depth.
Returns
Native cfs capture across current positive g.nsides.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEo()

double openswmm::inlet::getEo ( double sr,
double ts,
double w )

Compute the depressed-gutter flow ratio using HEC-22 Eq4-4.

No finite/domain checks or clamping; caller supplies a physically valid nondegenerate geometry.

Parameters
[in]srPositive gutter-to-street cross-slope ratio, dimensionless.
[in]tsPositive spread beyond gutter ft; no zero-denominator guard.
[in]wPositive gutter width ft.
Returns
Dimensionless ratio1/(1+sr/((1+sr/(ts/w))^2.67-1)).
Here is the caller graph for this function:

◆ getFlowSpread()

double openswmm::inlet::getFlowSpread ( const Geom & g,
double Q )

Compute approach flow spread with crown limiting and depressed-gutter iteration.

Undepressed street uses (Q/qfactor)^0.375. Depressed gutter uses a maximum10-update fixed-point solve with0.01ft difference tolerance; last estimate is returned without a convergence flag. Does not assign g.t because geometry is const.

Parameters
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]QPositive finite approach discharge cfs; low-level formula does not validate it.
Returns
Top width/spread ft, capped above by g.t_crown.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGrateInletCapture()

double openswmm::inlet::getGrateInletCapture ( const Design & d,
Geom & g,
double Q )

Compute one on-grade grate's frontal and side capture.

Reads existing spread for street geometry; rectangular/trapezoidal DROP_GRATE may recompute area/depth/width and adjust sx. Uses standard or authored splash velocity and depressed-gutter corrections. This low-level result is not globally clipped to0..Q; outer usage routines apply selected upper caps.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in,out]gBorrowed native geometry; capture routines may update spread t and channel cross-slope sx. Borrowed xs must remain live for the call.
[in]QPositive finite approach discharge cfs; low-level formula does not validate it.
Returns
Native cfs capture from HEC-22 efficiency formulas.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGutterAreaRatio()

double openswmm::inlet::getGutterAreaRatio ( const Geom & g,
double grate_width,
double area )

Compute the grate-width correction to depressed-gutter intercepted flow.

Uses precomputed spread and gutter slopes; no generic denominator/finite guard.

Parameters
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]grate_widthPositive effective grate width ft.
[in]areaPositive total flow cross-section area ft2; denominator after subtracting outside-gutter area must remain positive.
Returns
Dimensionless grate/gutter flow-area ratio, with1 for full-width coverage.
Here is the caller graph for this function:

◆ getGutterFlowRatio()

double openswmm::inlet::getGutterFlowRatio ( const Geom & g,
double w )

Compute the fraction of street flow above a selected gutter width.

No flow calculation, spread refresh or finite/range checks.

Parameters
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]wPositive width ft; g.t is already computed flow spread.
Returns
1 when spread<=w, otherwise depressed-gutter Eo or1-(1-w/t)^2.67.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getInletArea()

double openswmm::inlet::getInletArea ( const Design & d,
const UsageParams & u )

Compute the usage's effective open inlet area for backflow weighting.

Adds grate openings and curb length exceeding grate length; positive slotted length replaces that sum with slot area. Does not multiply street sides or validate dimensions.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in]uBorrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited).
Returns
Native ft2 open area times replicate count and clog factor.

◆ getOnGradeCapturedFlow()

double openswmm::inlet::getOnGradeCapturedFlow ( const Design & d,
const UsageParams & u,
Geom & g,
double q,
double depth )

Compute series inlet capture across the current street sides.

Requires positive g.nsides. Divides approach per side, evaluates replicates on remaining bypass, applies clog/per-inlet limit and bypass upper cap, then multiplies sides. Stops when remaining per-side flow is below MIN_RUNOFF_FLOW; geometry spread can change during evaluation.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in]uBorrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited).
[in,out]gBorrowed native geometry; capture routines may update spread t and channel cross-slope sx. Borrowed xs must remain live for the call.
[in]qFinite approach cfs; q<MIN_RUNOFF_FLOW or zero replicates returns0.
[in]depthNonnegative finite local water depth ft unless explicitly stated otherwise.
Returns
Total native cfs captured across g.nsides.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOnGradeInletCapture()

double openswmm::inlet::getOnGradeInletCapture ( const Design & d,
Geom & g,
double Q,
double depth )

Compute a single on-grade inlet or combination sweeper/grate capture.

DROP_CURB uses sag capacity and DROP_GRATE grate capacity, each upper-limited to Q. SLOTTED uses curb capture. Street combinations compute positive curb length ahead of grate, then grate on remaining Q, refreshing spread as needed. No universal lower clamp or donor inventory booking.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in,out]gBorrowed native geometry; capture routines may update spread t and channel cross-slope sx. Borrowed xs must remain live for the call.
[in]QPositive finite approach discharge cfs; low-level formula does not validate it.
[in]depthNonnegative finite local water depth ft unless explicitly stated otherwise.
Returns
Native cfs capture before usage clog/replicate/flow-limit scaling.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOnSagCapturedFlow()

double openswmm::inlet::getOnSagCapturedFlow ( const Design & d,
const UsageParams & u,
const Geom & g,
double depth,
int nsides_prev )

Scale sag capacity using usage factors and legacy carried-over street sides.

Zero replicates returns0. Does not cap by current approach/disposable volume; caller applies routing-model limits. Previous-side ordering deliberately preserves legacy shared-state behavior.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in]uBorrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited).
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]depthFinite signed depth ft; absolute value is used for sag capacity.
[in]nsides_prevNonnegative side count from previously processed inlet, not necessarily g.nsides; product with num_inlets must fit int.
Returns
Sag capacity cfs after clog/per-inlet limit, multiplied by nsides_prev*num_inlets.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOnSagInletCapture()

double openswmm::inlet::getOnSagInletCapture ( const Design & d,
const Geom & g,
double depth )

Combine one sag inlet's grate, sweeper and curb-orifice contributions.

Positive slotted length takes precedence. Otherwise sums grate/sweeper weir+orifice and only curb-orifice overlap when grate is in orifice mode; excludes overlapping curb-weir contribution to match legacy. No donor cap or validation.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in]gBorrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch.
[in]depthNonnegative finite local water depth ft unless explicitly stated otherwise.
Returns
Native cfs capacity before usage scaling.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOnSagSlottedFlow()

double openswmm::inlet::getOnSagSlottedFlow ( const Design & d,
double depth )

Compute one sag slotted-drain weir or orifice capacity.

Uses2.48*length*depth^1.5 below threshold,0.8*length*width*sqrt(64.32*depth) above. No clog, replicate or approach-flow cap here.

Parameters
[in]dBorrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design.
[in]depthNonnegative finite local water depth ft unless explicitly stated otherwise.
Returns
Native cfs, switching at depth=2.587*slotted_width.
Here is the caller graph for this function:

◆ getSplashOverVelocity()

double openswmm::inlet::getSplashOverVelocity ( int grate_type,
double grate_length )

Evaluate the standard grate splash-over velocity polynomial.

Polynomial is not clamped to nonnegative values; generic designs use their separate authored splash velocity.

Parameters
[in]grate_typeStandard fitted type0..6; GENERIC or out-of-range selects0.
[in]grate_lengthPhysical grate length ft.
Returns
Fitted velocity ft/s, or0 for an unsupported curve.
Here is the caller graph for this function:

Variable Documentation

◆ INLET_BIG

double openswmm::inlet::INLET_BIG = 1.0e10
inlineconstexpr

Legacy BIG (consts.h:118).

◆ INLET_FUDGE

double openswmm::inlet::INLET_FUDGE = 0.0001
inlineconstexpr

Legacy FUDGE (consts.h:272).

◆ MIN_RUNOFF_FLOW

double openswmm::inlet::MIN_RUNOFF_FLOW = 0.001
inlineconstexpr

Legacy MIN_RUNOFF_FLOW (consts.h:203) — cfs.