![]() |
OpenSWMM Engine
6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
|
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). | |
|
strong |
InletStore::curve_kind codes for a CUSTOM design.
| Enumerator | |
|---|---|
| UNRESOLVED | |
| DIVERSION | |
| RATING | |
|
strong |
|
strong |
|
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 | |
|
strong |
Legacy enum ThroatAngleType (inlet.c:131) — InletStore::curb_throat.
| Enumerator | |
|---|---|
| HORIZONTAL | |
| INCLINED | |
| VERTICAL | |
| 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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | depth | Nonnegative finite local water depth ft unless explicitly stated otherwise. |
| [in] | opening_length | Curb length ft; <=0 leaves both outputs unchanged, DROP_CURB multiplies it by4. |
| [in,out] | weir_flow | Non-NULL cfs destination initialized by caller; untouched on pure-orifice/no-opening branch. |
| [in,out] | orifice_flow | Non-NULL cfs destination initialized by caller; untouched on pure-weir/no-opening branch. |
| 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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | depth | Nonnegative finite local water depth ft unless explicitly stated otherwise. |
| [in,out] | weir_flow | Non-NULL scalar initialized by caller, typically0; assigned only on weir branch, otherwise preserved. |
| [in,out] | orifice_flow | Non-NULL scalar initialized by caller, typically0; assigned only on orifice branch, otherwise preserved. |
| 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.
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | Q | Positive finite approach discharge cfs; low-level formula does not validate it. |
| [in] | opening_length | Nonnegative curb/slotted opening length ft. |
| 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.
| [in] | flow_depth | Water depth ft; must leave nonnegative head after throat correction. |
| [in] | opening_height | Positive curb-opening height ft. |
| [in] | opening_length | Nonnegative effective opening length ft. |
| [in] | throat_angle | HORIZONTAL subtracts height/2, INCLINED0.7071*height/2; other codes use full depth. |
| 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.
| [in] | u | Borrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited). |
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | curve | Borrowed resolved table with valid shape/sample units; table_lookupEx extrapolation rules apply. |
| [in] | curve_kind | DIVERSION means captured versus approach flow; RATING means captured versus depth; other codes return0. |
| [in] | q | Nonnegative native approach flow cfs. |
| [in] | depth | Nonnegative finite local water depth ft unless explicitly stated otherwise. |
| [in] | ucf_flow | Positive project-display flow units per cfs, for curve x/y conversion. |
| [in] | ucf_len | Positive project-display length units per ft, for rating curve depth. |
| 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.
| [in] | sr | Positive gutter-to-street cross-slope ratio, dimensionless. |
| [in] | ts | Positive spread beyond gutter ft; no zero-denominator guard. |
| [in] | w | Positive gutter width ft. |
| 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.
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | Q | Positive finite approach discharge cfs; low-level formula does not validate it. |
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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in,out] | g | Borrowed native geometry; capture routines may update spread t and channel cross-slope sx. Borrowed xs must remain live for the call. |
| [in] | Q | Positive finite approach discharge cfs; low-level formula does not validate it. |
| 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.
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | grate_width | Positive effective grate width ft. |
| [in] | area | Positive total flow cross-section area ft2; denominator after subtracting outside-gutter area must remain positive. |
| 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.
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | w | Positive width ft; g.t is already computed flow spread. |
| 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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in] | u | Borrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited). |
| 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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in] | u | Borrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited). |
| [in,out] | g | Borrowed native geometry; capture routines may update spread t and channel cross-slope sx. Borrowed xs must remain live for the call. |
| [in] | q | Finite approach cfs; q<MIN_RUNOFF_FLOW or zero replicates returns0. |
| [in] | depth | Nonnegative finite local water depth ft unless explicitly stated otherwise. |
| 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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in,out] | g | Borrowed native geometry; capture routines may update spread t and channel cross-slope sx. Borrowed xs must remain live for the call. |
| [in] | Q | Positive finite approach discharge cfs; low-level formula does not validate it. |
| [in] | depth | Nonnegative finite local water depth ft unless explicitly stated otherwise. |
| 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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in] | u | Borrowed usage with nonnegative replicate count, clog factor0..1 and per-inlet flow_limit cfs (<=0 means unlimited). |
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | depth | Finite signed depth ft; absolute value is used for sag capacity. |
| [in] | nsides_prev | Nonnegative side count from previously processed inlet, not necessarily g.nsides; product with num_inlets must fit int. |
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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in] | g | Borrowed native street/channel geometry with positive physical slopes/roughness/dimensions needed by the chosen branch. |
| [in] | depth | Nonnegative finite local water depth ft unless explicitly stated otherwise. |
| 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.
| [in] | d | Borrowed validated inlet design in native ft/ft per second; coefficients/types must match the selected physical design. |
| [in] | depth | Nonnegative finite local water depth ft unless explicitly stated otherwise. |
| 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.
| [in] | grate_type | Standard fitted type0..6; GENERIC or out-of-range selects0. |
| [in] | grate_length | Physical grate length ft. |
|
inlineconstexpr |
Legacy BIG (consts.h:118).
|
inlineconstexpr |
Legacy FUDGE (consts.h:272).
|
inlineconstexpr |
Legacy MIN_RUNOFF_FLOW (consts.h:203) — cfs.