OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::LinkData Struct Reference

Structure-of-Arrays storage for all links. More...

#include <LinkData.hpp>

Collaboration diagram for openswmm::LinkData:

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< LinkTypetype
 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< XsectShapexsect_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< FlowClassflow_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.
 

Detailed Description

Structure-of-Arrays storage for all links.

All arrays indexed by link index [0, count). Use SimulationContext::link_names to translate name → index.

Member Function Documentation

◆ count()

int openswmm::LinkData::count ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ reset_state()

void openswmm::LinkData::reset_state ( )
inlinenoexcept
Here is the caller graph for this function:

◆ resize()

void openswmm::LinkData::resize ( int  n)
inline
Here is the caller graph for this function:

◆ resize_loads()

void openswmm::LinkData::resize_loads ( int  n_pollutants)
inline

Resize pollutant load arrays after pollutant count is known.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save_state()

void openswmm::LinkData::save_state ( )
inlinenoexcept
Here is the caller graph for this function:

Member Data Documentation

◆ barrels

std::vector<int> openswmm::LinkData::barrels

Number of identical barrels (conduits only, default 1).

◆ beta

std::vector<double> openswmm::LinkData::beta

Manning conveyance factor: beta = PHI * sqrt(|slope|) / n.

Q_normal = beta * S(A) where S is the section factor.

See also
Legacy: Conduit[k].beta

◆ cd

std::vector<double> openswmm::LinkData::cd

Discharge coefficient (dimensionless).

◆ crest_height

std::vector<double> openswmm::LinkData::crest_height

Crest height above upstream node invert (project length units).

◆ culvert_code

std::vector<int> openswmm::LinkData::culvert_code

Culvert type code (1-57, 0 = not a culvert).

See also
Legacy: Link[j].xsect.culvertCode

◆ depth

std::vector<double> openswmm::LinkData::depth

Current water depth at midpoint (project length units).

See also
Legacy: Link[i].newDepth

◆ direction

std::vector<int> openswmm::LinkData::direction

Flow direction: +1 = node1→node2, -1 = reversed.

See also
Legacy: Link[j].direction

◆ dqdh

std::vector<double> openswmm::LinkData::dqdh

Derivative dQ/dH for inlet-controlled culvert flow.

See also
Legacy: Link[j].dqdh

◆ flow

std::vector<double> openswmm::LinkData::flow

Current flow rate (project flow units, +ve = node1→node2).

See also
Legacy: Link[i].newFlow

◆ flow_class

std::vector<FlowClass> openswmm::LinkData::flow_class

Current flow class (DRY, SUBCRITICAL, etc.).

◆ froude

std::vector<double> openswmm::LinkData::froude

Current froude number (absolute).

See also
Legacy: Link[i].froude

◆ has_flap_gate

std::vector<bool> openswmm::LinkData::has_flap_gate

Flap gate on this conduit.

See also
Legacy: Link[j].hasFlapGate

◆ inlet_control

std::vector<bool> openswmm::LinkData::inlet_control

True if inlet control governs for this culvert link.

See also
Legacy: Link[j].inletControl

◆ is_closed

std::vector<bool> openswmm::LinkData::is_closed

True if the link is closed by a control rule.

◆ length

std::vector<double> openswmm::LinkData::length

Conduit length (project length units).

◆ loss_avg

std::vector<double> openswmm::LinkData::loss_avg

Average loss coefficient.

See also
Legacy: Link[j].cLossAvg

◆ loss_inlet

std::vector<double> openswmm::LinkData::loss_inlet

Inlet loss coefficient.

See also
Legacy: Link[j].cLossInlet

◆ loss_outlet

std::vector<double> openswmm::LinkData::loss_outlet

Outlet loss coefficient.

See also
Legacy: Link[j].cLossOutlet

◆ mod_length

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.

See also
Legacy: Conduit[k].modLength

◆ N_FLOW_CLASSES

constexpr int openswmm::LinkData::N_FLOW_CLASSES = 7
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).

See also
Legacy: LinkStats[i].timeInFlowClass[]

◆ node1

std::vector<int> openswmm::LinkData::node1

Upstream node index.

See also
Legacy: Link[i].node1

◆ node2

std::vector<int> openswmm::LinkData::node2

Downstream node index.

See also
Legacy: Link[i].node2

◆ normal_flow_limited

std::vector<bool> openswmm::LinkData::normal_flow_limited

True if normal flow limitation was applied this step.

See also
Legacy: Link[j].normalFlow

◆ offset1

std::vector<double> openswmm::LinkData::offset1

Link offset at upstream node (project length units above invert).

See also
Legacy: Link[i].offset1

◆ offset2

std::vector<double> openswmm::LinkData::offset2

Link offset at downstream node.

See also
Legacy: Link[i].offset2

◆ old_depth

std::vector<double> openswmm::LinkData::old_depth

Depth at the previous timestep.

◆ old_flow

std::vector<double> openswmm::LinkData::old_flow

Flow at the previous timestep.

◆ old_volume

std::vector<double> openswmm::LinkData::old_volume

Volume at the previous timestep.

◆ orate

std::vector<double> openswmm::LinkData::orate

Orifice open/close rate (fraction per second).

Controls how fast setting transitions between 0 and 1. 0 = instantaneous.

See also
Legacy: Orifice[k].orate

◆ param2

std::vector<double> openswmm::LinkData::param2

Rated capacity or parameter 2 (weir side slopes, orifice area, etc.).

◆ pump_curve

std::vector<int> openswmm::LinkData::pump_curve

Pump curve index into TableData.

See also
Legacy: TPump.pumpCurve

◆ pump_init_state

std::vector<bool> openswmm::LinkData::pump_init_state

