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

#include <RDII.hpp>

Collaboration diagram for openswmm::rdii::RDIISolver:

Public Types

using UhNameMap = std::unordered_map<std::string, int, CiHash, CiEqual>
 UH name → index map type; case-insensitive (legacy hash.c parity).
 

Public Member Functions

void init (SimulationContext &ctx)
 
int addUnitHydParams (const std::string &name, const UnitHydParams &params)
 Register a unit hydrograph parameter set by name.
 
int findUnitHyd (const std::string &name) const
 Look up unit hydrograph index by name.
 
const UhNameMapuhNameIndex () const
 Read-only access to the UH name → index map (for validation).
 
void advance (SimulationContext &ctx, double new_elapsed_sec)
 Advance the strict-grid RDII computation to a runoff clock time.
 
void applyRdiiInflows (SimulationContext &ctx, double elapsed_sec) const
 Apply RDII inflows at a routing time to node lateral flows.
 
const std::vector< double > & nodeFlows () const
 
std::vector< int > rdiiNodeList () const
 

Static Public Member Functions

static int getRainInterval (const UnitHydParams &uh, double wet_step)
 Compute rain processing interval for a UH (minimum limb duration, capped by wet_step).
 
static int getMaxPeriods (const UnitHydParams &uh, int response, int rainInterval)
 Compute max past periods for a UH response given a rain interval.
 

Public Attributes

std::vector< UnitHydParamsuh_params
 
std::vector< std::array< ExpDecayParams, 3 > > decay_params
 

Member Typedef Documentation

◆ UhNameMap

using openswmm::rdii::RDIISolver::UhNameMap = std::unordered_map<std::string, int, CiHash, CiEqual>

UH name → index map type; case-insensitive (legacy hash.c parity).

Member Function Documentation

◆ addUnitHydParams()

int openswmm::rdii::RDIISolver::addUnitHydParams ( const std::string & name,
const UnitHydParams & params )

Register a unit hydrograph parameter set by name.

Parameters
nameUnit hydrograph name (e.g. from [HYDROGRAPHS] section).
paramsComplete UH parameters for all 12 months x 3 responses.
Returns
Index of the registered UH parameter set.
Here is the caller graph for this function:

◆ advance()

void openswmm::rdii::RDIISolver::advance ( SimulationContext & ctx,
double new_elapsed_sec )

Advance the strict-grid RDII computation to a runoff clock time.

Embeds legacy createRdiiFile()'s driver at runtime: RDII is evaluated on the fixed RdiiStep (= wet_step) grid anchored at simulation start, with each group's rainfall processed in its own rain_interval chunks — NOT on the runoff substep cadence. (The previous per-substep accumulator crossed at most one rain interval per runoff substep, so a DRY_STEP jump swallowed the intermediate intervals: dry-period tracking, IA recovery and the convolution grid all corrupted, showing as an RDII onset lead/lag of about one wet step.)

Call once per runoff substep after gage rates (and monthly adjustment) are updated, with the substep's END elapsed time. The substep never crosses a gage entry boundary (the runoff timestep is capped to the next rain date), so the current gage rate is exact for every chunk starting inside the substep. Per-tick node flows are stored float32 with the legacy ZERO_RDII threshold, one grid row per tick, zero-order held over [tick, tick + wet_step) at lookup, matching the RDII interface file's record windows.

◆ applyRdiiInflows()

void openswmm::rdii::RDIISolver::applyRdiiInflows ( SimulationContext & ctx,
double elapsed_sec ) const

Apply RDII inflows at a routing time to node lateral flows.

Looks up the strict-grid row whose window contains elapsed_sec (the START of the routing step, matching legacy addRdiiInflows(currentDate) with currentDate taken at routing_execute entry) and adds the stored float32 flows to nodes.rdii_inflow.

◆ findUnitHyd()

int openswmm::rdii::RDIISolver::findUnitHyd ( const std::string & name) const

Look up unit hydrograph index by name.

Returns
Index, or -1 if not found.
Here is the caller graph for this function:

◆ getMaxPeriods()

int openswmm::rdii::RDIISolver::getMaxPeriods ( const UnitHydParams & uh,
int response,
int rainInterval )
static

Compute max past periods for a UH response given a rain interval.

Here is the caller graph for this function:

◆ getRainInterval()

int openswmm::rdii::RDIISolver::getRainInterval ( const UnitHydParams & uh,
double wet_step )
static

Compute rain processing interval for a UH (minimum limb duration, capped by wet_step).

Here is the caller graph for this function:

◆ init()

void openswmm::rdii::RDIISolver::init ( SimulationContext & ctx)
Here is the call graph for this function:

◆ nodeFlows()

const std::vector< double > & openswmm::rdii::RDIISolver::nodeFlows ( ) const
inline

Buffered per-node RDII flow (CFS), sized n_nodes. Read by the RDII interface file SAVE path (RdiiInterfaceFile::saveFlows).

◆ rdiiNodeList()

std::vector< int > openswmm::rdii::RDIISolver::rdiiNodeList ( ) const

Sorted unique node indices that have an RDII unit-hydrograph inflow (legacy RdiiNodeIndex; used as the SAVE-file header node list).

◆ uhNameIndex()

const UhNameMap & openswmm::rdii::RDIISolver::uhNameIndex ( ) const
inline

Read-only access to the UH name → index map (for validation).

Member Data Documentation

◆ decay_params

std::vector<std::array<ExpDecayParams, 3> > openswmm::rdii::RDIISolver::decay_params

Exponential decay params per UH group × response. Same indexing as uh_params; each entry holds [SHORT, MEDIUM, LONG]. active == false means the response uses the legacy linear IA model.

◆ uh_params

std::vector<UnitHydParams> openswmm::rdii::RDIISolver::uh_params

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