OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::node Namespace Reference

Functions

double getVolume (const NodeData &nodes, int idx, double depth, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr)
 Evaluate a node depth-volume relation in native units.
 
double getDepth (const NodeData &nodes, int idx, double volume, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr)
 Convert booked storage volume to depth using native geometry.
 
double getSurfArea (const NodeData &nodes, int idx, double depth, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr)
 Evaluate the raw derivative of storage volume with depth.
 
double getPondedArea (const NodeData &nodes, int idx, double depth, TableData *tables=nullptr, int unit_sys=0, const NodeSubtypes *subs=nullptr)
 Select an above-rim ponded area or the raw storage surface area.
 
double getMaxOutflow (const NodeData &nodes, int idx, double q, double dt)
 Limit a proposed nonnegative withdrawal by legacy node storage availability.
 
double getOverflow (double new_volume, double full_volume, double dt)
 Convert excess node water volume into a timestep overflow rate.
 
double storeVolume (const NodeData &nodes, int idx, double depth, double volume)
 Evaluate a transport store using an explicit depth and booked volume.
 
double storeVolume (const NodeData &nodes, int idx)
 Evaluate the mixed transport store from current node state.
 
void computeHeads (const double *invert, const double *depth, double *head, int n)
 Add native invert elevation and depth elementwise.
 
void computeVolumes (const NodeData &nodes, const double *depth, double *volume, const NodeSubtypes *subs=nullptr)
 Evaluate every node volume with US-unit, table-free scalar geometry.
 
void computeOverflows (const double *new_volume, const double *full_volume, double *overflow, double dt, int n)
 Compute per-node overflow from excess native volumes.
 
double getHead (double invert_elev, double depth)
 Compute hydraulic head by adding node invert and depth.
 

Function Documentation

◆ computeHeads()

void openswmm::node::computeHeads ( const double * invert,
const double * depth,
double * head,
int n )

Add native invert elevation and depth elementwise.

No allocation, clamping or finite validation. Partial overlapping spans are not supported.

Parameters
[in]invertReadable n-element elevation array in ft.
[in]depthReadable n-element depth array in ft.
[out]headWritable n-element head array in ft; exact alias with an input is valid.
[in]nNonnegative node count, unchecked.

◆ computeOverflows()

void openswmm::node::computeOverflows ( const double * new_volume,
const double * full_volume,
double * overflow,
double dt,
int n )

Compute per-node overflow from excess native volumes.

For positive dt, outputs max(new_volume-full_volume,0)/dt. Partial overlaps are unsupported; inputs are not checked for finite values.

Parameters
[in]new_volumeReadable n-element current-volume array in ft3.
[in]full_volumeReadable n-element rim-volume array in ft3.
[out]overflowWritable n-element overflow rates in ft3/s; exact alias with an input is valid.
[in]dtTimestep in seconds; <=0 zero-fills output without reading volume arrays.
[in]nNonnegative count; pointer ranges must remain valid even for zero-fill.

◆ computeVolumes()

void openswmm::node::computeVolumes ( const NodeData & nodes,
const double * depth,
double * volume,
const NodeSubtypes * subs = nullptr )

Evaluate every node volume with US-unit, table-free scalar geometry.

Calls getVolume with nullptr tables and unit_sys=0 for each node. Consequently referenced tabular storage returns zero unless an earlier full-volume clamp applies, and authored SI coefficients are not converted with an SI column. Use scalar calls with tables/unit_sys where those project features are required.

Parameters
[in]nodesInitialized node arrays; count() determines all buffer lengths.
[in]depthReadable nodes.count()-element depths in ft; may differ from nodes.depth.
[out]volumeWritable nodes.count()-element volumes in ft3; exact alias with depth is valid.
[in]subsBorrowed optional subtype/LID rows used by getVolume; nullptr supplies default storage coefficients.
Here is the call graph for this function:

◆ getDepth()

double openswmm::node::getDepth ( const NodeData & nodes,
int idx,
double volume,
TableData * tables = nullptr,
int unit_sys = 0,
const NodeSubtypes * subs = nullptr )

Convert booked storage volume to depth using native geometry.

Ordinary storage uses a tabular inverse, direct power/quadratic inverses, or safeguarded Newton in display-unit depth with tolerance 0.001. Positive full_volume clamps to full_depth. A missing referenced table falls back to full_depth*volume/full_volume, or zero without positive full_volume. Non-storage nodes always return volume/MIN_SURFAREA; this need not invert getVolume when full_volume has been overridden. LID Richards divides by surface pore area and caps at surface.top; other LID storage consumes mobile pore capacities in reverse cell order. Valid nondegenerate coefficients/cell dimensions are required; zero denominators and nonfinite input are not diagnosed.

Parameters
[in]nodesInitialized node arrays; all accessed arrays must contain idx.
[in]idxValid nonnegative global node index, unchecked.
[in]volumeWater volume in ft3; negative values return zero before indexing.
[in]tablesBorrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors.
[in]unit_sysValid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system.
[in]subsBorrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained.
Returns
Depth in ft; general Newton cases return the last iterate, capped at full_depth, without reporting convergence.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getHead()

double openswmm::node::getHead ( double invert_elev,
double depth )
inline

Compute hydraulic head by adding node invert and depth.

Parameters
[in]invert_elevInvert elevation in native ft or another unit shared by depth.
[in]depthWater depth in the same length unit.
Returns
invert_elev+depth in their shared datum/unit; no clamping or finite validation.

◆ getMaxOutflow()

double openswmm::node::getMaxOutflow ( const NodeData & nodes,
int idx,
double q,
double dt )

Limit a proposed nonnegative withdrawal by legacy node storage availability.

