![]() |
OpenSWMM Engine
6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
|
Classes | |
| class | ClimateFileReader |
| struct | ClimateState |
| struct | DailyClimateRecord |
| struct | MovingAvg7 |
Enumerations | |
| enum class | EvapMethod : int { CONSTANT = 0 , MONTHLY = 1 , TIMESERIES = 2 , TEMPERATURE = 3 , PAN = 4 } |
| enum class | ClimateFileFormat { UNKNOWN , USER_PREPARED , GHCND , TD3200 , DLY0204 } |
| enum | ClimateVar { TMIN = 0 , TMAX = 1 , EVAP = 2 , WIND = 3 } |
| Climate variable indices (matching legacy ClimateVarType) More... | |
| enum | WindFieldType { WDMV = 0 , AWND = 1 } |
| Wind field type in GHCND. More... | |
| enum | TempUnits { DEG_C10 = 0 , DEG_C = 1 , DEG_F = 2 } |
| Temperature unit encoding in GHCND. More... | |
Functions | |
| double | hargreaves (double latitude, int day_of_year, double t_avg, double t_range) |
| Compute Hargreaves evapotranspiration. | |
| void | updateDailyClimate (ClimateState &state, int day_of_year, int month) |
| Update daily climate state. | |
| void | batchDistributeEvap (double evap_rate, const double *ponded_depth, double *evap_out, int n, double dt) |
| Batch distribute evaporation to all subcatchments. | |
| void | updateTempTimes (ClimateState &state, int doy) |
| Update sunrise/sunset parameters for sub-daily temperature interpolation. | |
| double | getSubdailyTemp (const ClimateState &state, double hour) |
| Compute sub-daily temperature using a three-zone sinusoidal model. | |
Variables | |
| constexpr double | MM_PER_INCH = 25.40 |
|
strong |
|
strong |
| void openswmm::climate::batchDistributeEvap | ( | double | evap_rate, |
| const double * | ponded_depth, | ||
| double * | evap_out, | ||
| int | n, | ||
| double | dt | ||
| ) |
Batch distribute evaporation to all subcatchments.
evap_out[i] = min(evap_rate, ponded_depth[i] / dt) This is a vectorisable clamp operation.
| evap_rate | Scalar evap rate (ft/sec). |
| ponded_depth | [in] Per-subcatchment ponded depth (ft). |
| evap_out | [out] Per-subcatchment actual evap rate (ft/sec). |
| n | Number of subcatchments. |
| dt | Timestep (seconds). |
| double openswmm::climate::getSubdailyTemp | ( | const ClimateState & | state, |
| double | hour | ||
| ) |
Compute sub-daily temperature using a three-zone sinusoidal model.
Matches legacy setTemp() in climate.c. Zones: (1) before sunrise — sinusoid from prev_tmax toward tmin; (2) sunrise to sunset-3 — sinusoid peaking at tmax; (3) after sunset-3 — sinusoid decaying from tmax. Requires updateTempTimes() to have been called for the current day.
| state | Climate state (uses tmin_daily, tmax_daily, prev_tmax, hrsr, hrss, hrday, dhrdy, dydif). |
| hour | Hour of day (0.0–24.0). |
| double openswmm::climate::hargreaves | ( | double | latitude, |
| int | day_of_year, | ||
| double | t_avg, | ||
| double | t_range | ||
| ) |
Compute Hargreaves evapotranspiration.
| latitude | Latitude (degrees). |
| day_of_year | Day of year (1-365). |
| t_avg | Average temperature (deg F). |
| t_range | Temperature range (deg F). |
| void openswmm::climate::updateDailyClimate | ( | ClimateState & | state, |
| int | day_of_year, | ||
| int | month | ||
| ) |
Update daily climate state.
| state | [in/out] Climate state. |
| day_of_year | Day of year. |
| month | Month (0-11). |
| void openswmm::climate::updateTempTimes | ( | ClimateState & | state, |
| int | doy | ||
| ) |
Update sunrise/sunset parameters for sub-daily temperature interpolation.
Matches legacy updateTempTimes() in climate.c. Computes hrsr, hrss, hrday, dhrdy, dydif from latitude and day-of-year. Must be called once per day before calling getSubdailyTemp().
| state | [in/out] Climate state (uses latitude, dtlong; writes hrsr etc.) |
| doy | Day of year (1-365). |
|
constexpr |