OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
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)
 
void computeAllFlows (SimulationContext &ctx, double dt, double *node_new_surf_area=nullptr)
 Compute flow for all non-conduit links (batch by type).
 
void updatePumpTargetSettings (SimulationContext &ctx)
 Evaluate pump startup/shutoff depth hysteresis. Must be called ONCE per timestep BEFORE the DW iteration loop, matching legacy link_setTargetSetting() timing.
 
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)
 Compute flow for ONE non-conduit link (per-link sequential path). PARITY: legacy findLinkFlows (dynwave.c:383-398) processes non-conduits one at a time in link-index order with an immediate updateNodeFlows() scatter, so a later structure (e.g. the second pump on a shared wet well) sees the earlier one's flow in the node accumulators. Callers must scatter the resulting links.flow/dqdh to the node accumulators BEFORE computing the next link.
 
void scatterHeldSurfArea (SimulationContext &ctx, double *node_new_surf_area, int link_idx)
 Scatter the HELD surface area of a bypassed non-conduit link (legacy updateNodeFlows runs for bypassed links too, adding the previous iteration's Link.surfArea1/2). Only orifices carry a non-zero held area (weirs/pumps/outlets contribute none).
 

Member Function Documentation

◆ computeAllFlows()

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

Compute flow for all non-conduit links (batch by type).

For each type group:

  1. Gather upstream/downstream heads from node arrays
  2. Batch compute flow using type-specific equation
  3. Scatter flow + dQ/dH back to link arrays
Parameters
ctxSimulation context.
dtTimestep (seconds).
node_new_surf_areaPer-node surface area from the DW solver's xnode buffer. Read by computePumpFlows (pump flow-limiter, matching legacy getModPumpFlow) and written by computeWeirFlows (weir surface-area scatter, matching legacy findNonConduitSurfArea). Pass nullptr to skip both (pump falls back to MIN_SURFAREA; weir scatter is skipped).

◆ computeNonConduitFlowOne()

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

Compute flow for ONE non-conduit link (per-link sequential path). PARITY: legacy findLinkFlows (dynwave.c:383-398) processes non-conduits one at a time in link-index order with an immediate updateNodeFlows() scatter, so a later structure (e.g. the second pump on a shared wet well) sees the earlier one's flow in the node accumulators. Callers must scatter the resulting links.flow/dqdh to the node accumulators BEFORE computing the next link.

◆ init()

void openswmm::hydstruct::StructureSolver::init ( SimulationContext & ctx)
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 the HELD surface area of a bypassed non-conduit link (legacy updateNodeFlows runs for bypassed links too, adding the previous iteration's Link.surfArea1/2). Only orifices carry a non-zero held area (weirs/pumps/outlets contribute none).

◆ updatePumpTargetSettings()

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

Evaluate pump startup/shutoff depth hysteresis. Must be called ONCE per timestep BEFORE the DW iteration loop, matching legacy link_setTargetSetting() timing.


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