Saturday, December 28, 2024

SWMM5 inlet.c Summary

 Below is a step-by-step summary describing how street/channel inlets are handled in inlet.c (and referenced in inlet.h) of EPA SWMM 5.2. These methods calculate how much flow in a street or channel is captured by a curb/grate/slotted inlet (or a custom inlet), how much is bypassed, and, for on-sag inlets, how much is conveyed in weir-orifice flow modes.


1. Overview & Purpose

SWMM allows inlets—curb, grate, slotted, or custom—to be placed in street-like or open-channel conduits. These inlets divert part of the conveyance flow into a capture (stormwater) node. The goals:

  1. Capture Flow at each inlet: how much of the approaching street/ channel flow is intercepted.
  2. Bypass: any un-captured flow continues downstream.
  3. Backflow: inlets can receive reverse flow from a surcharged capture node.

Key: For on-grade inlets, the captured flow depends on approach flow, street geometry, and inlet properties (HEC-22 design). For on-sag inlets, the local pond depth sets a weir-orifice flow regime.


2. Data Structures

2.1 TInletDesign array

typedef struct {
    char*   ID;          // ID name
    int     type;        // e.g., GRATE_INLET, CURB_INLET, etc.
    TGrateInlet    grateInlet; 
    TSlottedInlet  slottedInlet;
    TCurbInlet     curbInlet;
    int            customCurve;  // optional rating curve
} TInletDesign;
  • Stores static design parameters (dimensions, type).
  • Multiple inlets share the same TInletDesign.

2.2 TInlet Usage object

struct TInlet {
    int     linkIndex;     // conduit index
    int     designIndex;   // which TInletDesign
    int     nodeIndex;     // capture node
    int     numInlets;     // replicate inlets
    int     placement;     // ON_SAG, ON_GRADE, or AUTOMATIC
    double  clogFactor;    // fraction of unclogged area
    double  flowLimit;     // max inlet capacity (cfs)
    double  localDepress;  // local gutter depression (ft)
    double  localWidth;    // local depressed width (ft)

    double  flowFactor;    // coefficient in Q = flowFactor*(spread^2.67)
    double  flowCapture;   // current captured flow (cfs)
    double  backflow;      // current backflow from node (cfs)
    double  backflowRatio; // fraction of node's overflow that returns here

    TInletStats stats;     // performance stats
    TInlet* nextInlet;     // next TInlet in list
};
  • Each inlet usage is placed on a particular link.
  • Multiple inlets on a link can be assigned. Each can be repeated numInlets times.

Performance Statistics:

  • times flow is present, # times inlet captures flow, etc.

2.3 Shared Variables and Arrays

  • InletDesigns[]: array of all inlet design definitions from [INLETS].
  • FirstInlet: singly-linked list of actual inlets assigned to links.
  • InletFlow[]: array indexed by node, holds total flow captured by inlets going to that node.

3. Input Reading & Construction

  1. inlet_readDesignParams()
    Reads lines from [INLETS] section to fill out TInletDesign objects:

    • GRATE_INLET, CURB_INLET, SLOTTED_INLET, DROP_GRATE_INLET, DROP_CURB_INLET, CUSTOM_INLET, or COMBO_INLET.
  2. inlet_readUsageParams()
    Reads lines from [INLET_USAGE] section to create TInlet objects (the actual usage of a design). Key fields: linkID, inletID, nodeID for capture, numInlets, %Clog, etc.


4. Initialization and Validation

  • inlet_create(nInlets):
    Allocates arrays for inlet designs and captured flows, sets counters.

  • inlet_validate():
    Ensures each inlet is placed on a valid link type (e.g., a street cross-section or rectangular/trapezoidal channel).
    If valid, sets node types (BYPASS vs. CAPTURE) and calculates flow factor.
    If invalid, a warning is issued and the inlet is removed from the link.
    Finally, sets how the total overflow from a capture node is distributed among inlets (backflowRatio).


5. Flow Capturing Logic

5.1 Invoked Flow Steps

