Skip to content

Commit

Permalink
README.md is a symlink of ./swmm/README.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Assela Pathirana committed Apr 17, 2022
1 parent e4bd165 commit 807a2de
Showing 1 changed file with 80 additions and 41 deletions.
121 changes: 80 additions & 41 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Released under GNU GPL v.3

Release History:
----------------
version 5.2.000 released in 2022

version 5.1.015 released in 2021

version 1.0.0.1 first production (non-beta) release.
Expand Down Expand Up @@ -66,7 +68,7 @@ One should always use the new interface. The old interface (below) is left only



:Example 1: Retrieve simulation properties.
:Example 1: Retrive simulation properties.


::
Expand Down Expand Up @@ -95,32 +97,37 @@ One should always use the new interface. The old interface (below) is left only
60
>>>


:Example 2: Prints available entities


::


>>> st.entityList()
['SUBCATCH', 'NODE', 'LINK', 'SYS']
>>> st.Subcatch()
['A2', 'A1', 'A3', 'A4', 'A5', 'E1']
>>> st.Node()
['J1', 'J2', 'J3', 'J4', 'J5', 'J6', 'J7', 'J8', 'J9', 'J10', 'J11', 'J12']
>>> st.Link()
['T4-1', 'T4-2', 'T4-3', 'T1-1', 'T1-2', 'T2-1', 'T2-2', 'T2-3', 'T3-1', 'T3-2', 'T5']
>>> st.Sys()
['SYS']
>>> st.Pollutants() # no pollutants in this file.
[]
>>> wq=SWMM5Simulation("swmm5/examples/waterquality/Example5-EXP5.1.inp")
>>> wq.SWMM_Npolluts
1
>>> wq.Pollutants() # TSS in this case.
['TSS']
>>> lst=st.varList("SUBCATCH")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
>>> st.entityList()
['SUBCATCH', 'NODE', 'LINK', 'SYS']
>>> st.Subcatch() # Deprecated
['A2', 'A1', 'A3', 'A4', 'A5', 'E1']
>>> st.entityList(within='SUBCATCH') # use these new since version 5.2
['A2', 'A1', 'A3', 'A4', 'A5', 'E1']
>>> st.Node() # Deprecated
['J1', 'J2', 'J3', 'J4', 'J5', 'J6', 'J7', 'J8', 'J9', 'J10', 'J11', 'J12']
>>> st.entityList(within='NODE') # use these new since version 5.2
['J1', 'J2', 'J3', 'J4', 'J5', 'J6', 'J7', 'J8', 'J9', 'J10', 'J11', 'J12']
>>> st.Link() # Deprecated
['T4-1', 'T4-2', 'T4-3', 'T1-1', 'T1-2', 'T2-1', 'T2-2', 'T2-3', 'T3-1', 'T3-2', 'T5']
>>> st.entityList(within='LINK')
['T4-1', 'T4-2', 'T4-3', 'T1-1', 'T1-2', 'T2-1', 'T2-2', 'T2-3', 'T3-1', 'T3-2', 'T5']
>>> st.Sys() # Deprecated
['SYS']
>>> st.entityList(within='SYS') # use these new since version 5.2
['SYS']
>>> st.Pollutants() # no pollutants in this file.
[]
>>> wq=SWMM5Simulation("swmm5/examples/waterquality/Example5-EXP5.1.inp")
>>> wq.SWMM_Npolluts
1
>>> wq.Pollutants() # TSS in this case.
['TSS']
>>> lst=st.varList("SUBCATCH")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
0 Rainfall (in/hr or mm/hr)
1 Snow depth (in or mm)
2 Evaporation loss (in/hr or mm/hr)
Expand All @@ -131,8 +138,9 @@ One should always use the new interface. The old interface (below) is left only
7 Soil Moisture (volumetric fraction, less or equal tosoil porosity)


>>> lst=wq.varList("SUBCATCH") # for the network that has pollutants.
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.

