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

#include <HydStructures.hpp>

Collaboration diagram for openswmm::hydstruct::StructureSolver:

Public Member Functions

void init (SimulationContext &ctx)
 Build per-type structure groups and global sequential-dispatch maps.
 
void computeAllFlows (SimulationContext &ctx, double dt, double *node_new_surf_area=nullptr)
 Evaluate grouped pumps, orifices, weirs and outlets in type order.
 
void updatePumpTargetSettings (SimulationContext &ctx)
 Apply pump startup/shutoff hysteresis once before step iterations.
 
const std::vector< int > & nonConduitIndices () const noexcept
 Get pre-built list of all non-conduit link indices.
 
void computeNonConduitFlowOne (SimulationContext &ctx, double dt, double *node_new_surf_area, int link_idx)
 Evaluate one sequential nonconduit or DUMMY link using current node accumulators.
 
void scatterHeldSurfArea (SimulationContext &ctx, double *node_new_surf_area, int link_idx)
 Scatter a bypassed orifice's retained area using current flow classification.
 

Friends

class openswmm::SWMMEngine
 

Member Function Documentation

◆ computeAllFlows()

void openswmm::hydstruct::StructureSolver::computeAllFlows ( SimulationContext & ctx,
double dt,
double * node_new_surf_area = nullptr )

Evaluate grouped pumps, orifices, weirs and outlets in type order.

Pumps run first, then orifices/weirs, then outlets. Only orifices add node surface area; weirs retain a group diagnostic area but do not scatter it. Does not add link flows to node inflow/outflow accumulators or reset all dqdh fields before each type; sequential DW routing uses computeNonConduitFlowOne instead.

Parameters
[in,out]ctxBorrowed resolved native node/link/subtype/curve stores; links flow/depth/class/dqdh and selected table cursors may change. Caller serializes evaluation.
[in]dtPositive routing seconds used for pump donor limits.
[in,out]node_new_surf_areaOptional writable n_nodes ft2 accumulator. Pump evaluation reads donor area; orifices add eligible endpoint area; NULL skips those effects.

◆ computeNonConduitFlowOne()

void openswmm::hydstruct::StructureSolver::computeNonConduitFlowOne ( SimulationContext & ctx,
double dt,
double * node_new_surf_area,
int link_idx )

Evaluate one sequential nonconduit or DUMMY link using current node accumulators.

DUMMY conduit passes upstream inflow+overflow/divider split, subject to setting and flow limit. Other valid mapped types reset dqdh then dispatch one type-group row. Caller must scatter resulting link flow/derivative to node accumulators before evaluating a later structure, preserving shared-wet-well ordering. No generic rollback or finite/input validation.

Parameters
[in,out]ctxBorrowed resolved native node/link/subtype/curve stores; links flow/depth/class/dqdh and selected table cursors may change. Caller serializes evaluation.
[in]dtPositive routing seconds for pump/storage donor limits.
[in,out]node_new_surf_areaOptional writable n_nodes ft2 accumulator. Pump evaluation reads donor area; orifices add eligible endpoint area; NULL skips those effects.
[in]link_idxValid global link index selected from nonConduitIndices; ordinary conduits must not be passed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void openswmm::hydstruct::StructureSolver::init ( SimulationContext & ctx)

Build per-type structure groups and global sequential-dispatch maps.

Copies pump curves/thresholds, raw weir/outlet coefficients and selected geometry, derives effective orifice/weir lengths max(200ft,2*routingStep*sqrt(g*y_full)), and includes DUMMY conduits in the nonconduit index list. Missing/nonpump pump curves select ideal behavior. Does not evaluate flows or validate all authoring; allocation can leave partial caches. Reinitialize after cached authoring/topology edits.

Parameters
[in,out]ctxBorrowed resolved model with valid subtype rows/endpoints and geometry; pump curve_type is written back to its relational store.
Here is the call graph for this function:

◆ nonConduitIndices()

const std::vector< int > & openswmm::hydstruct::StructureSolver::nonConduitIndices ( ) const
inlinenoexcept

Get pre-built list of all non-conduit link indices.

◆ scatterHeldSurfArea()

void openswmm::hydstruct::StructureSolver::scatterHeldSurfArea ( SimulationContext & ctx,
double * node_new_surf_area,
int link_idx )

Scatter a bypassed orifice's retained area using current flow classification.

Uses the previous computed orifice area; half at each end except storage/critical-end suppression. Does not reevaluate opening, flow or depth; other structure types contribute no held area.

Parameters
[in]ctxBorrowed native endpoints/node types/link class; no hydraulic values are mutated.
[in,out]node_new_surf_areaOptional writable n_nodes ft2 accumulator; NULL no-op.
[in]link_idxValid global link index; nonorifices, absent mapped rows or negative endpoints skip.

◆ updatePumpTargetSettings()

void openswmm::hydstruct::StructureSolver::updatePumpTargetSettings ( SimulationContext & ctx)

Apply pump startup/shutoff hysteresis once before step iterations.

For each valid upstream node resets target to current setting, then turns on/off at strict positive startup/shutoff thresholds. Does not immediately write setting or compute flow; computePumpFlowK adopts target. Repeating after depths change within Picard iterations changes the intended hysteresis timing.

Parameters
[in,out]ctxBorrowed current start-of-step node depths ft and pump setting/target columns.

Friends And Related Symbol Documentation

◆ openswmm::SWMMEngine

friend class openswmm::SWMMEngine
friend

The documentation for this class was generated from the following files: