OpenSWMM Engine  6.0.0-alpha.1
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.1)
Loading...
Searching...
No Matches
openswmm_climate.h
Go to the documentation of this file.
1
40
41#ifndef OPENSWMM_CLIMATE_H
42#define OPENSWMM_CLIMATE_H
43
44#include "openswmm_engine.h"
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
51#define SWMM_CLIMATE_MONTHS 12
52
54#define SWMM_CLIMATE_ADC_POINTS 10
55
64
75
83
84/* =========================================================================
85 * Temperature ([TEMPERATURE])
86 * ========================================================================= */
87
93
95SWMM_ENGINE_API int swmm_climate_get_temp_timeseries(SWMM_Engine engine, char* buf, int buflen);
98
103
110
115
117SWMM_ENGINE_API int swmm_climate_get_latitude(SWMM_Engine engine, double* latitude);
120SWMM_ENGINE_API int swmm_climate_set_latitude(SWMM_Engine engine, double latitude);
121
127
128/* =========================================================================
129 * Evaporation ([EVAPORATION])
130 * ========================================================================= */
131
137
140SWMM_ENGINE_API int swmm_climate_get_evap_monthly(SWMM_Engine engine, double* buf, int count);
143SWMM_ENGINE_API int swmm_climate_set_evap_monthly(SWMM_Engine engine, const double* values, int count);
144
146SWMM_ENGINE_API int swmm_climate_get_evap_timeseries(SWMM_Engine engine, char* buf, int buflen);
149
152SWMM_ENGINE_API int swmm_climate_get_pan_coeff(SWMM_Engine engine, double* buf, int count);
154SWMM_ENGINE_API int swmm_climate_set_pan_coeff(SWMM_Engine engine, const double* values, int count);
155
157SWMM_ENGINE_API int swmm_climate_get_evap_recovery(SWMM_Engine engine, char* buf, int buflen);
159SWMM_ENGINE_API int swmm_climate_set_evap_recovery(SWMM_Engine engine, const char* pattern_id);
160
161/* =========================================================================
162 * Wind speed ([TEMPERATURE] WINDSPEED)
163 * ========================================================================= */
164
170
173SWMM_ENGINE_API int swmm_climate_get_wind_monthly(SWMM_Engine engine, double* buf, int count);
175SWMM_ENGINE_API int swmm_climate_set_wind_monthly(SWMM_Engine engine, const double* values, int count);
176
177/* =========================================================================
178 * Snowmelt globals ([TEMPERATURE] SNOWMELT)
179 * ========================================================================= */
180
182SWMM_ENGINE_API int swmm_climate_get_snow_temp(SWMM_Engine engine, double* divide_temp);
184SWMM_ENGINE_API int swmm_climate_set_snow_temp(SWMM_Engine engine, double divide_temp);
185
191
197
198/* =========================================================================
199 * Areal-depletion curves ([TEMPERATURE] ADC)
200 * ========================================================================= */
201
204SWMM_ENGINE_API int swmm_climate_get_adc_impervious(SWMM_Engine engine, double* buf, int count);
207SWMM_ENGINE_API int swmm_climate_set_adc_impervious(SWMM_Engine engine, const double* values, int count);
208
211SWMM_ENGINE_API int swmm_climate_get_adc_pervious(SWMM_Engine engine, double* buf, int count);
214SWMM_ENGINE_API int swmm_climate_set_adc_pervious(SWMM_Engine engine, const double* values, int count);
215
216/* =========================================================================
217 * Monthly adjustments ([ADJUSTMENTS])
218 * ========================================================================= */
219
222SWMM_ENGINE_API int swmm_climate_get_adjust_temperature(SWMM_Engine engine, double* buf, int count);
224SWMM_ENGINE_API int swmm_climate_set_adjust_temperature(SWMM_Engine engine, const double* values, int count);
225
228SWMM_ENGINE_API int swmm_climate_get_adjust_evaporation(SWMM_Engine engine, double* buf, int count);
230SWMM_ENGINE_API int swmm_climate_set_adjust_evaporation(SWMM_Engine engine, const double* values, int count);
231
234SWMM_ENGINE_API int swmm_climate_get_adjust_rainfall(SWMM_Engine engine, double* buf, int count);
236SWMM_ENGINE_API int swmm_climate_set_adjust_rainfall(SWMM_Engine engine, const double* values, int count);
237
240SWMM_ENGINE_API int swmm_climate_get_adjust_conductivity(SWMM_Engine engine, double* buf, int count);
243SWMM_ENGINE_API int swmm_climate_set_adjust_conductivity(SWMM_Engine engine, const double* values, int count);
244
245#ifdef __cplusplus
246} /* extern "C" */
247#endif
248
249#endif /* OPENSWMM_CLIMATE_H */
#define SWMM_ENGINE_API
Definition openswmm_2d.h:37
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:35
SWMM_ENGINE_API int swmm_climate_set_adc_pervious(SWMM_Engine engine, const double *values, int count)
Set the pervious areal-depletion curve; each fraction in [0, 1]; count must equal SWMM_CLIMATE_ADC_PO...
Definition openswmm_climate_impl.cpp:370
SWMM_ENGINE_API int swmm_climate_get_temp_timeseries(SWMM_Engine engine, char *buf, int buflen)
Get the temperature time-series id (empty if none).
Definition openswmm_climate_impl.cpp:82
SWMM_ENGINE_API int swmm_climate_set_adjust_evaporation(SWMM_Engine engine, const double *values, int count)
Set the 12 monthly evaporation adjustment multipliers; count must equal SWMM_CLIMATE_MONTHS.
Definition openswmm_climate_impl.cpp:403
SWMM_ENGINE_API int swmm_climate_set_elevation(SWMM_Engine engine, double elev)
Set the site elevation (project length units).
Definition openswmm_climate_impl.cpp:138
SWMM_ENGINE_API int swmm_climate_set_temp_units(SWMM_Engine engine, int units)
Set the climate-file temperature units (-1, 0, 1, or 2).
Definition openswmm_climate_impl.cpp:122
SWMM_ENGINE_API int swmm_climate_get_pan_coeff(SWMM_Engine engine, double *buf, int count)
Get the 12 monthly pan coefficients (used with the FILE method).
Definition openswmm_climate_impl.cpp:229
SWMM_ENGINE_API int swmm_climate_get_temp_file_start(SWMM_Engine engine, double *date)
Get the climate-file start date (DateTime decimal days; 0 = file start).
Definition openswmm_climate_impl.cpp:100
SWMM_ENGINE_API int swmm_climate_get_wind_type(SWMM_Engine engine, int *type)
Get the wind-speed data source (see SWMM_WindType).
Definition openswmm_climate_impl.cpp:264
SWMM_ENGINE_API int swmm_climate_get_wind_monthly(SWMM_Engine engine, double *buf, int count)
Get the 12 monthly average wind speeds (project wind-speed units).
Definition openswmm_climate_impl.cpp:280
SWMM_ENGINE_API int swmm_climate_get_adc_pervious(SWMM_Engine engine, double *buf, int count)
Get the pervious areal-depletion curve (10 fractions, 0..1).
Definition openswmm_climate_impl.cpp:364
SWMM_ENGINE_API int swmm_climate_set_latitude(SWMM_Engine engine, double latitude)
Set the site latitude (degrees, -90..90).
Definition openswmm_climate_impl.cpp:153
SWMM_ENGINE_API int swmm_climate_set_neg_melt_ratio(SWMM_Engine engine, double rnm)
Set the negative-melt-coefficient ratio (RNM).
Definition openswmm_climate_impl.cpp:336
SWMM_ENGINE_API int swmm_climate_set_wind_type(SWMM_Engine engine, int type)
Set the wind-speed data source (0..1, see SWMM_WindType).
Definition openswmm_climate_impl.cpp:271
SWMM_ENGINE_API int swmm_climate_get_elevation(SWMM_Engine engine, double *elev)
Get the site elevation (project length units; for psychrometric constant).
Definition openswmm_climate_impl.cpp:131
SWMM_ENGINE_API int swmm_climate_get_temp_units(SWMM_Engine engine, int *units)
Get the climate-file temperature units: 0=tenths-degC (C10), 1=degC (C), 2=degF (F); -1 = unspecified...
Definition openswmm_climate_impl.cpp:115
SWMM_ENGINE_API int swmm_climate_get_adc_impervious(SWMM_Engine engine, double *buf, int count)
Get the impervious areal-depletion curve (10 fractions, 0..1).
Definition openswmm_climate_impl.cpp:349
SWMM_ENGINE_API int swmm_climate_set_pan_coeff(SWMM_Engine engine, const double *values, int count)
Set the 12 monthly pan coefficients; count must equal SWMM_CLIMATE_MONTHS.
Definition openswmm_climate_impl.cpp:235
SWMM_ENGINE_API int swmm_climate_get_snow_temp(SWMM_Engine engine, double *divide_temp)
Get the snow/rain dividing temperature (project temperature units).
Definition openswmm_climate_impl.cpp:298
SWMM_ENGINE_API int swmm_climate_set_adjust_rainfall(SWMM_Engine engine, const double *values, int count)
Set the 12 monthly rainfall adjustment multipliers; count must equal SWMM_CLIMATE_MONTHS.
Definition openswmm_climate_impl.cpp:417
SWMM_ENGINE_API int swmm_climate_set_adjust_conductivity(SWMM_Engine engine, const double *values, int count)
Set the 12 monthly hydraulic-conductivity adjustment multipliers; values <= 0 are stored as 1....
Definition openswmm_climate_impl.cpp:431
SWMM_ENGINE_API int swmm_climate_get_adjust_evaporation(SWMM_Engine engine, double *buf, int count)
Get the 12 monthly evaporation adjustment multipliers (1.0 = none).
Definition openswmm_climate_impl.cpp:397
SWMM_TempSource
Air-temperature data source (matches [TEMPERATURE]).
Definition openswmm_climate.h:59
@ SWMM_TEMP_FILE
Definition openswmm_climate.h:62
@ SWMM_TEMP_TIMESERIES
Definition openswmm_climate.h:61
@ SWMM_TEMP_NONE
Definition openswmm_climate.h:60
SWMM_ENGINE_API int swmm_climate_get_evap_type(SWMM_Engine engine, int *type)
Get the evaporation method (see SWMM_EvapType).
Definition openswmm_climate_impl.cpp:181
SWMM_WindType
Wind-speed data source (matches [TEMPERATURE] WINDSPEED).
Definition openswmm_climate.h:79
@ SWMM_WIND_FILE
Definition openswmm_climate.h:81
@ SWMM_WIND_MONTHLY
Definition openswmm_climate.h:80
SWMM_ENGINE_API int swmm_climate_set_adjust_temperature(SWMM_Engine engine, const double *values, int count)
Set the 12 monthly temperature adjustments; count must equal SWMM_CLIMATE_MONTHS.
Definition openswmm_climate_impl.cpp:389
SWMM_ENGINE_API int swmm_climate_get_evap_recovery(SWMM_Engine engine, char *buf, int buflen)
Get the soil-moisture recovery pattern id (empty if none).
Definition openswmm_climate_impl.cpp:243
SWMM_ENGINE_API int swmm_climate_set_ati_weight(SWMM_Engine engine, double tipm)
Set the antecedent-temperature-index weight (TIPM).
Definition openswmm_climate_impl.cpp:320
SWMM_ENGINE_API int swmm_climate_set_longitude_correction(SWMM_Engine engine, double minutes)
Set the longitude/solar-time correction (minutes).
Definition openswmm_climate_impl.cpp:169
SWMM_ENGINE_API int swmm_climate_set_evap_monthly(SWMM_Engine engine, const double *values, int count)
Set the 12 monthly evaporation rates. A CONSTANT method stores the first value across all months; cou...
Definition openswmm_climate_impl.cpp:203
SWMM_EvapType
Evaporation method (matches [EVAPORATION]).
Definition openswmm_climate.h:68
@ SWMM_EVAP_TIMESERIES
Definition openswmm_climate.h:71
@ SWMM_EVAP_MONTHLY
Definition openswmm_climate.h:70
@ SWMM_EVAP_CONSTANT
Definition openswmm_climate.h:69
@ SWMM_EVAP_FILE
Definition openswmm_climate.h:73
@ SWMM_EVAP_TEMPERATURE
Definition openswmm_climate.h:72
SWMM_ENGINE_API int swmm_climate_set_temp_source(SWMM_Engine engine, int source)
Set the air-temperature data source (0..2, see SWMM_TempSource).
Definition openswmm_climate_impl.cpp:73
SWMM_ENGINE_API int swmm_climate_set_evap_type(SWMM_Engine engine, int type)
Set the evaporation method (0..4, see SWMM_EvapType).
Definition openswmm_climate_impl.cpp:188
SWMM_ENGINE_API int swmm_climate_set_snow_temp(SWMM_Engine engine, double divide_temp)
Set the snow/rain dividing temperature (project temperature units).
Definition openswmm_climate_impl.cpp:305
SWMM_ENGINE_API int swmm_climate_get_evap_timeseries(SWMM_Engine engine, char *buf, int buflen)
Get the evaporation time-series id (empty if none).
Definition openswmm_climate_impl.cpp:211
SWMM_ENGINE_API int swmm_climate_set_evap_timeseries(SWMM_Engine engine, const char *ts_id)
Assign the evaporation time-series id and set the method to TIMESERIES.
Definition openswmm_climate_impl.cpp:219
SWMM_ENGINE_API int swmm_climate_get_neg_melt_ratio(SWMM_Engine engine, double *rnm)
Get the negative-melt-coefficient ratio (RNM, 0..1).
Definition openswmm_climate_impl.cpp:329
SWMM_ENGINE_API int swmm_climate_get_ati_weight(SWMM_Engine engine, double *tipm)
Get the antecedent-temperature-index weight (TIPM, 0..1).
Definition openswmm_climate_impl.cpp:313
SWMM_ENGINE_API int swmm_climate_get_adjust_conductivity(SWMM_Engine engine, double *buf, int count)
Get the 12 monthly hydraulic-conductivity adjustment multipliers (1.0 = none).
Definition openswmm_climate_impl.cpp:425
SWMM_ENGINE_API int swmm_climate_set_evap_recovery(SWMM_Engine engine, const char *pattern_id)
Set the soil-moisture recovery pattern id (empty string clears it).
Definition openswmm_climate_impl.cpp:251
SWMM_ENGINE_API int swmm_climate_get_adjust_rainfall(SWMM_Engine engine, double *buf, int count)
Get the 12 monthly rainfall adjustment multipliers (1.0 = none).
Definition openswmm_climate_impl.cpp:411
SWMM_ENGINE_API int swmm_climate_set_temp_file_start(SWMM_Engine engine, double date)
Set the climate-file start date (DateTime decimal days; 0 = file start).
Definition openswmm_climate_impl.cpp:107
SWMM_ENGINE_API int swmm_climate_get_latitude(SWMM_Engine engine, double *latitude)
Get the site latitude (degrees, for Hargreaves ET / snowmelt).
Definition openswmm_climate_impl.cpp:146
SWMM_ENGINE_API int swmm_climate_get_longitude_correction(SWMM_Engine engine, double *minutes)
Get the longitude/solar-time correction (minutes; matches the legacy [TEMPERATURE] SNOWMELT field; 0 ...
Definition openswmm_climate_impl.cpp:162
SWMM_ENGINE_API int swmm_climate_get_temp_source(SWMM_Engine engine, int *source)
Get the air-temperature data source (see SWMM_TempSource).
Definition openswmm_climate_impl.cpp:66
SWMM_ENGINE_API int swmm_climate_set_temp_timeseries(SWMM_Engine engine, const char *ts_id)
Assign the temperature time-series id and set the source to TIMESERIES.
Definition openswmm_climate_impl.cpp:90
SWMM_ENGINE_API int swmm_climate_get_evap_monthly(SWMM_Engine engine, double *buf, int count)
Get the 12 monthly evaporation rates (project evap-rate units).
Definition openswmm_climate_impl.cpp:197
SWMM_ENGINE_API int swmm_climate_set_wind_monthly(SWMM_Engine engine, const double *values, int count)
Set the 12 monthly average wind speeds; count must equal SWMM_CLIMATE_MONTHS.
Definition openswmm_climate_impl.cpp:286
SWMM_ENGINE_API int swmm_climate_get_adjust_temperature(SWMM_Engine engine, double *buf, int count)
Get the 12 monthly temperature adjustments (offsets, project temp units).
Definition openswmm_climate_impl.cpp:383
SWMM_ENGINE_API int swmm_climate_set_adc_impervious(SWMM_Engine engine, const double *values, int count)
Set the impervious areal-depletion curve; each fraction in [0, 1]; count must equal SWMM_CLIMATE_ADC_...
Definition openswmm_climate_impl.cpp:355
OpenSWMM Engine — primary transparent C API (master header).