OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
Gage.hpp File Reference

Rain gage processing — rainfall interpolation, type conversion. More...

#include "../data/SubcatchData.hpp"
#include <cstddef>
#include <vector>
Include dependency graph for Gage.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmm::gage::GageState
 
struct  openswmm::gage::PrecipSplit
 Result of splitting a gage's precipitation for one subcatchment. More...
 

Namespaces

namespace  openswmm
 
namespace  openswmm::gage
 Rain records, accepted runoff-clock state and read-only report lookups. Context routines require aligned initialized gage/subcatchment arrays, valid project units and ordered finite table x/y pairs unless stated otherwise. State mutations are immediate; serialize updates with reads and use private copies for trials. Only precipitation splits convert rates to internal ft/s.
 

Enumerations

enum class  openswmm::gage::RainType : int {
  openswmm::gage::INTENSITY = 0 ,
  openswmm::gage::VOLUME = 1 ,
  openswmm::gage::CUMULATIVE = 2
}
 

Functions

double openswmm::gage::convertRainfall (double raw_value, GageState &state)
 Transform one raw rain record with standalone GageState factors.
 
const Table * openswmm::gage::gageRainSeries (const SimulationContext &ctx, int gage_idx)
 Borrow the actual resolved source table for a gage.
 
bool openswmm::gage::gageIsUsed (const SimulationContext &ctx, int gage_idx)
 Test whether the model or enabled rainfall mesh consumes a gage.
 
double openswmm::gage::gageNextRainDate (const SimulationContext &ctx, int gage_idx, double t)
 Read the next runoff-clock rainfall boundary from cached gage state.
 
double openswmm::gage::gageNextRateChange (const SimulationContext &ctx, int gage_idx, double date, double limit)
 Forecast the end of the current held rain rate without changing source state.
 
double openswmm::gage::gageUnitsFactor (const SimulationContext &ctx, int gage_idx)
 Return the source-storage-to-project rainfall depth multiplier.
 
int openswmm::gage::gageSeriesRainType (const SimulationContext &ctx, int gage_idx)
 Select the transform appropriate to resolved source storage.
 
double openswmm::gage::convertGageValue (double raw, int rain_type, double interval_sec, double &cumul_accum, double units_factor, double scale_factor)
 Transform one source record and apply units then scale factors.
 
PrecipSplit openswmm::gage::splitPrecip (const SimulationContext &ctx, std::size_t sub)
 Split a subcatchment's current gage intensity into internal rain and snow.
 
void openswmm::gage::updatePastRain (GageState &state, int time_step)
 Accumulate a standalone gage's held intensity into completed-hour history.
 
void openswmm::gage::updatePastRain (SimulationContext &ctx, int time_step)
 Accumulate every gage's current held rate over one accepted runoff step.
 
double openswmm::gage::getPastRain (const GageState &state, int hours)
 Sum completed hourly depth buckets, excluding the current partial hour.
 
void openswmm::gage::updateAllGages (SimulationContext &ctx, double current_time)
 Advance used gage record state and publish current effective rainfall.
 
double openswmm::gage::getReportRainfall (const SimulationContext &ctx, int gage_idx, double report_date)
 Query rainfall using the most recently advanced runoff-gage state.
 
double openswmm::gage::getReportRainfallFromSeries (const SimulationContext &ctx, int gage_idx, double report_date)
 Query report-time source records independently of a later runoff cursor.
 

Variables

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

Detailed Description

Rain gage processing — rainfall interpolation, type conversion.

Processes rainfall from timeseries or files for each gage, converts between INTENSITY/VOLUME/CUMULATIVE rain types, separates rainfall from snowfall based on temperature, and tracks past n-hour rainfall totals.

Note
Legacy reference: src/legacy/engine/gage.c
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0