34#ifndef OPENSWMM_GAGE_HPP
35#define OPENSWMM_GAGE_HPP
153 double& cumul_accum,
double units_factor,
154 double scale_factor);
Structure-of-Arrays (SoA) storage for subcatchments.
constexpr double ONE_SECOND
One second in days.
Definition Gage.hpp:52
double getReportRainfall(const SimulationContext &ctx, int gage_idx, double report_date)
Query a gage's rainfall at a specific report date.
Definition Gage.cpp:337
void updateAllGages(SimulationContext &ctx, double current_time)
Process all gages for one timestep.
Definition Gage.cpp:183
double getPastRain(const GageState &state, int hours)
Get past n-hour rainfall total.
Definition Gage.cpp:117
double gageUnitsFactor(const SimulationContext &ctx, int gage_idx)
The units factor the engine applies to a gage's raw values.
Definition Gage.cpp:145
double convertGageValue(double raw, int rain_type, double interval_sec, double &cumul_accum, double units_factor, double scale_factor)
Apply the rain-type transform, units factor and scale factor.
Definition Gage.cpp:161
void updatePastRain(GageState &state, double current_time)
Update past n-hour rainfall accumulation.
Definition Gage.cpp:101
RainType
Definition Gage.hpp:59
@ INTENSITY
Definition Gage.hpp:60
@ VOLUME
Definition Gage.hpp:61
@ CUMULATIVE
Definition Gage.hpp:62
PrecipSplit splitPrecip(const SimulationContext &ctx, std::size_t sub)
Split a subcatchment's gage precipitation into rain and snow.
Definition Gage.cpp:67
const Table * gageRainSeries(const SimulationContext &ctx, int gage_idx)
The rainfall table a gage actually reads.
Definition Gage.cpp:130
constexpr int MAXPASTRAIN
Max past hours tracked.
Definition Gage.hpp:53
double convertRainfall(double raw_value, GageState &state)
Convert raw rainfall value based on rain type.
Definition Gage.cpp:38
Definition NodeCoupling.cpp:16
Central, reentrant simulation context.
Definition SimulationContext.hpp:353
Definition TableData.hpp:138
double past_rain_time
Time of last past-rain update.
Definition Gage.hpp:84
double rain_interval
Rain recording interval (seconds)
Definition Gage.hpp:79
double rainfall
Current rainfall intensity (project units/sec)
Definition Gage.hpp:70
double past_rain_accum
Accumulator for current hour.
Definition Gage.hpp:83
double scale_factor
Rainfall scaling factor (1.0 = no scaling)
Definition Gage.hpp:76
double snow_factor
Snow catch factor.
Definition Gage.hpp:75
double adjust_factor
Monthly/seasonal adjustment factor.
Definition Gage.hpp:78
double past_rain[MAXPASTRAIN]
Past hourly rainfall totals.
Definition Gage.hpp:82
double total_precip
rainfall + snowfall
Definition Gage.hpp:72
RainType rain_type
Definition Gage.hpp:80
double snowfall
Current snowfall intensity (project units/sec)
Definition Gage.hpp:71
double api_rainfall
API-overridden rainfall (-1 = no override)
Definition Gage.hpp:74
double rain_accum
Cumulative rain accumulator (for CUMULATIVE type)
Definition Gage.hpp:73
double units_factor
Unit conversion factor.
Definition Gage.hpp:77
Result of splitting a gage's precipitation for one subcatchment.
Definition Gage.hpp:159
double snowfall
Snowfall (ft/sec, internal units)
Definition Gage.hpp:161
double rainfall
Rainfall (ft/sec, internal units)
Definition Gage.hpp:160