>>> lst=wq.varList("SUBCATCH") # for the network that has pollutants.
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
0 Rainfall (in/hr or mm/hr)
1 Snow depth (in or mm)
2 Evaporation loss (in/hr or mm/hr)
Expand All @@ -143,25 +151,25 @@ One should always use the new interface. The old interface (below) is left only
7 Soil Moisture (volumetric fraction, less or equal tosoil porosity)
8 Runoff concentration of TSS (mg/l)
>>> lst=wq.varList("NODE")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
>>> lst=wq.varList("NODE")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
0 Depth of water above invert (ft or m)
1 Hydraulic head (ft or m)
2 Volume of stored + ponded water (ft3 or m3)
3 Lateral inflow (flow units)
4 Total inflow (lateral + upstream) (flow units)
5 Flow lost to flooding (flow units)
6 Concentration of TSS (mg/l)
>>> lst=wq.varList("LINK")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
>>> lst=wq.varList("LINK")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
0 Flow rate (flow units)
1 Flow depth (ft or m)
2 Flow velocity (ft/s or m/s)
3 Froude number
4 Capacity (fraction of conduit filled)
5 Concentration of TSS (mg/l)
>>> lst=wq.varList("SYS")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
>>> lst=wq.varList("SYS")
>>> print ("\n".join( "%4i %s"% (i,v) for i,v in enumerate(lst))) # print in a column with index.
0 Air temperature (deg. F or deg. C)
1 Rainfall (in/hr or mm/hr)
2 Snow depth (in or mm)
Expand All @@ -176,6 +184,7 @@ One should always use the new interface. The old interface (below) is left only
11 Flow leaving through outfalls (flow units)
12 Volume of stored water (ft3 or m3)
13 Evaporation rate (in/day or mm/day)
14 Potential evaporation rate (PET) in/day or mm/day)



Expand Down Expand Up @@ -214,7 +223,7 @@ One should always use the new interface. The old interface (below) is left only

::

>>> wq.Subcatch()
>>> wq.entityList(within='SUBCATCH')
['S1', 'S2', 'S3', 'S4', 'S5', 'S6', 'S7']

>>> r=list(wq.Results('SUBCATCH','S3', 8)) # TSS out of catchment 'S3'. We convert it to a list.
Expand All @@ -233,7 +242,7 @@ One should always use the new interface. The old interface (below) is left only

::

>>> wq.Node()
>>> wq.entityList(within='NODE')
['J1', 'J2', 'J3', 'J4', 'J5', 'J6', 'J7', 'J8', 'J9', 'J10', 'J11', 'O1']

>>> r=list(wq.Results('NODE','J3', 6)) # TSS out of Node 'J3'. We convert it to a list.
Expand All @@ -249,26 +258,56 @@ One should always use the new interface. The old interface (below) is left only
15.14
15.64

>>> wq.Link()
>>> wq.entityList(within='LINK')
['C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9', 'C10', 'C11']

>>> r=list(wq.Results('LINK','C11', 5)) # TSS out of Link 'C11'. We convert it to a list.
>>> print ("\n".join( "%5.2f"% (i) for i in r)) # Lets print the first 10 items. #doctest: +ELLIPSIS
>>> print ("\n".join( "%5.2f"% (i) for i in r)) # #doctest: +ELLIPSIS
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
0.00
5.55
9.98
12.72
6.40
12.64
16.57
19.60
22.53
25.40
...
44.95
0.00


:Example 5: Tracking output files
:Example 5: Get all results once (inefficient, but easy)

::

>>> simtemp=SWMM5Simulation("swmm5/examples/simple/swmm5Example.inp")
>>> ar=simtemp.allResults()
>>> len(ar)
4
>>> list(ar.keys())
['SUBCATCH', 'NODE', 'LINK', 'SYS']
>>> len(ar['NODE'])
12
>>> list(ar['NODE'].keys())
['J1', 'J2', 'J3', 'J4', 'J5', 'J6', 'J7', 'J8', 'J9', 'J10', 'J11', 'J12']
>>> list(ar['NODE']['J1'].keys())[5]
'Flow lost to flooding (flow units)'
>>> max(list(ar['NODE']['J1']['Flow lost to flooding (flow units)'])) # doctest: +ELLIPSIS
4267.9...
>>> # or we can use the index for shorthand
>>> max(list(list(ar['NODE']['J10'].values())[5])) # doctest: +ELLIPSIS
2252.7...


:Example 6: Tracking output files

::

Expand Down

0 comments on commit 807a2de

Please sign in to comment.