Skip to content

Commit 5b87a2b

Browse files
committed
WIP API bindings for pollutants #204, #162, #163, #184, #180
1 parent 2a6843e commit 5b87a2b

14 files changed

+2695
-655
lines changed

python/epaswmm/solver/solver.pxd

+39-4
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,15 @@ cdef extern from "swmm5.h":
6363
swmm_SUBCATCH_INFIL # Infiltration
6464
swmm_SUBCATCH_RUNOFF # Runoff
6565
swmm_SUBCATCH_RPTFLAG # Reporting flag
66+
swmm_SUBCATCH_WIDTH # Width
67+
swmm_SUBCATCH_SLOPE # Slope
68+
swmm_SUBCATCH_CURB_LENGTH # Curb length
69+
swmm_SUBCATCH_API_RAINFALL # API rainfall
70+
swmm_SUBCATCH_API_SNOWFALL # API snowfall
6671
swmm_SUBCATCH_POLLUTANT_BUILDUP # Pollutant buildup
67-
swmm_SUBCATCH_POLLUTANT_PONDED_CONCENTRATION # Pollutant ponded concentration
68-
swmm_SUBCATCH_POLLUTANT_RUNOFF_CONCENTRATION # Pollutant runoff concentration
72+
swmm_SUBCATCH_EXTERNAL_POLLUTANT_BUILDUP # External pollutant buildup
73+
swmm_SUBCATCH_POLLUTANT_RUNOFF_CONCENTRATION # Pollutant ponded concentration
74+
swmm_SUBCATCH_POLLUTANT_PONDED_CONCENTRATION # Pollutant runoff concentration
6975
swmm_SUBCATCH_POLLUTANT_TOTAL_LOAD # Pollutant total load
7076

7177
# SWMM Node properties
@@ -80,8 +86,11 @@ cdef extern from "swmm5.h":
8086
swmm_NODE_INFLOW # Total inflow
8187
swmm_NODE_OVERFLOW # Flooding
8288
swmm_NODE_RPTFLAG # Reporting flag
89+
swmm_NODE_SURCHARGE_DEPTH # Surcharge depth
90+
swmm_NODE_PONDED_AREA # Ponded area
91+
swmm_NODE_INITIAL_DEPTH # Initial depth
8392
swmm_NODE_POLLUTANT_CONCENTRATION # Pollutant concentration
84-
swmm_NODE_POLLUTANT_INFLOW_CONCENTRATION # Pollutant inflow concentration
93+
swmm_NODE_POLLUTANT_LATMASS_FLUX # Pollutant lateral mass flux
8594

8695
# SWMM Link properties
8796
ctypedef enum swmm_LinkProperty:
@@ -100,8 +109,18 @@ cdef extern from "swmm5.h":
100109
swmm_LINK_VELOCITY # Velocity
101110
swmm_LINK_TOPWIDTH # Top width
102111
swmm_LINK_RPTFLAG # Reporting flag
112+
swmm_LINK_OFFSET1 # Inlet offset
113+
swmm_LINK_OFFSET2 # Outlet offset
114+
swmm_LINK_INITIAL_FLOW # Initial flow
115+
swmm_LINK_FLOW_LIMIT # Flow limit
116+
swmm_LINK_INLET_LOSS # Inlet loss
117+
swmm_LINK_OUTLET_LOSS # Outlet loss
118+
swmm_LINK_AVERAGE_LOSS # Average depth
119+
swmm_LINK_SEEPAGE_RATE # Seepage rate
120+
swmm_LINK_HAS_FLAPGATE # Flap gate
103121
swmm_LINK_POLLUTANT_CONCENTRATION # Pollutant concentration
104122
swmm_LINK_POLLUTANT_LOAD # Pollutant load
123+
swmm_LINK_POLLUTANT_LATMASS_FLUX # Pollutant lateral mass flux
105124

106125
# SWMM System properties
107126
ctypedef enum swmm_SystemProperty:
@@ -125,7 +144,7 @@ cdef extern from "swmm5.h":
125144
swmm_IGNORERAINFALL # Flag indicating whether rainfall is ignored.
126145
swmm_IGNORERDII # Flag indicating whether RDII is ignored.
127146
swmm_IGNORESNOWMELT # Flag indicating whether snowmelt is ignored.
128-
swmm_IGNOREGWATER # Flag indicating whether groundwater is ignored.
147+
swmm_IGNOREGROUNDWATER # Flag indicating whether groundwater is ignored.
129148
swmm_IGNOREROUTING # Flag indicating whether routing is ignored.
130149
swmm_IGNOREQUALITY # Flag indicating whether water quality is ignored.
131150
swmm_RULESTEP # The rule step size.
@@ -168,6 +187,7 @@ cdef extern from "swmm5.h":
168187
ERR_API_TIME_PERIOD # Invalid time period
169188
ERR_API_HOTSTART_FILE_OPEN # Error opening hotstart file
170189
ERR_API_HOTSTART_FILE_FORMAT # Invalid hotstart file format
190+
ERR_API_IS_RUNNING # Simulation is already running
171191

172192
# SWMM API function return simulation progress
173193
ctypedef void (*progress_callback)(double progress);
@@ -279,12 +299,27 @@ cdef extern from "swmm5.h":
279299
# param: index: object index
280300
cdef double swmm_getValue(int property, int index)
281301

302+
303+
# Retrieves the value of a property for an object of a given type and index
304+
# param: objType: object type
305+
# param: property: property type
306+
# param: index: object index
307+
# param: subIndex: sub-index
308+
cdef double swmm_getValueExpanded(int objType, int property, int index, int subIndex)
309+
282310
# Sets the value of a property for an object of a given type and index
283311
# param: property: property type
284312
# param: index: object index
285313
# param: value: property value
286314
cdef int swmm_setValue(int property, int index, double value)
287315

316+
# Sets the value of a property for an object of a given type and index
317+
# param: objType: object type
318+
# param: property: property type
319+
# param: index: object index
320+
# param: value: property value
321+
cdef int swmm_setValueExpanded(int objType, int property, int index, int subindex, double value)
322+
288323
# Retrieves the value of a property for an object of a given type and index
289324
# param: property: property type
290325
# param: index: object index

0 commit comments

Comments
 (0)