![]() |
OpenSWMM Engine
6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
|
Classes | |
| struct | GageState |
| struct | PrecipSplit |
| Result of splitting a gage's precipitation for one subcatchment. More... | |
Enumerations | |
| enum class | RainType : int { INTENSITY = 0 , VOLUME = 1 , CUMULATIVE = 2 } |
Functions | |
| double | convertRainfall (double raw_value, GageState &state) |
| Convert raw rainfall value based on rain type. | |
| PrecipSplit | splitPrecip (const SimulationContext &ctx, std::size_t sub) |
| Split a subcatchment's gage precipitation into rain and snow. | |
| void | updatePastRain (GageState &state, double current_time) |
| Update past n-hour rainfall accumulation. | |
| double | getPastRain (const GageState &state, int hours) |
| Get past n-hour rainfall total. | |
| void | updateAllGages (SimulationContext &ctx, double current_time) |
| Process all gages for one timestep. | |
| double | getReportRainfall (const SimulationContext &ctx, int gage_idx, double report_date) |
| Query a gage's rainfall at a specific report date. | |
Variables | |
| constexpr double | ONE_SECOND = 1.1574074e-5 |
| One second in days. | |
| constexpr int | MAXPASTRAIN = 48 |
| Max past hours tracked. | |
|
strong |
| double openswmm::gage::convertRainfall | ( | double | raw_value, |
| GageState & | state ) |
Convert raw rainfall value based on rain type.
| raw_value | Raw value from timeseries. |
| state | Gage state (for accumulators, factors). |
| double openswmm::gage::getPastRain | ( | const GageState & | state, |
| int | hours ) |
Get past n-hour rainfall total.
| state | Gage state. |
| hours | Number of past hours (1 to MAXPASTRAIN). |
| double openswmm::gage::getReportRainfall | ( | const SimulationContext & | ctx, |
| int | gage_idx, | ||
| double | report_date ) |
Query a gage's rainfall at a specific report date.
Matches legacy gage_setReportRainfall(): queries the gage's timeseries at the report time without advancing the cursor. Returns rainfall in user units (in/hr or mm/hr).
| ctx | Simulation context. |
| gage_idx | Gage index. |
| report_date | Absolute OADate (days since 12/30/1899) to query. |
| PrecipSplit openswmm::gage::splitPrecip | ( | const SimulationContext & | ctx, |
| std::size_t | sub ) |
Split a subcatchment's gage precipitation into rain and snow.
The single source of truth for the rain/snow split, mirroring legacy gage_getPrecip() (gage.c:513-523) and adding the subcatchment-level scale factors. Applies, in order:
Both the snowpack path (SWMMEngine) and the plain runoff path (RunoffSolver) MUST route through this. They previously duplicated the logic and drifted: the snowpack path dropped the SCF entirely and the runoff path performed no split at all.
API/forcing overrides are applied by the CALLER, after this returns — they are absolute injections and are deliberately not scaled.
| ctx | Simulation context (gages, subcatchments, climate, options). |
| sub | Subcatchment index. |
| void openswmm::gage::updateAllGages | ( | SimulationContext & | ctx, |
| double | current_time ) |
Process all gages for one timestep.
| ctx | Simulation context (gages + timeseries accessed). |
| current_time | Current simulation time (seconds). |
| void openswmm::gage::updatePastRain | ( | GageState & | state, |
| double | current_time ) |
Update past n-hour rainfall accumulation.
| state | [in/out] Gage state. |
| current_time | Current simulation time (seconds from start). |
|
constexpr |
Max past hours tracked.
|
constexpr |
One second in days.