This code is a Python interface to the SWMM5 hydrology and hydraulic simulation software. It uses the ctypes library to interface with the SWMM5 library, which is either a shared library file on Linux systems (libswmm5.so) or a dynamic-link library file on Windows systems (swmm5.dll). The code provides several functions to run and control the SWMM5 simulation, such as run
, open
, step
, end
, close
, and report
. It also provides functions to retrieve information from the simulation, such as getMassBalErr
, getWarnings
, getError
, getValue
, getSavedValue
, and decodeDate
. Additionally, the code includes several constants that are used to specify the type of objects and properties in the simulation.
Index Name | Integer Value | Description |
---|---|---|
GAGE | 0 | |
SUBCATCH | 1 | |
NODE | 2 | |
LINK | 3 | |
SYSTEM | 100 | |
JUNCTION | 0 | |
OUTFALL | 1 | |
STORAGE | 2 | |
DIVIDER | 3 | |
CONDUIT | 0 | |
PUMP | 1 | |
ORIFICE | 2 | |
WEIR | 3 | |
OUTLET | 4 | |
GAGE_RAINFALL | 100 | |
SUBCATCH_AREA | 200 | |
SUBCATCH_RAINGAGE | 201 | |
SUBCATCH_RAINFALL | 202 | |
SUBCATCH_EVAP | 203 | |
SUBCATCH_INFIL | 204 | |
SUBCATCH_RUNOFF | 205 | |
SUBCATCH_RPTFLAG | 206 | |
NODE_TYPE | 300 | |
NODE_ELEV | 301 | |
NODE_MAXDEPTH | 302 | |
NODE_DEPTH | 303 | |
NODE_HEAD | 304 | |
NODE_VOLUME | 305 | |
NODE_LATFLOW | 306 | |
NODE_INFLOW | 307 | |
NODE_OVERFLOW | 308 | |
NODE_RPTFLAG | 309 | |
LINK_TYPE | 400 | |
LINK_NODE1 | 401 | |
LINK_NODE2 | 402 | |
LINK_LENGTH | 403 | |
LINK_SLOPE | 404 | |
LINK_FULLDEPTH | 405 | |
LINK_FULLFLOW | 406 | |
LINK_SETTING | 407 | |
LINK_TIMEOPEN | 408 | |
LINK_TIMECLOSED | 409 | |
LINK_FLOW | 410 | |
LINK_DEPTH | 411 | |
LINK_VELOCITY | 412 | |
LINK_TOPWIDTH | 413 | |
LINK_RPTFLAG | 414 | |
STARTDATE | 0 | |
CURRENTDATE | 1 | |
ELAPSEDTIME | 2 | |
ROUTESTEP | 3 | |
MAXROUTESTEP | 4 | |
REPORTSTEP | 5 | |
TOTALSTEPS | 6 | |
NOREPORT | 7 | |
FLOWUNITS | 8 | |
CFS | 0 | |
GPM | 1 | |
MGD | 2 | |
CMS | 3 | |
LPS | 4 | |
MLD | 5 |