![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Structure-of-Arrays storage for all links. More...
#include <LinkData.hpp>
Public Member Functions | |
| int | count () const noexcept |
| void | resize (int n) |
| void | resize_loads (int n_pollutants) |
| Resize pollutant load arrays after pollutant count is known. | |
| void | save_state () noexcept |
| void | reset_state () noexcept |
Public Attributes | |
| std::vector< LinkType > | type |
| Link type. | |
| std::vector< int > | node1 |
| Upstream node index. | |
| std::vector< int > | node2 |
| Downstream node index. | |
| std::vector< double > | offset1 |
| Link offset at upstream node (project length units above invert). | |
| std::vector< double > | offset2 |
| Link offset at downstream node. | |
| std::vector< double > | q0 |
| Initial flow rate (project flow units). | |
| std::vector< double > | q_limit |
| Maximum allowable flow rate (project flow units, 0 = unlimited). | |
| std::vector< XsectShape > | xsect_shape |
| Cross-section shape. | |
| std::vector< double > | xsect_y_full |
| Full depth of cross-section (project length units). | |
| std::vector< double > | xsect_a_full |
| Full-flow area of cross-section (sq project length units). | |
| std::vector< double > | xsect_w_max |
| Full hydraulic width of cross-section. | |
| std::vector< int > | xsect_curve |
| Shape curve index (for IRREGULAR / CUSTOM shapes). | |
| std::vector< double > | roughness |
| Manning's roughness coefficient. | |
| std::vector< double > | length |
| Conduit length (project length units). | |
| std::vector< double > | slope |
| Conduit slope (rise/run, dimensionless). | |
| std::vector< double > | mod_length |
| Modified conduit length for CFL stability (project length units). | |
| std::vector< int > | barrels |
| Number of identical barrels (conduits only, default 1). | |
| std::vector< double > | beta |
| Manning conveyance factor: beta = PHI * sqrt(|slope|) / n. | |
| std::vector< double > | rough_factor |
| Roughness factor for head loss: GRAVITY * (n/PHI)^2. | |
| std::vector< double > | q_full |
| Full-pipe flow rate: q_full = xsect_s_full * beta. | |
| std::vector< double > | xsect_r_full |
| Full-pipe hydraulic radius. | |
| std::vector< double > | xsect_s_full |
| Full-pipe section factor. | |
| std::vector< double > | xsect_s_max |
| Maximum section factor (at depth of max conveyance). | |
| std::vector< double > | q_max |
| Maximum flow rate at sMax: q_max = xsect_s_max * beta. | |
| std::vector< double > | xsect_y_bot |
| Bottom depth for FILLED_CIRCULAR, RECT_TRIANG, RECT_ROUND shapes. | |
| std::vector< double > | xsect_a_bot |
| Bottom area for FILLED_CIRCULAR, RECT_TRIANG shapes. | |
| std::vector< double > | xsect_s_bot |
| Multi-purpose shape param: side slope (RECT_TRIANG), C-factor (FORCE_MAIN), number of open sides (RECT_OPEN), etc. | |
| std::vector< double > | xsect_r_bot |
| Multi-purpose shape param: wall length (RECT_TRIANG), wetted perimeter (FILLED_CIRCULAR). | |
| std::vector< double > | xsect_yw_max |
| Depth at maximum width. | |
| std::vector< double > | setting |
| Current link setting (0-1 for pumps/orifices/weirs, 1.0 default for conduits). | |
| std::vector< double > | target_setting |
| Target setting from control rules. | |
| std::vector< int > | direction |
| Flow direction: +1 = node1→node2, -1 = reversed. | |
| std::vector< int > | pump_curve |
| Pump curve index into TableData. | |
| std::vector< bool > | pump_init_state |
| Initial pump on/off state. | |
| std::vector< double > | loss_inlet |
| Inlet loss coefficient. | |
| std::vector< double > | loss_outlet |
| Outlet loss coefficient. | |
| std::vector< double > | loss_avg |
| Average loss coefficient. | |
| std::vector< bool > | has_flap_gate |
| Flap gate on this conduit. | |
| std::vector< double > | seep_rate |
| Seepage rate (project units). | |
| std::vector< int > | culvert_code |
| Culvert type code (1-57, 0 = not a culvert). | |
| std::vector< bool > | normal_flow_limited |
| std::vector< bool > | inlet_control |
| True if inlet control governs for this culvert link. | |
| std::vector< double > | dqdh |
| Derivative dQ/dH for inlet-controlled culvert flow. | |
| std::vector< double > | crest_height |
| Crest height above upstream node invert (project length units). | |
| std::vector< double > | cd |
| Discharge coefficient (dimensionless). | |
| std::vector< double > | param2 |
| Rated capacity or parameter 2 (weir side slopes, orifice area, etc.). | |
| std::vector< double > | orate |
| Orifice open/close rate (fraction per second). | |
| std::vector< double > | flow |
| Current flow rate (project flow units, +ve = node1→node2). | |
| std::vector< double > | depth |
| Current water depth at midpoint (project length units). | |
| std::vector< double > | volume |
| Current full-flow volume (project volume units). | |
| std::vector< double > | froude |
| Current froude number (absolute). | |
| std::vector< FlowClass > | flow_class |
| Current flow class (DRY, SUBCRITICAL, etc.). | |
| std::vector< bool > | is_closed |
| True if the link is closed by a control rule. | |
| std::vector< double > | old_flow |
| Flow at the previous timestep. | |
| std::vector< double > | old_depth |
| Depth at the previous timestep. | |
| std::vector< double > | old_volume |
| Volume at the previous timestep. | |
| std::vector< double > | stat_vol_flow |
| Total volume conveyed by this link (project volume units). | |
| std::vector< double > | stat_max_flow |
| Maximum reported flow rate (project flow units). | |
| std::vector< double > | stat_max_veloc |
| Maximum reported flow velocity (project length/time units). | |
| std::vector< double > | stat_max_filling |
| Maximum reported filling ratio (depth / full depth). | |
| std::vector< double > | stat_time_surcharged |
| Total duration of surcharge (seconds). | |
| std::vector< long > | stat_flow_class |
| std::vector< long > | stat_norm_ltd |
| Count of steps with normal flow limiting. | |
| std::vector< long > | stat_inlet_ctrl |
| Count of steps with inlet control. | |
| std::vector< double > | stat_total_load |
| Cumulative pollutant loads transported through each link. | |
| int | stat_n_pollutants = 0 |
Static Public Attributes | |
| static constexpr int | N_FLOW_CLASSES = 7 |
| Per-link flow classification step counts. | |
Structure-of-Arrays storage for all links.
All arrays indexed by link index [0, count). Use SimulationContext::link_names to translate name → index.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
Resize pollutant load arrays after pollutant count is known.
|
inlinenoexcept |
| std::vector<int> openswmm::LinkData::barrels |
Number of identical barrels (conduits only, default 1).
| std::vector<double> openswmm::LinkData::beta |
| std::vector<double> openswmm::LinkData::cd |
Discharge coefficient (dimensionless).
| std::vector<double> openswmm::LinkData::crest_height |
Crest height above upstream node invert (project length units).
| std::vector<int> openswmm::LinkData::culvert_code |
Culvert type code (1-57, 0 = not a culvert).
| std::vector<double> openswmm::LinkData::depth |
Current water depth at midpoint (project length units).
| std::vector<int> openswmm::LinkData::direction |
| std::vector<double> openswmm::LinkData::dqdh |
| std::vector<double> openswmm::LinkData::flow |
Current flow rate (project flow units, +ve = node1→node2).
| std::vector<FlowClass> openswmm::LinkData::flow_class |
Current flow class (DRY, SUBCRITICAL, etc.).
| std::vector<double> openswmm::LinkData::froude |
| std::vector<bool> openswmm::LinkData::has_flap_gate |
Flap gate on this conduit.
| std::vector<bool> openswmm::LinkData::inlet_control |
True if inlet control governs for this culvert link.
| std::vector<bool> openswmm::LinkData::is_closed |
True if the link is closed by a control rule.
| std::vector<double> openswmm::LinkData::length |
Conduit length (project length units).
| std::vector<double> openswmm::LinkData::loss_avg |
Average loss coefficient.
| std::vector<double> openswmm::LinkData::loss_inlet |
Inlet loss coefficient.
| std::vector<double> openswmm::LinkData::loss_outlet |
Outlet loss coefficient.
| std::vector<double> openswmm::LinkData::mod_length |
Modified conduit length for CFL stability (project length units).
Computed as lengthFactor * length where lengthFactor >= 1.0. Short conduits are virtually lengthened to satisfy the Courant criterion at full-flow conditions.
|
staticconstexpr |
Per-link flow classification step counts.
Flat 2D: [link * N_FLOW_CLASSES + class], where N_FLOW_CLASSES = 7. Indexed by FlowClass enum (DRY=0..DN_CRITICAL=6).
| std::vector<bool> openswmm::LinkData::normal_flow_limited |
True if normal flow limitation was applied this step.
| std::vector<double> openswmm::LinkData::offset1 |
| std::vector<double> openswmm::LinkData::offset2 |
| std::vector<double> openswmm::LinkData::old_depth |
Depth at the previous timestep.
| std::vector<double> openswmm::LinkData::old_flow |
Flow at the previous timestep.
| std::vector<double> openswmm::LinkData::old_volume |
Volume at the previous timestep.
| std::vector<double> openswmm::LinkData::orate |
| std::vector<double> openswmm::LinkData::param2 |
Rated capacity or parameter 2 (weir side slopes, orifice area, etc.).
| std::vector<int> openswmm::LinkData::pump_curve |
Pump curve index into TableData.
| std::vector<bool> openswmm::LinkData::pump_init_state |
Initial pump on/off state.
| std::vector<double> openswmm::LinkData::q0 |
| std::vector<double> openswmm::LinkData::q_full |
Full-pipe flow rate: q_full = xsect_s_full * beta.
| std::vector<double> openswmm::LinkData::q_limit |
Maximum allowable flow rate (project flow units, 0 = unlimited).
| std::vector<double> openswmm::LinkData::q_max |
Maximum flow rate at sMax: q_max = xsect_s_max * beta.
| std::vector<double> openswmm::LinkData::rough_factor |
Roughness factor for head loss: GRAVITY * (n/PHI)^2.
| std::vector<double> openswmm::LinkData::roughness |
Manning's roughness coefficient.
| std::vector<double> openswmm::LinkData::seep_rate |
Seepage rate (project units).
| std::vector<double> openswmm::LinkData::setting |
| std::vector<double> openswmm::LinkData::slope |
Conduit slope (rise/run, dimensionless).
| std::vector<long> openswmm::LinkData::stat_flow_class |
| std::vector<long> openswmm::LinkData::stat_inlet_ctrl |
Count of steps with inlet control.
| std::vector<double> openswmm::LinkData::stat_max_filling |
Maximum reported filling ratio (depth / full depth).
| std::vector<double> openswmm::LinkData::stat_max_flow |
Maximum reported flow rate (project flow units).
| std::vector<double> openswmm::LinkData::stat_max_veloc |
Maximum reported flow velocity (project length/time units).
| int openswmm::LinkData::stat_n_pollutants = 0 |
| std::vector<long> openswmm::LinkData::stat_norm_ltd |
Count of steps with normal flow limiting.
| std::vector<double> openswmm::LinkData::stat_time_surcharged |
Total duration of surcharge (seconds).
| std::vector<double> openswmm::LinkData::stat_total_load |
Cumulative pollutant loads transported through each link.
Flat 2D: [link * n_pollutants + p]. Resized by resize_loads() after pollutant count is known.
| std::vector<double> openswmm::LinkData::stat_vol_flow |
Total volume conveyed by this link (project volume units).
| std::vector<double> openswmm::LinkData::target_setting |
Target setting from control rules.
| std::vector<LinkType> openswmm::LinkData::type |
Link type.
| std::vector<double> openswmm::LinkData::volume |
Current full-flow volume (project volume units).
| std::vector<double> openswmm::LinkData::xsect_a_bot |
Bottom area for FILLED_CIRCULAR, RECT_TRIANG shapes.
| std::vector<double> openswmm::LinkData::xsect_a_full |
Full-flow area of cross-section (sq project length units).
| std::vector<int> openswmm::LinkData::xsect_curve |
Shape curve index (for IRREGULAR / CUSTOM shapes).
-1 for standard shapes.
| std::vector<double> openswmm::LinkData::xsect_r_bot |
Multi-purpose shape param: wall length (RECT_TRIANG), wetted perimeter (FILLED_CIRCULAR).
| std::vector<double> openswmm::LinkData::xsect_r_full |
Full-pipe hydraulic radius.
| std::vector<double> openswmm::LinkData::xsect_s_bot |
Multi-purpose shape param: side slope (RECT_TRIANG), C-factor (FORCE_MAIN), number of open sides (RECT_OPEN), etc.
| std::vector<double> openswmm::LinkData::xsect_s_full |
Full-pipe section factor.
| std::vector<double> openswmm::LinkData::xsect_s_max |
Maximum section factor (at depth of max conveyance).
| std::vector<XsectShape> openswmm::LinkData::xsect_shape |
Cross-section shape.
| std::vector<double> openswmm::LinkData::xsect_w_max |
Full hydraulic width of cross-section.
| std::vector<double> openswmm::LinkData::xsect_y_bot |
Bottom depth for FILLED_CIRCULAR, RECT_TRIANG, RECT_ROUND shapes.
| std::vector<double> openswmm::LinkData::xsect_y_full |
Full depth of cross-section (project length units).
| std::vector<double> openswmm::LinkData::xsect_yw_max |
Depth at maximum width.