The eligibility test uses rpt_full_volume, not the internal full_volume bucket. Ordinary junctions/outfalls/dividers are therefore not capped merely because internal mixed storage has a positive capacity.

Parameters
[in]nodesInitialized node arrays; all accessed arrays must contain idx.
[in]idxValid nonnegative global node index, unchecked.
[in]qProposed flow in ft3/s; negative input is returned as zero.
[in]dtPositive timestep in seconds when rpt_full_volume is positive; unchecked.
Returns
max(0,min(q,inflow+old_volume/dt)) for positive rpt_full_volume, otherwise max(0,q).
Here is the caller graph for this function:

◆ getOverflow()

double openswmm::node::getOverflow ( double new_volume,
double full_volume,
double dt )

Convert excess node water volume into a timestep overflow rate.

Parameters
[in]new_volumeBooked current volume in ft3.
[in]full_volumeRim capacity in ft3.
[in]dtTimestep in seconds; nonpositive values return zero.
Returns
(new_volume-full_volume)/dt in ft3/s when both excess and dt are positive; zero otherwise.

◆ getPondedArea()

double openswmm::node::getPondedArea ( const NodeData & nodes,
int idx,
double depth,
TableData * tables = nullptr,
int unit_sys = 0,
const NodeSubtypes * subs = nullptr )

Select an above-rim ponded area or the raw storage surface area.

At/below full_depth, or with exactly zero ponded_area, delegates to getSurfArea at depth. Above the rim a positive ponded_area is returned; a negative stored value falls back to getSurfArea at full_depth. No routing ponding-enable option is examined.

Parameters
[in]nodesInitialized node arrays; all accessed arrays must contain idx.
[in]idxValid nonnegative global node index, unchecked.
[in]depthWater depth in ft.
[in]tablesBorrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors.
[in]unit_sysValid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system.
[in]subsBorrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained.
Returns
Area in ft2.
Here is the call graph for this function:

◆ getSurfArea()

double openswmm::node::getSurfArea ( const NodeData & nodes,
int idx,
double depth,
TableData * tables = nullptr,
int unit_sys = 0,
const NodeSubtypes * subs = nullptr )

Evaluate the raw derivative of storage volume with depth.

LID storage returns the active cell mobile pore area; Richards uses surface area times porosity. Ordinary tables extrapolate and functional/quadratic coefficients are evaluated in display units before conversion. No MIN_SURFAREA floor is applied here; the routing depth update supplies its own floor.

Parameters
[in]nodesInitialized node arrays; all accessed arrays must contain idx.
[in]idxValid nonnegative global node index, unchecked.
[in]depthWater depth in ft; not clamped to zero or full depth.
[in]tablesBorrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors.
[in]unit_sysValid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system.
[in]subsBorrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained.
Returns
Effective storage surface area in ft2, or zero for every non-storage node.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getVolume()

double openswmm::node::getVolume ( const NodeData & nodes,
int idx,
double depth,
TableData * tables = nullptr,
int unit_sys = 0,
const NodeSubtypes * subs = nullptr )

Evaluate a node depth-volume relation in native units.

Storage LID cells take precedence: Richards retains only surface pore water; other LID cells sum depth-filled mobile pore capacity. Ordinary storage clamps to positive full_volume at full_depth, then uses tabular integration or authored functional/quadratic coefficients with per-call display-unit conversion. Other node types scale positive full_volume (or MIN_SURFAREA*full_depth) linearly with depth, without an upper clamp; nonpositive full_depth returns zero.

Parameters
[in]nodesInitialized node arrays; all accessed arrays must contain idx.
[in]idxValid nonnegative global node index, unchecked.
[in]depthWater depth in ft; values <=0 return zero before node indexing.
[in]tablesBorrowed project tables, or nullptr. Referenced missing tables produce zero volume/area; depth uses its documented fallback. These queries do not mutate table contents or lookup cursors.
[in]unit_sysValid Ucf unit-system column (0 US, 1 SI); storage coefficients and tables use this project display system.
[in]subsBorrowed node subtype rows, or nullptr for zero functional storage coefficients. Required for actual storage/LID geometry; no pointer is retained.
Returns
Volume in ft3; no allocation or geometry validation.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ storeVolume() [1/2]

double openswmm::node::storeVolume ( const NodeData & nodes,
int idx )

Evaluate the mixed transport store from current node state.

Requires initialized geometry and current state arrays. No state is modified.

Parameters
[in]nodesInitialized node arrays; all accessed arrays must contain idx.
[in]idxValid nonnegative global node index, unchecked.
Returns
Store volume in ft3; delegates to the explicit-pair overload with nodes.depth and nodes.volume.
Here is the call graph for this function:

◆ storeVolume() [2/2]

double openswmm::node::storeVolume ( const NodeData & nodes,
int idx,
double depth,
double volume )

Evaluate a transport store using an explicit depth and booked volume.

Nonpositive full_depth returns the clamped booked volume. Outfalls retain the supplied booked volume (normally zero), rather than an artificial junction bucket. For junctions/dividers positive full_depth uses min(depth,full_depth)/full_depth; negative depth is not independently clamped. This reconstructs the mixed below-rim store that differs from legacy booked volume.

Parameters
[in]nodesInitialized node arrays; all accessed arrays must contain idx.
[in]idxValid nonnegative global node index, unchecked.
[in]depthWater depth in ft; callers supply nonnegative physical depth.
[in]volumeBooked node volume in ft3; clamped to >=0 before use.
Returns
Storage/outfall booked volume, or a below-rim full_volume fraction plus booked ponded volume above the rim, in ft3.
Here is the caller graph for this function: