OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm::gage Namespace Reference

Classes

struct  GageState
 

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.
 
void separatePrecip (GageState &state, double intensity, double temperature, double snow_temp)
 Separate rainfall from snowfall based on temperature.
 
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.
 

Variables

constexpr double ONE_SECOND = 1.1574074e-5
 One second in days.
 
constexpr int MAXPASTRAIN = 48
 Max past hours tracked.
 

Enumeration Type Documentation

◆ RainType

enum class openswmm::gage::RainType : int
strong
Enumerator
INTENSITY 
VOLUME 
CUMULATIVE 

Function Documentation

◆ convertRainfall()

double openswmm::gage::convertRainfall ( double  raw_value,
GageState state 
)

Convert raw rainfall value based on rain type.

Parameters
raw_valueRaw value from timeseries.
stateGage state (for accumulators, factors).
Returns
Rainfall intensity (project units/sec).

◆ getPastRain()

double openswmm::gage::getPastRain ( const GageState state,
int  hours 
)

Get past n-hour rainfall total.

Parameters
stateGage state.
hoursNumber of past hours (1 to MAXPASTRAIN).
Returns
Cumulative rainfall over past n hours (project depth units).

◆ separatePrecip()

void openswmm::gage::separatePrecip ( GageState state,
double  intensity,
double  temperature,
double  snow_temp 
)

Separate rainfall from snowfall based on temperature.

Parameters
state[in/out] Gage state. Sets rainfall/snowfall/total_precip.
intensityTotal precipitation intensity (project units/sec).
temperatureCurrent air temperature (project units).
snow_tempSnow temperature threshold (project units).

◆ updateAllGages()

void openswmm::gage::updateAllGages ( SimulationContext ctx,
double  current_time 
)

Process all gages for one timestep.

Parameters
ctxSimulation context (gages + timeseries accessed).
current_timeCurrent simulation time (seconds).
Here is the call graph for this function:

◆ updatePastRain()

void openswmm::gage::updatePastRain ( GageState state,
double  current_time 
)

Update past n-hour rainfall accumulation.

Parameters
state[in/out] Gage state.
current_timeCurrent simulation time (seconds from start).

Variable Documentation

◆ MAXPASTRAIN

constexpr int openswmm::gage::MAXPASTRAIN = 48
constexpr

Max past hours tracked.

◆ ONE_SECOND

constexpr double openswmm::gage::ONE_SECOND = 1.1574074e-5
constexpr

One second in days.