epyt-flow 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. epyt_flow/EPANET/EPANET/SRC_engines/AUTHORS +28 -0
  2. epyt_flow/EPANET/EPANET/SRC_engines/LICENSE +21 -0
  3. epyt_flow/EPANET/EPANET/SRC_engines/Readme_SRC_Engines.txt +18 -0
  4. epyt_flow/EPANET/EPANET/SRC_engines/enumstxt.h +134 -0
  5. epyt_flow/EPANET/EPANET/SRC_engines/epanet.c +5578 -0
  6. epyt_flow/EPANET/EPANET/SRC_engines/epanet2.c +865 -0
  7. epyt_flow/EPANET/EPANET/SRC_engines/epanet2.def +131 -0
  8. epyt_flow/EPANET/EPANET/SRC_engines/errors.dat +73 -0
  9. epyt_flow/EPANET/EPANET/SRC_engines/funcs.h +193 -0
  10. epyt_flow/EPANET/EPANET/SRC_engines/genmmd.c +1000 -0
  11. epyt_flow/EPANET/EPANET/SRC_engines/hash.c +177 -0
  12. epyt_flow/EPANET/EPANET/SRC_engines/hash.h +28 -0
  13. epyt_flow/EPANET/EPANET/SRC_engines/hydcoeffs.c +1151 -0
  14. epyt_flow/EPANET/EPANET/SRC_engines/hydraul.c +1117 -0
  15. epyt_flow/EPANET/EPANET/SRC_engines/hydsolver.c +720 -0
  16. epyt_flow/EPANET/EPANET/SRC_engines/hydstatus.c +476 -0
  17. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2.h +431 -0
  18. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_2.h +1786 -0
  19. epyt_flow/EPANET/EPANET/SRC_engines/include/epanet2_enums.h +468 -0
  20. epyt_flow/EPANET/EPANET/SRC_engines/inpfile.c +810 -0
  21. epyt_flow/EPANET/EPANET/SRC_engines/input1.c +707 -0
  22. epyt_flow/EPANET/EPANET/SRC_engines/input2.c +864 -0
  23. epyt_flow/EPANET/EPANET/SRC_engines/input3.c +2170 -0
  24. epyt_flow/EPANET/EPANET/SRC_engines/main.c +93 -0
  25. epyt_flow/EPANET/EPANET/SRC_engines/mempool.c +142 -0
  26. epyt_flow/EPANET/EPANET/SRC_engines/mempool.h +24 -0
  27. epyt_flow/EPANET/EPANET/SRC_engines/output.c +852 -0
  28. epyt_flow/EPANET/EPANET/SRC_engines/project.c +1359 -0
  29. epyt_flow/EPANET/EPANET/SRC_engines/quality.c +685 -0
  30. epyt_flow/EPANET/EPANET/SRC_engines/qualreact.c +743 -0
  31. epyt_flow/EPANET/EPANET/SRC_engines/qualroute.c +694 -0
  32. epyt_flow/EPANET/EPANET/SRC_engines/report.c +1489 -0
  33. epyt_flow/EPANET/EPANET/SRC_engines/rules.c +1362 -0
  34. epyt_flow/EPANET/EPANET/SRC_engines/smatrix.c +871 -0
  35. epyt_flow/EPANET/EPANET/SRC_engines/text.h +497 -0
  36. epyt_flow/EPANET/EPANET/SRC_engines/types.h +874 -0
  37. epyt_flow/EPANET/EPANET-MSX/MSX_Updates.txt +53 -0
  38. epyt_flow/EPANET/EPANET-MSX/Src/dispersion.h +27 -0
  39. epyt_flow/EPANET/EPANET-MSX/Src/hash.c +107 -0
  40. epyt_flow/EPANET/EPANET-MSX/Src/hash.h +28 -0
  41. epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx.h +102 -0
  42. epyt_flow/EPANET/EPANET-MSX/Src/include/epanetmsx_export.h +42 -0
  43. epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.c +937 -0
  44. epyt_flow/EPANET/EPANET-MSX/Src/mathexpr.h +39 -0
  45. epyt_flow/EPANET/EPANET-MSX/Src/mempool.c +204 -0
  46. epyt_flow/EPANET/EPANET-MSX/Src/mempool.h +24 -0
  47. epyt_flow/EPANET/EPANET-MSX/Src/msxchem.c +1285 -0
  48. epyt_flow/EPANET/EPANET-MSX/Src/msxcompiler.c +368 -0
  49. epyt_flow/EPANET/EPANET-MSX/Src/msxdict.h +42 -0
  50. epyt_flow/EPANET/EPANET-MSX/Src/msxdispersion.c +586 -0
  51. epyt_flow/EPANET/EPANET-MSX/Src/msxerr.c +116 -0
  52. epyt_flow/EPANET/EPANET-MSX/Src/msxfile.c +260 -0
  53. epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.c +175 -0
  54. epyt_flow/EPANET/EPANET-MSX/Src/msxfuncs.h +35 -0
  55. epyt_flow/EPANET/EPANET-MSX/Src/msxinp.c +1504 -0
  56. epyt_flow/EPANET/EPANET-MSX/Src/msxout.c +401 -0
  57. epyt_flow/EPANET/EPANET-MSX/Src/msxproj.c +791 -0
  58. epyt_flow/EPANET/EPANET-MSX/Src/msxqual.c +2010 -0
  59. epyt_flow/EPANET/EPANET-MSX/Src/msxrpt.c +400 -0
  60. epyt_flow/EPANET/EPANET-MSX/Src/msxtank.c +422 -0
  61. epyt_flow/EPANET/EPANET-MSX/Src/msxtoolkit.c +1164 -0
  62. epyt_flow/EPANET/EPANET-MSX/Src/msxtypes.h +551 -0
  63. epyt_flow/EPANET/EPANET-MSX/Src/msxutils.c +524 -0
  64. epyt_flow/EPANET/EPANET-MSX/Src/msxutils.h +56 -0
  65. epyt_flow/EPANET/EPANET-MSX/Src/newton.c +158 -0
  66. epyt_flow/EPANET/EPANET-MSX/Src/newton.h +34 -0
  67. epyt_flow/EPANET/EPANET-MSX/Src/rk5.c +287 -0
  68. epyt_flow/EPANET/EPANET-MSX/Src/rk5.h +39 -0
  69. epyt_flow/EPANET/EPANET-MSX/Src/ros2.c +293 -0
  70. epyt_flow/EPANET/EPANET-MSX/Src/ros2.h +35 -0
  71. epyt_flow/EPANET/EPANET-MSX/Src/smatrix.c +816 -0
  72. epyt_flow/EPANET/EPANET-MSX/Src/smatrix.h +29 -0
  73. epyt_flow/EPANET/EPANET-MSX/readme.txt +14 -0
  74. epyt_flow/EPANET/compile.sh +4 -0
  75. epyt_flow/VERSION +1 -0
  76. epyt_flow/__init__.py +24 -0
  77. epyt_flow/data/__init__.py +0 -0
  78. epyt_flow/data/benchmarks/__init__.py +11 -0
  79. epyt_flow/data/benchmarks/batadal.py +257 -0
  80. epyt_flow/data/benchmarks/batadal_data.py +28 -0
  81. epyt_flow/data/benchmarks/battledim.py +473 -0
  82. epyt_flow/data/benchmarks/battledim_data.py +51 -0
  83. epyt_flow/data/benchmarks/gecco_water_quality.py +267 -0
  84. epyt_flow/data/benchmarks/leakdb.py +592 -0
  85. epyt_flow/data/benchmarks/leakdb_data.py +18923 -0
  86. epyt_flow/data/benchmarks/water_usage.py +123 -0
  87. epyt_flow/data/networks.py +650 -0
  88. epyt_flow/gym/__init__.py +4 -0
  89. epyt_flow/gym/control_gyms.py +47 -0
  90. epyt_flow/gym/scenario_control_env.py +101 -0
  91. epyt_flow/metrics.py +404 -0
  92. epyt_flow/models/__init__.py +2 -0
  93. epyt_flow/models/event_detector.py +31 -0
  94. epyt_flow/models/sensor_interpolation_detector.py +118 -0
  95. epyt_flow/rest_api/__init__.py +4 -0
  96. epyt_flow/rest_api/base_handler.py +70 -0
  97. epyt_flow/rest_api/res_manager.py +95 -0
  98. epyt_flow/rest_api/scada_data_handler.py +476 -0
  99. epyt_flow/rest_api/scenario_handler.py +352 -0
  100. epyt_flow/rest_api/server.py +106 -0
  101. epyt_flow/serialization.py +438 -0
  102. epyt_flow/simulation/__init__.py +5 -0
  103. epyt_flow/simulation/events/__init__.py +6 -0
  104. epyt_flow/simulation/events/actuator_events.py +259 -0
  105. epyt_flow/simulation/events/event.py +81 -0
  106. epyt_flow/simulation/events/leakages.py +404 -0
  107. epyt_flow/simulation/events/sensor_faults.py +267 -0
  108. epyt_flow/simulation/events/sensor_reading_attack.py +185 -0
  109. epyt_flow/simulation/events/sensor_reading_event.py +170 -0
  110. epyt_flow/simulation/events/system_event.py +88 -0
  111. epyt_flow/simulation/parallel_simulation.py +147 -0
  112. epyt_flow/simulation/scada/__init__.py +3 -0
  113. epyt_flow/simulation/scada/advanced_control.py +134 -0
  114. epyt_flow/simulation/scada/scada_data.py +1589 -0
  115. epyt_flow/simulation/scada/scada_data_export.py +255 -0
  116. epyt_flow/simulation/scenario_config.py +608 -0
  117. epyt_flow/simulation/scenario_simulator.py +1897 -0
  118. epyt_flow/simulation/scenario_visualizer.py +61 -0
  119. epyt_flow/simulation/sensor_config.py +1289 -0
  120. epyt_flow/topology.py +290 -0
  121. epyt_flow/uncertainty/__init__.py +3 -0
  122. epyt_flow/uncertainty/model_uncertainty.py +302 -0
  123. epyt_flow/uncertainty/sensor_noise.py +73 -0
  124. epyt_flow/uncertainty/uncertainties.py +555 -0
  125. epyt_flow/uncertainty/utils.py +206 -0
  126. epyt_flow/utils.py +306 -0
  127. epyt_flow-0.1.0.dist-info/LICENSE +21 -0
  128. epyt_flow-0.1.0.dist-info/METADATA +139 -0
  129. epyt_flow-0.1.0.dist-info/RECORD +131 -0
  130. epyt_flow-0.1.0.dist-info/WHEEL +5 -0
  131. epyt_flow-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,468 @@