Initial pump on/off state.

◆ q0

std::vector<double> openswmm::LinkData::q0

Initial flow rate (project flow units).

See also
Legacy: Link[i].q0

◆ q_full

std::vector<double> openswmm::LinkData::q_full

Full-pipe flow rate: q_full = xsect_s_full * beta.

See also
Legacy: Link[j].qFull

◆ q_limit

std::vector<double> openswmm::LinkData::q_limit

Maximum allowable flow rate (project flow units, 0 = unlimited).

See also
Legacy: Link[i].qLimit

◆ q_max

std::vector<double> openswmm::LinkData::q_max

Maximum flow rate at sMax: q_max = xsect_s_max * beta.

See also
Legacy: Conduit[k].qMax

◆ rough_factor

std::vector<double> openswmm::LinkData::rough_factor

Roughness factor for head loss: GRAVITY * (n/PHI)^2.

See also
Legacy: Conduit[k].roughFactor

◆ roughness

std::vector<double> openswmm::LinkData::roughness

Manning's roughness coefficient.

◆ seep_rate

std::vector<double> openswmm::LinkData::seep_rate

Seepage rate (project units).

See also
Legacy: Conduit[k].seepRate

◆ setting

std::vector<double> openswmm::LinkData::setting

Current link setting (0-1 for pumps/orifices/weirs, 1.0 default for conduits).

See also
Legacy: Link[j].setting

◆ slope

std::vector<double> openswmm::LinkData::slope

Conduit slope (rise/run, dimensionless).

◆ stat_flow_class

std::vector<long> openswmm::LinkData::stat_flow_class

◆ stat_inlet_ctrl

std::vector<long> openswmm::LinkData::stat_inlet_ctrl

Count of steps with inlet control.

◆ stat_max_filling

std::vector<double> openswmm::LinkData::stat_max_filling

Maximum reported filling ratio (depth / full depth).

See also
Legacy: LinkStats[i].maxFroude

◆ stat_max_flow

std::vector<double> openswmm::LinkData::stat_max_flow

Maximum reported flow rate (project flow units).

See also
Legacy: LinkStats[i].maxFlow

◆ stat_max_veloc

std::vector<double> openswmm::LinkData::stat_max_veloc

Maximum reported flow velocity (project length/time units).

See also
Legacy: LinkStats[i].maxVeloc

◆ stat_n_pollutants

int openswmm::LinkData::stat_n_pollutants = 0

◆ stat_norm_ltd

std::vector<long> openswmm::LinkData::stat_norm_ltd

Count of steps with normal flow limiting.

◆ stat_time_surcharged

std::vector<double> openswmm::LinkData::stat_time_surcharged

Total duration of surcharge (seconds).

See also
Legacy: LinkStats[i].timeSurcharged

◆ stat_total_load

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.

See also
Legacy: Link[i].totalLoad[p]

◆ stat_vol_flow

std::vector<double> openswmm::LinkData::stat_vol_flow

Total volume conveyed by this link (project volume units).

See also
Legacy: LinkStats[i].volFlow

◆ target_setting

std::vector<double> openswmm::LinkData::target_setting

Target setting from control rules.

See also
Legacy: Link[j].targetSetting

◆ type

std::vector<LinkType> openswmm::LinkData::type

Link type.

◆ volume

std::vector<double> openswmm::LinkData::volume

Current full-flow volume (project volume units).

See also
Legacy: Link[i].newVolume

◆ xsect_a_bot

std::vector<double> openswmm::LinkData::xsect_a_bot

Bottom area for FILLED_CIRCULAR, RECT_TRIANG shapes.

See also
Legacy: Link[j].xsect.aBot

◆ xsect_a_full

std::vector<double> openswmm::LinkData::xsect_a_full

Full-flow area of cross-section (sq project length units).

◆ xsect_curve

std::vector<int> openswmm::LinkData::xsect_curve

Shape curve index (for IRREGULAR / CUSTOM shapes).

-1 for standard shapes.

◆ xsect_r_bot

std::vector<double> openswmm::LinkData::xsect_r_bot

Multi-purpose shape param: wall length (RECT_TRIANG), wetted perimeter (FILLED_CIRCULAR).

See also
Legacy: Link[j].xsect.rBot

◆ xsect_r_full

std::vector<double> openswmm::LinkData::xsect_r_full

Full-pipe hydraulic radius.

See also
Legacy: Link[j].xsect.rFull

◆ xsect_s_bot

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.

See also
Legacy: Link[j].xsect.sBot

◆ xsect_s_full

std::vector<double> openswmm::LinkData::xsect_s_full

Full-pipe section factor.

See also
Legacy: Link[j].xsect.sFull

◆ xsect_s_max

std::vector<double> openswmm::LinkData::xsect_s_max

Maximum section factor (at depth of max conveyance).

See also
Legacy: Link[j].xsect.sMax

◆ xsect_shape

std::vector<XsectShape> openswmm::LinkData::xsect_shape

Cross-section shape.

◆ xsect_w_max

std::vector<double> openswmm::LinkData::xsect_w_max

Full hydraulic width of cross-section.

◆ xsect_y_bot

std::vector<double> openswmm::LinkData::xsect_y_bot

Bottom depth for FILLED_CIRCULAR, RECT_TRIANG, RECT_ROUND shapes.

See also
Legacy: Link[j].xsect.yBot

◆ xsect_y_full

std::vector<double> openswmm::LinkData::xsect_y_full

Full depth of cross-section (project length units).

◆ xsect_yw_max

std::vector<double> openswmm::LinkData::xsect_yw_max

Depth at maximum width.

See also
Legacy: Link[j].xsect.ywMax

The documentation for this struct was generated from the following file: