47#ifndef OPENSWMM_INLET_HPP
48#define OPENSWMM_INLET_HPP
160double getEo(
double sr,
double ts,
double w);
188 double q,
double depth);
192 double* weir_flow,
double* orifice_flow);
197 double opening_length,
198 double* weir_flow,
double* orifice_flow);
202 double opening_length,
int throat_angle);
212 const Geom& g,
double depth);
224 const Table& curve,
int curve_kind,
225 double q,
double depth,
226 double ucf_flow,
double ucf_len);
272 std::vector<double>
sx;
337 bool hasInlets() const noexcept {
return soa_.count > 0; }
345 std::vector<double> node_inlet_flow_;
346 std::vector<double> node_inflow_;
352 Design designOf(
int ii)
const;
357 void updateStats(
int ii,
double q);
361 void computeBackflowRatios();
const InletSoA & soa() const noexcept
Definition Inlet.hpp:336
void adjustQualInflows(SimulationContext &ctx, double dt)
Adjust quality inflows at the bypass and capture nodes.
Definition Inlet.cpp:1145
void computeAll(SimulationContext &ctx, double dt)
Compute capture + backflow and fold them into nodes.lat_flow.
Definition Inlet.cpp:876
bool hasInlets() const noexcept
Definition Inlet.hpp:337
void init(SimulationContext &ctx)
Resolve designs, street geometry, host topology and placement.
Definition Inlet.cpp:641
void gatherStats(SimulationContext &ctx) const
Definition Inlet.cpp:1198
Placement
Definition Inlet.hpp:87
@ AUTOMATIC
Definition Inlet.hpp:87
@ ON_SAG
Definition Inlet.hpp:87
@ ON_GRADE
Definition Inlet.hpp:87
void findOnSagGrateFlows(const Design &d, const Geom &g, double depth, double *Qw, double *Qo)
On-sag grate weir/orifice flows, Eq(4-26)/(4-27) (inlet.c:1644).
Definition Inlet.cpp:392
double getInletArea(const Design &d, const UsageParams &u)
Unclogged open area of one usage (ft²) — legacy getInletArea (inlet.c:1870).
Definition Inlet.cpp:562
constexpr double INLET_FUDGE
Legacy FUDGE (consts.h:272).
Definition Inlet.hpp:98
double getOnSagInletCapture(const Design &d, const Geom &g, double depth)
Capture of a single on-sag inlet (inlet.c:1610).
Definition Inlet.cpp:486
double getGutterFlowRatio(const Geom &g, double w)
Ratio of the flow over width w to the total street flow, Eq(4-16) (inlet.c:1518).
Definition Inlet.cpp:186
double getFlowSpread(const Geom &g, double Q)
Width of flow spread, HEC-22 Eq(4-2)/(4-6) (inlet.c:1200).
Definition Inlet.cpp:152
constexpr double MIN_RUNOFF_FLOW
Legacy MIN_RUNOFF_FLOW (consts.h:203) — cfs.
Definition Inlet.hpp:96
double getOnGradeInletCapture(const Design &d, Geom &g, double Q, double depth)
Capture of a single on-grade inlet — type dispatch + COMBO sweeper (inlet.c:1325).
Definition Inlet.cpp:318
double getCurbOrificeFlow(double di, double h, double L, int throat_angle)
Curb-opening orifice flow with the throat-angle head, Eq(4-31a) (inlet.c:1764).
Definition Inlet.cpp:422
CurveKind
InletStore::curve_kind codes for a CUSTOM design.
Definition Inlet.hpp:93
@ UNRESOLVED
Definition Inlet.hpp:93
@ DIVERSION
Definition Inlet.hpp:93
@ RATING
Definition Inlet.hpp:93
double getOnSagCapturedFlow(const Design &d, const UsageParams &u, const Geom &g, double depth)
Total capture of an on-sag usage: single inlet × nsides · num_inlets (inlet.c:1574).
Definition Inlet.cpp:512
double getCustomCapturedFlow(const UsageParams &u, const Geom &g, const Table &curve, int curve_kind, double q, double depth, double ucf_flow, double ucf_len)
Capture of a CUSTOM inlet from its diversion / rating curve (inlet.c:1902).
Definition Inlet.cpp:528
double getOnSagSlottedFlow(const Design &d, double depth)
On-sag slotted drain flow, Eq(4-32)/(4-33) (inlet.c:1785).
Definition Inlet.cpp:477
double getSplashOverVelocity(int grate_type, double L)
Definition Inlet.cpp:203
double getEo(double Sr, double Ts, double w)
HEC-22 Eq(4-4) solved for Eo with Ts/w substituted for (T/w)−1 (inlet.c:1248).
Definition Inlet.cpp:144
double getGutterAreaRatio(const Geom &g, double Wg, double A)
Definition Inlet.cpp:193
GrateType
Legacy enum GrateType (inlet.c:124-127).
Definition Inlet.hpp:74
@ P_BAR_50
Definition Inlet.hpp:75
@ P_BAR_50x100
Definition Inlet.hpp:76
@ P_BAR_30
Definition Inlet.hpp:77
@ GENERIC
Definition Inlet.hpp:82
@ CURVED_VANE
Definition Inlet.hpp:78
@ TILT_BAR_45
Definition Inlet.hpp:79
@ RETICULINE
Definition Inlet.hpp:81
@ TILT_BAR_30
Definition Inlet.hpp:80
InletType
Definition Inlet.hpp:63
@ DROP_GRATE
Definition Inlet.hpp:68
@ GRATE
Definition Inlet.hpp:64
@ DROP_CURB
Definition Inlet.hpp:69
@ CUSTOM
Definition Inlet.hpp:70
@ SLOTTED
Definition Inlet.hpp:67
@ COMBO
Definition Inlet.hpp:66
@ CURB
Definition Inlet.hpp:65
void findOnSagCurbFlows(const Design &d, const Geom &g, double depth, double L, double *Qw, double *Qo)
Definition Inlet.cpp:432
double getOnGradeCapturedFlow(const Design &d, const UsageParams &u, Geom &g, double q, double depth)
Total capture of an on-grade usage: num_inlets in series, both sides (inlet.c:1267).
Definition Inlet.cpp:363
constexpr double INLET_BIG
Legacy BIG (consts.h:118).
Definition Inlet.hpp:100
ThroatAngle
Legacy enum ThroatAngleType (inlet.c:131) — InletStore::curb_throat.
Definition Inlet.hpp:90
@ INCLINED
Definition Inlet.hpp:90
@ VERTICAL
Definition Inlet.hpp:90
@ HORIZONTAL
Definition Inlet.hpp:90
double getGrateInletCapture(const Design &d, Geom &g, double Q)
Definition Inlet.cpp:223
double getCurbInletCapture(const Geom &g, double Q, double L)
On-grade curb-opening capture, Eq(4-22a)/(4-23)/(4-24) (inlet.c:1477).
Definition Inlet.cpp:292
Definition NodeCoupling.cpp:16
@ Q
flow (cfs)
Definition ReactionTokens.hpp:43
Central, reentrant simulation context.
Definition SimulationContext.hpp:353
Definition TableData.hpp:138
Definition XSectBatch.hpp:110
One inlet design in INTERNAL units (legacy TInletDesign, inlet.c:66-74).
Definition Inlet.hpp:134
double slotted_length
ft (0 ⇒ not a slotted drain)
Definition Inlet.hpp:144
double splash_veloc
ft/s, GENERIC grates only
Definition Inlet.hpp:140
int curb_throat
Definition Inlet.hpp:143
double curb_height
ft
Definition Inlet.hpp:142
double grate_width
ft
Definition Inlet.hpp:138
int grate_type
Definition Inlet.hpp:136
double frac_open_area
GENERIC grates only.
Definition Inlet.hpp:139
double curb_length
ft (0 ⇒ no curb half)
Definition Inlet.hpp:141
int type
inlet::InletType
Definition Inlet.hpp:135
double slotted_width
ft
Definition Inlet.hpp:145
double grate_length
ft (0 ⇒ no grate half)
Definition Inlet.hpp:137
Street / channel geometry seen by one inlet, in INTERNAL units.
Definition Inlet.hpp:115
double sl
Conduit longitudinal slope (fraction)
Definition Inlet.hpp:117
double beta
1.486·√SL / n
Definition Inlet.hpp:125
double a
Gutter depression (ft)
Definition Inlet.hpp:119
double n
Manning's roughness.
Definition Inlet.hpp:122
double t_crown
Distance from curb to crown (ft)
Definition Inlet.hpp:124
double sx
Street cross slope (fraction)
Definition Inlet.hpp:116
double sw
Gutter + cross slope.
Definition Inlet.hpp:118
double w
Gutter width (ft)
Definition Inlet.hpp:120
double qfactor
Izzard's f in Q = f·T^2.67.
Definition Inlet.hpp:126
int nsides
1- or 2-sided street
Definition Inlet.hpp:123
const XSectParams * xs
Definition Inlet.hpp:130
double t
Top width of flow spread (ft) — set by getFlowSpread.
Definition Inlet.hpp:121
std::vector< double > q_approach
Approach flow seen this step (cfs)
Definition Inlet.hpp:282
std::vector< int > curve_kind
CUSTOM: inlet::CurveKind.
Definition Inlet.hpp:260
std::vector< int > up_link
Approach conduit (node host: node2 == host)
Definition Inlet.hpp:243
std::vector< double > peak_flow
Peak approach flow (cfs)
Definition Inlet.hpp:291
std::vector< double > flow_capture
Captured flow rate (cfs)
Definition Inlet.hpp:283
std::vector< int > grate_type
Definition Inlet.hpp:249
std::vector< double > slotted_width
ft
Definition Inlet.hpp:258
std::vector< double > local_width
ft
Definition Inlet.hpp:267
std::vector< double > local_depress
ft
Definition Inlet.hpp:266
std::vector< int > up_link2
Second inbound conduit at a sag node host (−1)
Definition Inlet.hpp:244
std::vector< int > inlet_type
Definition Inlet.hpp:248
std::vector< double > gutter_width
ft
Definition Inlet.hpp:274
std::vector< int > flow_periods
Definition Inlet.hpp:288
std::vector< double > bypass_freq
Definition Inlet.hpp:294
std::vector< double > peak_flow_capture
Capture efficiency at peak flow (%)
Definition Inlet.hpp:292
std::vector< double > grate_length
ft
Definition Inlet.hpp:250
std::vector< double > avg_flow_capture
Σ capture efficiency over capture periods.
Definition Inlet.hpp:293
std::vector< double > stat_peak_flow
Peak captured flow (cfs)
Definition Inlet.hpp:300
int count
Definition Inlet.hpp:236
std::vector< int > placement
as authored (inlet::Placement)
Definition Inlet.hpp:268
std::vector< int > num_inlets
Definition Inlet.hpp:263
std::vector< double > t_crown
ft
Definition Inlet.hpp:276
std::vector< int > bypass_node
Node the uncaptured flow stays at.
Definition Inlet.hpp:242
std::vector< double > curb_height
ft
Definition Inlet.hpp:255
std::vector< double > grate_width
ft
Definition Inlet.hpp:251
std::vector< double > slope
Host/approach conduit slope.
Definition Inlet.hpp:278
std::vector< double > backflow_ratio
inlet backflow / capture-node overflow
Definition Inlet.hpp:285
std::vector< double > sx
Cross slope (fraction)
Definition Inlet.hpp:272
std::vector< int > link_idx
Host conduit link index (−1 for a node host)
Definition Inlet.hpp:239
std::vector< double > splash_veloc
ft/s (GENERIC)
Definition Inlet.hpp:253
std::vector< double > stat_capture_vol
ft³
Definition Inlet.hpp:297
std::vector< double > slotted_length
ft
Definition Inlet.hpp:257
std::vector< int > n_sides
Definition Inlet.hpp:277
std::vector< double > curb_length
ft
Definition Inlet.hpp:254
std::vector< double > flow_limit
cfs per inlet (0 = unlimited)
Definition Inlet.hpp:265
std::vector< double > stat_bypass_vol
ft³
Definition Inlet.hpp:298
std::vector< double > backflow
Backflow from the capture node (cfs)
Definition Inlet.hpp:284
std::vector< uint8_t > two_inbound
1 when both attached conduits flow toward the host
Definition Inlet.hpp:245
std::vector< int > node_idx
Capture (receiving) node index.
Definition Inlet.hpp:241
std::vector< int > capture_periods
Definition Inlet.hpp:289
std::vector< double > stat_backflow_vol
ft³
Definition Inlet.hpp:299
std::vector< int > host_node
Host inlet-junction node (−1 for a conduit host)
Definition Inlet.hpp:240
std::vector< double > open_area
GENERIC open-area fraction.
Definition Inlet.hpp:252
std::vector< uint8_t > is_sag
resolved placement: 1 = ON_SAG
Definition Inlet.hpp:269
std::vector< double > road_roughness
Manning's n.
Definition Inlet.hpp:275
std::vector< double > flow_factor
Izzard f = (0.56/n)·√SL·Sx^1.67.
Definition Inlet.hpp:279
void resize(int n)
Definition Inlet.cpp:78
std::vector< double > gutter_depression
ft
Definition Inlet.hpp:273
std::vector< double > clog_factor
Definition Inlet.hpp:264
std::vector< int > curb_throat
0=HORIZONTAL 1=INCLINED 2=VERTICAL
Definition Inlet.hpp:256
std::vector< int > curve_index
CUSTOM: index into ctx.tables.
Definition Inlet.hpp:259
std::vector< int > backflow_periods
Definition Inlet.hpp:290
The per-placement half of one usage row (legacy TInlet fields).
Definition Inlet.hpp:149
int num_inlets
Definition Inlet.hpp:150
double flow_limit
cfs per inlet; 0 ⇒ unlimited
Definition Inlet.hpp:152
double clog_factor
1 − clog/100
Definition Inlet.hpp:151