inlet_findCapturedFlows(double tStep) is called before flow routing each time step. Steps:

  1. For each inlet, find approach flow:
    • On-grade inlets: approach flow = conduit flow.
    • On-sag inlets: approach flow = inflow to the bypass node.
  2. Compute captured flow using formulas from HEC-22 or custom curves.
  3. Subtract captured flow from the node’s lateral inflow. Add it to the node receiving the captured flow.
  4. Add any node overflow backflow to the bypass node’s inflow.

Key: If more than one inlet is on the same link or node, they’re handled sequentially (since each inlet reduces bypass flow before the next).


5.2 On-Grade Inlets

5.2.1 Conduit Geometry

  • Street cross-sections:
    • Street slope SxSx, longitudinal slope SLSL, gutter depression aa, width WW.
    • Flow factor Qfactor for the formula Q=Qfactor×T2.67Q = \text{Qfactor} \times T^{2.67}.
  • Trapezoidal or rectangular channels can also have an inlet, but different geometry logic.

5.2.2 On-Grade Approach Flow & Bypass

qApproach = totalFlow / (1 or 2 sides);
for i in numInlets:
   qc = computeSingleInletCapture(qBypassed);
   qCaptured += qc;
   qBypassed -= qc;

5.2.3 On-Grade Grate Inlet

  • getGrateInletCapture() uses HEC-22 Equations for splash-over velocity, approach velocity, open area ratio, etc.
    • Ratio of flow in gutter portion vs. entire cross section,
    • Then frontal interception factor and side interception factor.

5.2.4 On-Grade Curb Inlet

  • getCurbInletCapture():
    • Finds length needed for full capture using LfullQ0.42L_{full} \sim Q^{0.42}.
    • Then partial capture fraction if the actual curb length < needed length.

5.2.5 On-Grade Slotted Inlet

  • Modeled like a curb inlet in on-grade conditions.

5.2.6 Combination Inlets

  • Curb + Grate: method calls the curb portion, then leftover approach flow calls the grate portion.

5.3 On-Sag Inlets

getOnSagCapturedFlow() uses weir-orifice style logic. The node’s water depth is used. Each inlet either:

  • Grate Inlet:
    • Weir flow at low depths vs. orifice flow at higher depth.
  • Curb Inlet:
    • Sweeper curb or normal curb equations. HEC-22 derived formula for weir flow if depth < ~1.4 * opening height, else orifice flow.
  • Slotted or Custom handle similarly but with simpler or different rating.

If node is surcharged, the node’s overflow can “backflow” into the inlet, allocated by backflowRatio.


5.4 Custom Inlets

getCustomCapturedFlow():

  • If the design’s curve is type DIVERSION_CURVE, look up capturedFlow = f(approachFlow).
  • If the design’s curve is type RATING_CURVE, look up capturedFlow = f(depthAtBypassNode).

6. Quality-Related Adjustments

inlet_adjustQualInflows():

  • If net captured flow from bypass node j to capture node m is positive, we treat that fraction of pollutant inflow as going to node m, using node j's old pollutant concentration.

inlet_adjustQualOutflows():

  • To avoid double-counting captured flow as a system outflow, the mass flow in captured flow is subtracted from outflow totals, etc.

7. Statistics and Reporting

updateInletStats():

  • Tracks # times the inlet receives approach flow, # times it actually captures flow, peak approach flow, average capture fraction, how often bypass occurs, how often backflow occurs.

inlet_writeStatsReport():

  • Writes a “Street Flow Summary” table:
    • Peak Flow, Max Spread, Max Depth, Inlet ID, # inlets, Peak Capture %, etc.

8. Summary

inlet.c implements the FHWA HEC-22 methodology for capturing flow on-grade or on-sag using standard inlet types (grate, curb, slotted, or combination) or custom rating curves. It integrates with SWMM’s node flow logic by adjusting node inflows for captured flows and handling backflow from surcharged capture nodes. This allows a more detailed representation of street drainage inflow into stormwater nodes.

No comments:

A comprehensive explanation of how minimum travel distance relates to link length in InfoSewer

In hydraulic modeling of sewer networks, the minimum travel distance is a fundamental parameter that affects how accurately the model can si...