47#ifndef OPENSWMM_INLET_HPP
48#define OPENSWMM_INLET_HPP
169double getEo(
double sr,
double ts,
double w);
309 double* orifice_flow);
331 double* weir_flow,
double* orifice_flow);
345double getCurbOrificeFlow(
double flow_depth,
double opening_height,
double opening_length,
419 int curve_kind,
double q,
double depth,
double ucf_flow,
477 std::vector<double>
sx;
602 bool hasInlets() const noexcept {
return soa_.count > 0; }
610 std::vector<double> node_inlet_flow_;
611 std::vector<double> node_inflow_;
620 int nsides_prev_ = 0;
625 std::vector<uint8_t> is_capture_node_;
648 Design designOf(
int ii)
const;
668 void updateStats(
int ii,
double q);
679 void computeBackflowRatios();
const InletSoA & soa() const noexcept
Borrow read-only resolved inlet/runtime/statistic columns.
Definition Inlet.hpp:597
void adjustQualInflows(SimulationContext &ctx, double dt)
Add pollutant inflow volume and mass-rate contributions for net inlet exchange.
Definition Inlet.cpp:1233
void computeAll(SimulationContext &ctx, double dt)
Evaluate capture/backflow and add inlet exchanges to node lateral flows.
Definition Inlet.cpp:950
bool hasInlets() const noexcept
Check whether any runtime usage rows are allocated.
Definition Inlet.hpp:602
void adjustFloodingTotals(SimulationContext &ctx, double dt) const
Credit current capture-node overflow returned to inlet corridors out of flooding ledgers.
Definition Inlet.cpp:1288
void init(SimulationContext &ctx)
Resolve inlet deployments into native geometry, topology, placement and backflow weights.
Definition Inlet.cpp:673
void gatherStats(SimulationContext &ctx) const
Publish retained inlet statistics to model usage and reporting stores.
Definition Inlet.cpp:1348
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)
Compute the active grate weir or orifice contribution for one sag inlet.
Definition Inlet.cpp:411
double getInletArea(const Design &d, const UsageParams &u)
Compute the usage's effective open inlet area for backflow weighting.
Definition Inlet.cpp:593
constexpr double INLET_FUDGE
Legacy FUDGE (consts.h:272).
Definition Inlet.hpp:98
double getOnSagInletCapture(const Design &d, const Geom &g, double depth)
Combine one sag inlet's grate, sweeper and curb-orifice contributions.
Definition Inlet.cpp:507
void findOnSagCurbFlows(const Design &d, const Geom &g, double depth, double L, double *Qw, double *Qo)
Compute sag curb-opening weir/orifice contributions with transition blending.
Definition Inlet.cpp:451
double getGutterAreaRatio(const Geom &g, double Wg, double A)
Compute the grate-width correction to depressed-gutter intercepted flow.
Definition Inlet.cpp:198
double getGutterFlowRatio(const Geom &g, double w)
Compute the fraction of street flow above a selected gutter width.
Definition Inlet.cpp:188
double getFlowSpread(const Geom &g, double Q)
Compute approach flow spread with crown limiting and depressed-gutter iteration.
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)
Compute a single on-grade inlet or combination sweeper/grate capture.
Definition Inlet.cpp:332
double getSplashOverVelocity(int grate_type, double L)
Evaluate the standard grate splash-over velocity polynomial.
Definition Inlet.cpp:211
double getCurbOrificeFlow(double di, double h, double L, int throat_angle)
Compute sag curb-opening orifice flow using throat-adjusted head.
Definition Inlet.cpp:441
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.
Definition Inlet.cpp:537
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 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.
Definition Inlet.cpp:557
double getOnSagSlottedFlow(const Design &d, double depth)
Compute one sag slotted-drain weir or orifice capacity.
Definition Inlet.cpp:498
double getEo(double Sr, double Ts, double w)
Compute the depressed-gutter flow ratio using HEC-22 Eq4-4.
Definition Inlet.cpp:144
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
double getOnGradeCapturedFlow(const Design &d, const UsageParams &u, Geom &g, double q, double depth)
Compute series inlet capture across the current street sides.
Definition Inlet.cpp:378
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)
Compute one on-grade grate's frontal and side capture.
Definition Inlet.cpp:235
double getCurbInletCapture(const Geom &g, double Q, double L)
Compute on-grade curb-opening capture from equivalent cross slope.
Definition Inlet.cpp:306
Definition ExchangeLaw.hpp:60
@ Q
flow (cfs)
Definition ReactionTokens.hpp:43
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
Definition TableData.hpp:154
Native cross-section geometry and borrowed optional normalized transect tables.
Definition XSectBatch.hpp:119
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:487
std::vector< int > curve_kind
CUSTOM: inlet::CurveKind.
Definition Inlet.hpp:465
std::vector< int > up_link
Approach conduit (node host: node2 == host)
Definition Inlet.hpp:448
std::vector< double > peak_flow
Peak approach flow (cfs)
Definition Inlet.hpp:496
std::vector< double > flow_capture
Captured flow rate (cfs)
Definition Inlet.hpp:488
std::vector< int > grate_type
Definition Inlet.hpp:454
std::vector< double > slotted_width
ft
Definition Inlet.hpp:463
std::vector< double > local_width
ft
Definition Inlet.hpp:472
std::vector< double > local_depress
ft
Definition Inlet.hpp:471
std::vector< int > up_link2
Second inbound conduit at a sag node host (−1)
Definition Inlet.hpp:449
std::vector< int > inlet_type
Definition Inlet.hpp:453
std::vector< double > gutter_width
ft
Definition Inlet.hpp:479
std::vector< int > flow_periods
Definition Inlet.hpp:493
std::vector< double > bypass_freq
Definition Inlet.hpp:499
std::vector< double > peak_flow_capture
Capture efficiency at peak flow (%)
Definition Inlet.hpp:497
std::vector< double > grate_length
ft
Definition Inlet.hpp:455
std::vector< double > avg_flow_capture
Σ capture efficiency over capture periods.
Definition Inlet.hpp:498
std::vector< double > stat_peak_flow
Peak captured flow (cfs)
Definition Inlet.hpp:505
int count
Definition Inlet.hpp:441
std::vector< int > placement
as authored (inlet::Placement)
Definition Inlet.hpp:473
std::vector< int > num_inlets
Definition Inlet.hpp:468
std::vector< double > t_crown
ft
Definition Inlet.hpp:481
std::vector< int > bypass_node
Node the uncaptured flow stays at.
Definition Inlet.hpp:447
std::vector< double > curb_height
ft
Definition Inlet.hpp:460
std::vector< double > grate_width
ft
Definition Inlet.hpp:456
std::vector< double > slope
Host/approach conduit slope.
Definition Inlet.hpp:483
std::vector< double > backflow_ratio
inlet backflow / capture-node overflow
Definition Inlet.hpp:490
std::vector< double > sx
Cross slope (fraction)
Definition Inlet.hpp:477
std::vector< int > link_idx
Host conduit link index (−1 for a node host)
Definition Inlet.hpp:444
std::vector< double > splash_veloc
ft/s (GENERIC)
Definition Inlet.hpp:458
std::vector< double > stat_capture_vol
ft³
Definition Inlet.hpp:502
std::vector< double > slotted_length
ft
Definition Inlet.hpp:462
std::vector< int > n_sides
Definition Inlet.hpp:482
std::vector< double > curb_length
ft
Definition Inlet.hpp:459
std::vector< double > flow_limit
cfs per inlet (0 = unlimited)
Definition Inlet.hpp:470
std::vector< double > stat_bypass_vol
ft³
Definition Inlet.hpp:503
std::vector< double > backflow
Backflow from the capture node (cfs)
Definition Inlet.hpp:489
std::vector< uint8_t > two_inbound
1 when both attached conduits flow toward the host
Definition Inlet.hpp:450
std::vector< int > node_idx
Capture (receiving) node index.
Definition Inlet.hpp:446
std::vector< int > capture_periods
Definition Inlet.hpp:494
std::vector< double > stat_backflow_vol
ft³
Definition Inlet.hpp:504
std::vector< int > host_node
Host inlet-junction node (−1 for a conduit host)
Definition Inlet.hpp:445
std::vector< double > open_area
GENERIC open-area fraction.
Definition Inlet.hpp:457
std::vector< uint8_t > is_sag
resolved placement: 1 = ON_SAG
Definition Inlet.hpp:474
std::vector< double > road_roughness
Manning's n.
Definition Inlet.hpp:480
std::vector< double > flow_factor
Izzard f = (0.56/n)·√SL·Sx^1.67.
Definition Inlet.hpp:484
void resize(int n)
Reset every inlet runtime/design/statistic column to n rows.
Definition Inlet.cpp:78
std::vector< double > gutter_depression
ft
Definition Inlet.hpp:478
std::vector< double > clog_factor
Definition Inlet.hpp:469
std::vector< int > curb_throat
0=HORIZONTAL 1=INCLINED 2=VERTICAL
Definition Inlet.hpp:461
std::vector< int > curve_index
CUSTOM: index into ctx.tables.
Definition Inlet.hpp:464
std::vector< int > backflow_periods
Definition Inlet.hpp:495
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