1
+ /** @file epanet2_enums.h
2
+ */
3
+ /*
4
+ ******************************************************************************
5
+ Project: OWA EPANET
6
+ Version: 2.2
7
+ Module: epanet2_enums.h
8
+ Description: enumerations of symbolic constants used by the API functions
9
+ Authors: see AUTHORS
10
+ Copyright: see AUTHORS
11
+ License: see LICENSE
12
+ Last Updated: 11/06/2019
13
+ ******************************************************************************
14
+ */
15
+
16
+
17
+ #ifndef EPANET2_ENUMS_H
18
+ #define EPANET2_ENUMS_H
19
+
20
+
21
+ // --- Define the EPANET toolkit constants
22
+
23
+ /// Size Limts
24
+ /**
25
+ Limits on the size of character arrays used to store ID names
26
+ and text messages.
27
+ */
28
+ typedef enum {
29
+ EN_MAXID = 31, //!< Max. # characters in ID name
30
+ EN_MAXMSG = 255 //!< Max. # characters in message text
31
+ } EN_SizeLimits;
32
+
33
+ /// Node properties
34
+ /**
35
+ These node properties are used with @ref EN_getnodevalue and @ref EN_setnodevalue.
36
+ Those marked as read only are computed values that can only be retrieved.
37
+ */
38
+ typedef enum {
39
+ EN_ELEVATION = 0, //!< Elevation
40
+ EN_BASEDEMAND = 1, //!< Primary demand baseline value
41
+ EN_PATTERN = 2, //!< Primary demand time pattern index
42
+ EN_EMITTER = 3, //!< Emitter flow coefficient
43
+ EN_INITQUAL = 4, //!< Initial quality
44
+ EN_SOURCEQUAL = 5, //!< Quality source strength
45
+ EN_SOURCEPAT = 6, //!< Quality source pattern index
46
+ EN_SOURCETYPE = 7, //!< Quality source type (see @ref EN_SourceType)
47
+ EN_TANKLEVEL = 8, //!< Current computed tank water level (read only)
48
+ EN_DEMAND = 9, //!< Current computed demand (read only)
49
+ EN_HEAD = 10, //!< Current computed hydraulic head (read only)
50
+ EN_PRESSURE = 11, //!< Current computed pressure (read only)
51
+ EN_QUALITY = 12, //!< Current computed quality (read only)
52
+ EN_SOURCEMASS = 13, //!< Current computed quality source mass inflow (read only)
53
+ EN_INITVOLUME = 14, //!< Tank initial volume (read only)
54
+ EN_MIXMODEL = 15, //!< Tank mixing model (see @ref EN_MixingModel)
55
+ EN_MIXZONEVOL = 16, //!< Tank mixing zone volume (read only)
56
+ EN_TANKDIAM = 17, //!< Tank diameter
57
+ EN_MINVOLUME = 18, //!< Tank minimum volume
58
+ EN_VOLCURVE = 19, //!< Tank volume curve index
59
+ EN_MINLEVEL = 20, //!< Tank minimum level
60
+ EN_MAXLEVEL = 21, //!< Tank maximum level
61
+ EN_MIXFRACTION = 22, //!< Tank mixing fraction
62
+ EN_TANK_KBULK = 23, //!< Tank bulk decay coefficient
63
+ EN_TANKVOLUME = 24, //!< Current computed tank volume (read only)
64
+ EN_MAXVOLUME = 25, //!< Tank maximum volume (read only)
65
+ EN_CANOVERFLOW = 26, //!< Tank can overflow (= 1) or not (= 0)
66
+ EN_DEMANDDEFICIT = 27 //!< Amount that full demand is reduced under PDA (read only)
67
+ } EN_NodeProperty;
68
+
69
+ /// Link properties
70
+ /**
71
+ These link properties are used with @ref EN_getlinkvalue and @ref EN_setlinkvalue.
72
+ Those marked as read only are computed values that can only be retrieved.
73
+ */
74
+ typedef enum {
75
+ EN_DIAMETER = 0, //!< Pipe/valve diameter
76
+ EN_LENGTH = 1, //!< Pipe length
77
+ EN_ROUGHNESS = 2, //!< Pipe roughness coefficient
78
+ EN_MINORLOSS = 3, //!< Pipe/valve minor loss coefficient
79
+ EN_INITSTATUS = 4, //!< Initial status (see @ref EN_LinkStatusType)
80
+ EN_INITSETTING = 5, //!< Initial pump speed or valve setting
81
+ EN_KBULK = 6, //!< Bulk chemical reaction coefficient
82
+ EN_KWALL = 7, //!< Pipe wall chemical reaction coefficient
83
+ EN_FLOW = 8, //!< Current computed flow rate (read only)
84
+ EN_VELOCITY = 9, //!< Current computed flow velocity (read only)
85
+ EN_HEADLOSS = 10, //!< Current computed head loss (read only)
86
+ EN_STATUS = 11, //!< Current link status (see @ref EN_LinkStatusType)
87
+ EN_SETTING = 12, //!< Current link setting
88
+ EN_ENERGY = 13, //!< Current computed pump energy usage (read only)
89
+ EN_LINKQUAL = 14, //!< Current computed link quality (read only)
90
+ EN_LINKPATTERN = 15, //!< Pump speed time pattern index
91
+ EN_PUMP_STATE = 16, //!< Current computed pump state (read only) (see @ref EN_PumpStateType)
92
+ EN_PUMP_EFFIC = 17, //!< Current computed pump efficiency (read only)
93
+ EN_PUMP_POWER = 18, //!< Pump constant power rating
94
+ EN_PUMP_HCURVE = 19, //!< Pump head v. flow curve index
95
+ EN_PUMP_ECURVE = 20, //!< Pump efficiency v. flow curve index
96
+ EN_PUMP_ECOST = 21, //!< Pump average energy price
97
+ EN_PUMP_EPAT = 22 //!< Pump energy price time pattern index
98
+ } EN_LinkProperty;
99
+
100
+ /// Time parameters
101
+ /**
102
+ These time-related options are used with @ref EN_gettimeparam and@ref EN_settimeparam.
103
+ All times are expressed in seconds The parameters marked as read only are
104
+ computed values that can only be retrieved.
105
+ */
106
+ typedef enum {
107
+ EN_DURATION = 0, //!< Total simulation duration
108
+ EN_HYDSTEP = 1, //!< Hydraulic time step
109
+ EN_QUALSTEP = 2, //!< Water quality time step
110
+ EN_PATTERNSTEP = 3, //!< Time pattern period
111
+ EN_PATTERNSTART = 4, //!< Time when time patterns begin
112
+ EN_REPORTSTEP = 5, //!< Reporting time step
113
+ EN_REPORTSTART = 6, //!< Time when reporting starts
114
+ EN_RULESTEP = 7, //!< Rule-based control evaluation time step
115
+ EN_STATISTIC = 8, //!< Reporting statistic code (see @ref EN_StatisticType)
116
+ EN_PERIODS = 9, //!< Number of reporting time periods (read only)
117
+ EN_STARTTIME = 10, //!< Simulation starting time of day
118
+ EN_HTIME = 11, //!< Elapsed time of current hydraulic solution (read only)
119
+ EN_QTIME = 12, //!< Elapsed time of current quality solution (read only)
120
+ EN_HALTFLAG = 13, //!< Flag indicating if the simulation was halted (read only)
121
+ EN_NEXTEVENT = 14, //!< Shortest time until a tank becomes empty or full (read only)
122
+ EN_NEXTEVENTTANK = 15 //!< Index of tank with shortest time to become empty or full (read only)
123
+ } EN_TimeParameter;
124
+
125
+ /// Analysis convergence statistics
126
+ /**
127
+ These statistics report the convergence criteria for the most current hydraulic analysis
128
+ and the cumulative water quality mass balance error at the current simulation time. They
129
+ can be retrieved with @ref EN_getstatistic.
130
+ */
131
+ typedef enum {
132
+ EN_ITERATIONS = 0, //!< Number of hydraulic iterations taken
133
+ EN_RELATIVEERROR = 1, //!< Sum of link flow changes / sum of link flows
134
+ EN_MAXHEADERROR = 2, //!< Largest head loss error for links
135
+ EN_MAXFLOWCHANGE = 3, //!< Largest flow change in links
136
+ EN_MASSBALANCE = 4, //!< Cumulative water quality mass balance ratio
137
+ EN_DEFICIENTNODES = 5, //!< Number of pressure deficient nodes
138
+ EN_DEMANDREDUCTION = 6 //!< % demand reduction at pressure deficient nodes
139
+ } EN_AnalysisStatistic;
140
+
141
+ /// Types of network objects
142
+ /**
143
+ The types of objects that comprise a network model.
144
+ */
145
+ typedef enum {
146
+ EN_NODE = 0, //!< Nodes
147
+ EN_LINK = 1, //!< Links
148
+ EN_TIMEPAT = 2, //!< Time patterns
149
+ EN_CURVE = 3, //!< Data curves
150
+ EN_CONTROL = 4, //!< Simple controls
151
+ EN_RULE = 5 //!< Control rules
152
+ } EN_ObjectType;
153
+
154
+ /// Types of objects to count
155
+ /**
156
+ These options tell @ref EN_getcount which type of object to count.
157
+ */
158
+ typedef enum {
159
+ EN_NODECOUNT = 0, //!< Number of nodes (junctions + tanks + reservoirs)
160
+ EN_TANKCOUNT = 1, //!< Number of tanks and reservoirs
161
+ EN_LINKCOUNT = 2, //!< Number of links (pipes + pumps + valves)
162
+ EN_PATCOUNT = 3, //!< Number of time patterns
163
+ EN_CURVECOUNT = 4, //!< Number of data curves
164
+ EN_CONTROLCOUNT = 5, //!< Number of simple controls
165
+ EN_RULECOUNT = 6 //!< Number of rule-based controls
166
+ } EN_CountType;
167
+
168
+ /// Node Types
169
+ /**
170
+ These are the different types of nodes that can be returned by calling @ref EN_getnodetype.
171
+ */
172
+ typedef enum {
173
+ EN_JUNCTION = 0, //!< Junction node
174
+ EN_RESERVOIR = 1, //!< Reservoir node
175
+ EN_TANK = 2 //!< Storage tank node
176
+ } EN_NodeType;
177
+
178
+ /// Link types
179
+ /**
180
+ These are the different types of links that can be returned by calling @ref EN_getlinktype.
181
+ */
182
+ typedef enum {
183
+ EN_CVPIPE = 0, //!< Pipe with check valve
184
+ EN_PIPE = 1, //!< Pipe
185
+ EN_PUMP = 2, //!< Pump
186
+ EN_PRV = 3, //!< Pressure reducing valve
187
+ EN_PSV = 4, //!< Pressure sustaining valve
188
+ EN_PBV = 5, //!< Pressure breaker valve
189
+ EN_FCV = 6, //!< Flow control valve
190
+ EN_TCV = 7, //!< Throttle control valve
191
+ EN_GPV = 8 //!< General purpose valve
192
+ } EN_LinkType;
193
+
194
+ /// Link status
195
+ /**
196
+ One of these values is returned when @ref EN_getlinkvalue is used to retrieve a link's
197
+ initial status ( \b EN_INITSTATUS ) or its current status ( \b EN_STATUS ). These options are
198
+ also used with @ref EN_setlinkvalue to set values for these same properties.
199
+ */
200
+ typedef enum {
201
+ EN_CLOSED = 0,
202
+ EN_OPEN = 1
203
+ } EN_LinkStatusType;
204
+
205
+ /// Pump states
206
+ /**
207
+ One of these codes is returned when @ref EN_getlinkvalue is used to retrieve a pump's
208
+ current operating state ( \b EN_PUMP_STATE ). \b EN_PUMP_XHEAD indicates that the pump has been
209
+ shut down because it is being asked to deliver more than its shutoff head. \b EN_PUMP_XFLOW
210
+ indicates that the pump is being asked to deliver more than its maximum flow.
211
+ */
212
+ typedef enum {
213
+ EN_PUMP_XHEAD = 0, //!< Pump closed - cannot supply head
214
+ EN_PUMP_CLOSED = 2, //!< Pump closed
215
+ EN_PUMP_OPEN = 3, //!< Pump open
216
+ EN_PUMP_XFLOW = 5 //!< Pump open - cannot supply flow
217
+ } EN_PumpStateType;
218
+
219
+ /// Types of water quality analyses
220
+ /**
221
+ These are the different types of water quality analyses that EPANET can run. They
222
+ are used with @ref EN_getqualinfo, @ref EN_getqualtype, and @ref EN_setqualtype.
223
+ */
224
+ typedef enum {
225
+ EN_NONE = 0, //!< No quality analysis
226
+ EN_CHEM = 1, //!< Chemical fate and transport
227
+ EN_AGE = 2, //!< Water age analysis
228
+ EN_TRACE = 3 //!< Source tracing analysis
229
+ } EN_QualityType;
230
+
231
+ /// Water quality source types
232
+ /**
233
+ These are the different types of external water quality sources that can be assigned
234
+ to a node's \b EN_SOURCETYPE property as used by @ref EN_getnodevalue and @ref EN_setnodevalue.
235
+ */
236
+ typedef enum {
237
+ EN_CONCEN = 0, //!< Sets the concentration of external inflow entering a node
238
+ EN_MASS = 1, //!< Injects a given mass/minute into a node
239
+ EN_SETPOINT = 2, //!< Sets the concentration leaving a node to a given value
240
+ EN_FLOWPACED = 3 //!< Adds a given value to the concentration leaving a node
241
+ } EN_SourceType;
242
+
243
+ /// Head loss formulas
244
+ /**
245
+ The available choices for the \b EN_HEADLOSSFORM option in @ref EN_getoption and
246
+ @ref EN_setoption. They are also used for the head loss type argument in @ref EN_init.
247
+ Each head loss formula uses a different type of roughness coefficient ( \b EN_ROUGHNESS )
248
+ that can be set with @ref EN_setlinkvalue.
249
+ */
250
+ typedef enum {
251
+ EN_HW = 0, //!< Hazen-Williams
252
+ EN_DW = 1, //!< Darcy-Weisbach
253
+ EN_CM = 2 //!< Chezy-Manning
254
+ } EN_HeadLossType;
255
+
256
+ /// Flow units
257
+ /**
258
+ These choices for flow units are used with @ref EN_getflowunits and @ref EN_setflowunits.
259
+ They are also used for the flow units type argument in @ref EN_init. If flow units are
260
+ expressed in US Customary units ( \b EN_CFS through \b EN_AFD ) then all other quantities are
261
+ in US Customary units. Otherwise they are in metric units.
262
+ */
263
+ typedef enum {
264
+ EN_CFS = 0, //!< Cubic feet per second
265
+ EN_GPM = 1, //!< Gallons per minute
266
+ EN_MGD = 2, //!< Million gallons per day
267
+ EN_IMGD = 3, //!< Imperial million gallons per day
268
+ EN_AFD = 4, //!< Acre-feet per day
269
+ EN_LPS = 5, //!< Liters per second
270
+ EN_LPM = 6, //!< Liters per minute
271
+ EN_MLD = 7, //!< Million liters per day
272
+ EN_CMH = 8, //!< Cubic meters per hour
273
+ EN_CMD = 9 //!< Cubic meters per day
274
+ } EN_FlowUnits;
275
+
276
+ /// Demand models
277
+ /**
278
+ These choices for modeling consumer demands are used with @ref EN_getdemandmodel
279
+ and @ref EN_setdemandmodel.
280
+
281
+ A demand driven analysis requires that a junction's full demand be supplied
282
+ in each time period independent of how much pressure is available. A pressure
283
+ driven analysis makes demand be a power function of pressure, up to the point
284
+ where the full demand is met.
285
+ */
286
+ typedef enum {
287
+ EN_DDA = 0, //!< Demand driven analysis
288
+ EN_PDA = 1 //!< Pressure driven analysis
289
+ } EN_DemandModel;
290
+
291
+ /// Simulation options
292
+ /**
293
+ These constants identify the hydraulic and water quality simulation options
294
+ that are applied on a network-wide basis. They are accessed using the
295
+ @ref EN_getoption and @ref EN_setoption functions.
296
+ */
297
+ typedef enum {
298
+ EN_TRIALS = 0, //!< Maximum trials allowed for hydraulic convergence
299
+ EN_ACCURACY = 1, //!< Total normalized flow change for hydraulic convergence
300
+ EN_TOLERANCE = 2, //!< Water quality tolerance
301
+ EN_EMITEXPON = 3, //!< Exponent in emitter discharge formula
302
+ EN_DEMANDMULT = 4, //!< Global demand multiplier
303
+ EN_HEADERROR = 5, //!< Maximum head loss error for hydraulic convergence
304
+ EN_FLOWCHANGE = 6, //!< Maximum flow change for hydraulic convergence
305
+ EN_HEADLOSSFORM = 7, //!< Head loss formula (see @ref EN_HeadLossType)
306
+ EN_GLOBALEFFIC = 8, //!< Global pump efficiency (percent)
307
+ EN_GLOBALPRICE = 9, //!< Global energy price per KWH
308
+ EN_GLOBALPATTERN = 10, //!< Index of a global energy price pattern
309
+ EN_DEMANDCHARGE = 11, //!< Energy charge per max. KW usage
310
+ EN_SP_GRAVITY = 12, //!< Specific gravity
311
+ EN_SP_VISCOS = 13, //!< Specific viscosity (relative to water at 20 deg C)
312
+ EN_UNBALANCED = 14, //!< Extra trials allowed if hydraulics don't converge
313
+ EN_CHECKFREQ = 15, //!< Frequency of hydraulic status checks
314
+ EN_MAXCHECK = 16, //!< Maximum trials for status checking
315
+ EN_DAMPLIMIT = 17, //!< Accuracy level where solution damping begins
316
+ EN_SP_DIFFUS = 18, //!< Specific diffusivity (relative to chlorine at 20 deg C)
317
+ EN_BULKORDER = 19, //!< Bulk water reaction order for pipes
318
+ EN_WALLORDER = 20, //!< Wall reaction order for pipes (either 0 or 1)
319
+ EN_TANKORDER = 21, //!< Bulk water reaction order for tanks
320
+ EN_CONCENLIMIT = 22 //!< Limiting concentration for growth reactions
321
+ } EN_Option;
322
+
323
+ /// Simple control types
324
+ /**
325
+ These are the different types of simple (single statement) controls that can be applied
326
+ to network links. They are used as an argument to @ref EN_addcontrol,@ref EN_getcontrol,
327
+ and @ref EN_setcontrol.
328
+ */
329
+ typedef enum {
330
+ EN_LOWLEVEL = 0, //!< Act when pressure or tank level drops below a setpoint
331
+ EN_HILEVEL = 1, //!< Act when pressure or tank level rises above a setpoint
332
+ EN_TIMER = 2, //!< Act at a prescribed elapsed amount of time
333
+ EN_TIMEOFDAY = 3 //!< Act at a particular time of day
334
+ } EN_ControlType;
335
+
336
+ /// Reporting statistic choices
337
+ /**
338
+ These options determine what kind of statistical post-processing should be done on
339
+ the time series of simulation results generated before they are reported using
340
+ @ref EN_report. An option can be chosen by using \b STATISTIC _option_ as the argument
341
+ to @ref EN_setreport.
342
+ */
343
+ typedef enum {
344
+ EN_SERIES = 0, //!< Report all time series points
345
+ EN_AVERAGE = 1, //!< Report average value over simulation period
346
+ EN_MINIMUM = 2, //!< Report minimum value over simulation period
347
+ EN_MAXIMUM = 3, //!< Report maximum value over simulation period
348
+ EN_RANGE = 4 //!< Report maximum - minimum over simulation period
349
+ } EN_StatisticType;
350
+
351
+ /// Tank mixing models
352
+ /**
353
+ These are the different types of models that describe water quality mixing in storage tanks.
354
+ The choice of model is accessed with the \b EN_MIXMODEL property of a Tank node using
355
+ @ref EN_getnodevalue and @ref EN_setnodevalue.
356
+ */
357
+ typedef enum {
358
+ EN_MIX1 = 0, //!< Complete mix model
359
+ EN_MIX2 = 1, //!< 2-compartment model
360
+ EN_FIFO = 2, //!< First in, first out model
361
+ EN_LIFO = 3 //!< Last in, first out model
362
+ } EN_MixingModel;
363
+
364
+ /// Hydraulic initialization options
365
+ /**
366
+ These options are used to initialize a new hydraulic analysis when @ref EN_initH is called.
367
+ */
368
+ typedef enum {
369
+ EN_NOSAVE = 0, //!< Don't save hydraulics; don't re-initialize flows
370
+ EN_SAVE = 1, //!< Save hydraulics to file, don't re-initialize flows
371
+ EN_INITFLOW = 10, //!< Don't save hydraulics; re-initialize flows
372
+ EN_SAVE_AND_INIT = 11 //!< Save hydraulics; re-initialize flows
373
+ } EN_InitHydOption;
374
+
375
+ /// Types of pump curves
376
+ /**
377
+ @ref EN_getpumptype returns one of these values when it is called.
378
+ */
379
+ typedef enum {
380
+ EN_CONST_HP = 0, //!< Constant horsepower
381
+ EN_POWER_FUNC = 1, //!< Power function
382
+ EN_CUSTOM = 2, //!< User-defined custom curve
383
+ EN_NOCURVE = 3 //!< No curve
384
+ } EN_PumpType;
385
+
386
+ /// Types of data curves
387
+ /**
388
+ These are the different types of physical relationships that a data curve can
389
+ represent as returned by calling @ref EN_getcurvetype.
390
+ */
391
+ typedef enum {
392
+ EN_VOLUME_CURVE = 0, //!< Tank volume v. depth curve
393
+ EN_PUMP_CURVE = 1, //!< Pump head v. flow curve
394
+ EN_EFFIC_CURVE = 2, //!< Pump efficiency v. flow curve
395
+ EN_HLOSS_CURVE = 3, //!< Valve head loss v. flow curve
396
+ EN_GENERIC_CURVE = 4 //!< Generic curve
397
+ } EN_CurveType;
398
+
399
+ /// Deletion action codes
400
+ /**
401
+ These codes are used in @ref EN_deletenode and @ref EN_deletelink to indicate what action
402
+ should be taken if the node or link being deleted appears in any simple or rule-based
403
+ controls or if a deleted node has any links connected to it.
404
+ */
405
+ typedef enum {
406
+ EN_UNCONDITIONAL = 0, //!< Delete all controls and connecing links
407
+ EN_CONDITIONAL = 1 //!< Cancel object deletion if it appears in controls or has connecting links
408
+ } EN_ActionCodeType;
409
+
410
+ /// Status reporting levels
411
+ /**
412
+ These choices specify the level of status reporting written to a project's report
413
+ file during a hydraulic analysis. The level is set using the @ref EN_setstatusreport function.
414
+ */
415
+ typedef enum {
416
+ EN_NO_REPORT = 0, //!< No status reporting
417
+ EN_NORMAL_REPORT = 1, //!< Normal level of status reporting
418
+ EN_FULL_REPORT = 2 //!< Full level of status reporting
419
+ } EN_StatusReport;
420
+
421
+ /// Network objects used in rule-based controls
422
+ typedef enum {
423
+ EN_R_NODE = 6, //!< Clause refers to a node
424
+ EN_R_LINK = 7, //!< Clause refers to a link
425
+ EN_R_SYSTEM = 8 //!< Clause refers to a system parameter (e.g., time)
426
+ } EN_RuleObject;
427
+
428
+ /// Object variables used in rule-based controls
429
+ typedef enum {
430
+ EN_R_DEMAND = 0, //!< Nodal demand
431
+ EN_R_HEAD = 1, //!< Nodal hydraulic head
432
+ EN_R_GRADE = 2, //!< Nodal hydraulic grade
433
+ EN_R_LEVEL = 3, //!< Tank water level
434
+ EN_R_PRESSURE = 4, //!< Nodal pressure
435
+ EN_R_FLOW = 5, //!< Link flow rate
436
+ EN_R_STATUS = 6, //!< Link status
437
+ EN_R_SETTING = 7, //!< Link setting
438
+ EN_R_POWER = 8, //!< Pump power output
439
+ EN_R_TIME = 9, //!< Elapsed simulation time
440
+ EN_R_CLOCKTIME = 10, //!< Time of day
441
+ EN_R_FILLTIME = 11, //!< Time to fill a tank
442
+ EN_R_DRAINTIME = 12 //!< Time to drain a tank
443
+ } EN_RuleVariable;
444
+
445
+ /// Comparison operators used in rule-based controls
446
+ typedef enum {
447
+ EN_R_EQ = 0, //!< Equal to
448
+ EN_R_NE = 1, //!< Not equal
449
+ EN_R_LE = 2, //!< Less than or equal to
450
+ EN_R_GE = 3, //!< Greater than or equal to
451
+ EN_R_LT = 4, //!< Less than
452
+ EN_R_GT = 5, //!< Greater than
453
+ EN_R_IS = 6, //!< Is equal to
454
+ EN_R_NOT = 7, //!< Is not equal to
455
+ EN_R_BELOW = 8, //!< Is below
456
+ EN_R_ABOVE = 9 //!< Is above
457
+ } EN_RuleOperator;
458
+
459
+ /// Link status codes used in rule-based controls
460
+ typedef enum {
461
+ EN_R_IS_OPEN = 1, //!< Link is open
462
+ EN_R_IS_CLOSED = 2, //!< Link is closed
463
+ EN_R_IS_ACTIVE = 3 //!< Control valve is active
464
+ } EN_RuleStatus;
465
+
466
+ #define EN_MISSING -1.E10 //!< Missing value indicator
467
+
468
+ #endif //EPANET2_ENUMS_H