Skip to content

Commit

Permalink
Merge pull request #25 from ImperialCollegeLondon/swmm_text_tools
Browse files Browse the repository at this point in the history
SWMM text tools
  • Loading branch information
barneydobson authored Jan 29, 2024
2 parents 0dc06ff + 476a1e3 commit fe39478
Show file tree
Hide file tree
Showing 8 changed files with 1,085 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#
# pip-compile --extra=dev --output-file=dev-requirements.txt
#
aenum==3.1.11
# via
# pyswmm
# swmm-toolkit
affine==2.4.0
# via
# pysheds
Expand Down Expand Up @@ -102,6 +106,8 @@ imageio==2.33.1
# via scikit-image
iniconfig==2.0.0
# via pytest
julian==0.14
# via pyswmm
kiwisolver==1.4.5
# via matplotlib
lazy-loader==0.3
Expand Down Expand Up @@ -162,6 +168,7 @@ packaging==23.2
# fastparquet
# geopandas
# matplotlib
# pyswmm
# pytest
# rioxarray
# scikit-image
Expand Down Expand Up @@ -203,6 +210,8 @@ pyproject-hooks==1.0.0
# via build
pysheds==0.3.5
# via swmmanywhere (pyproject.toml)
pyswmm==1.5.1
# via swmmanywhere (pyproject.toml)
pytest==7.4.4
# via
# pytest-cov
Expand Down Expand Up @@ -264,6 +273,8 @@ snkit==1.9.0
# via swmmanywhere (pyproject.toml)
snuggs==1.4.7
# via rasterio
swmm-toolkit==0.15.3
# via pyswmm
tifffile==2023.12.9
# via scikit-image
tqdm==4.66.1
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ dependencies = [ # TODO definitely don't need all of these
"pandas",
"pyarrow",
"pysheds",
"pyswmm",
"PyYAML",
"rasterio",
"rioxarray",
Expand Down
11 changes: 11 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#
# pip-compile
#
aenum==3.1.11
# via
# pyswmm
# swmm-toolkit
affine==2.4.0
# via
# pysheds
Expand Down Expand Up @@ -80,6 +84,8 @@ idna==3.6
# via requests
imageio==2.33.1
# via scikit-image
julian==0.14
# via pyswmm
kiwisolver==1.4.5
# via matplotlib
lazy-loader==0.3
Expand Down Expand Up @@ -131,6 +137,7 @@ packaging==23.2
# fastparquet
# geopandas
# matplotlib
# pyswmm
# rioxarray
# scikit-image
# xarray
Expand Down Expand Up @@ -161,6 +168,8 @@ pyproj==3.6.1
# rioxarray
pysheds==0.3.5
# via swmmanywhere (pyproject.toml)
pyswmm==1.5.1
# via swmmanywhere (pyproject.toml)
python-dateutil==2.8.2
# via
# matplotlib
Expand Down Expand Up @@ -206,6 +215,8 @@ snkit==1.9.0
# via swmmanywhere (pyproject.toml)
snuggs==1.4.7
# via rasterio
swmm-toolkit==0.15.3
# via pyswmm
tifffile==2023.12.9
# via scikit-image
tqdm==4.66.1
Expand Down
173 changes: 173 additions & 0 deletions swmmanywhere/defs/basic_drainage_all_bits.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
[TITLE]
;;Project Title/Notes

[OPTIONS]
;;Option Value
FLOW_UNITS LPS
INFILTRATION HORTON
FLOW_ROUTING KINWAVE
LINK_OFFSETS DEPTH
MIN_SLOPE 0
ALLOW_PONDING NO
SKIP_STEADY_STATE NO

START_DATE 10/03/2020
START_TIME 00:00:00
REPORT_START_DATE 10/03/2020
REPORT_START_TIME 00:00:00
END_DATE 10/08/2020
END_TIME 00:00:00
SWEEP_START 1/1
SWEEP_END 12/31
DRY_DAYS 0
REPORT_STEP 00:15:00
WET_STEP 00:05:00
DRY_STEP 01:00:00
ROUTING_STEP 0:00:05
RULE_STEP 00:00:00

INERTIAL_DAMPING PARTIAL
NORMAL_FLOW_LIMITED BOTH
FORCE_MAIN_EQUATION H-W
VARIABLE_STEP 0.75
LENGTHENING_STEP 0
MIN_SURFAREA 0
MAX_TRIALS 0
HEAD_TOLERANCE 0
SYS_FLOW_TOL 5
LAT_FLOW_TOL 5
MINIMUM_STEP 0.5
THREADS 1

[EVAPORATION]
;;Data Source Parameters
;;-------------- ----------------
CONSTANT 0.0
DRY_ONLY NO

[RAINGAGES]
;;Name Format Interval SCF Source
;;-------------- --------- ------ ------ ----------
1 INTENSITY 00:05 1.0 FILE "january.dat" 1 MM

[SUBCATCHMENTS]
;;Name Rain Gage Outlet Area %Imperv Width %Slope CurbLen SnowPack
;;-------------- ---------------- ---------------- -------- -------- -------- -------- -------- ----------------
1 1 5 1.166 100 500 0.5 0 empty

[SUBAREAS]
;;Subcatchment N-Imperv N-Perv S-Imperv S-Perv PctZero RouteTo PctRouted
;;-------------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
1 0.01 0.1 0.05 0.05 25 OUTLET

[INFILTRATION]
;;Subcatchment MaxRate MinRate Decay DryTime MaxInfil
;;-------------- ---------- ---------- ---------- ---------- ----------
1 3.0 0.5 4 7 0

[SNOWPACKS]
;;Name Surface Parameters
;;-------------- ---------- ----------
empty PLOWABLE 0.001 0.001 32.0 0.10 0.00 0.00 0.0
empty IMPERVIOUS 0.001 0.001 32.0 0.10 0.00 0.00 0.00
empty PERVIOUS 0.001 0.001 32.0 0.10 0.00 0.00 0.00
empty REMOVAL 1.0 0.0 0.0 0.0 0.0 0.0

[JUNCTIONS]
;;Name Elevation MaxDepth InitDepth SurDepth Aponded
;;-------------- ---------- ---------- ---------- ---------- ----------
4 30.85 0.5 0 0 0
6 30.85 0 0 0 0
7 30.85 0 0 0 0

[OUTFALLS]
;;Name Elevation Type Stage Data Gated Route To
;;-------------- ---------- ---------- ---------------- -------- ----------------
3 29.759 FREE NO

[STORAGE]
;;Name Elev. MaxDepth InitDepth Shape Curve Name/Params N/A Fevap Psi Ksat IMD
;;-------------- -------- ---------- ----------- ---------- ---------------------------- -------- -------- -------- --------
5 30.85 0.5 0 FUNCTIONAL 1000 0 0 0 0
8 30.85 1 0 TABULAR t1 0 0

[CONDUITS]
;;Name From Node To Node Length Roughness InOffset OutOffset InitFlow MaxFlow
;;-------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ---------- ----------
1 4 3 37.9 0.014344444444 0 0 0 0
6 6 3 400 0.01 0 0 0 0
7 7 3 400 0.01 0 0 0 0
8 5 8 400 0.01 0 0 0 0
9 8 7 400 0.01 0 0 0 0

[PUMPS]
;;Name From Node To Node Pump Curve Status Sartup Shutoff
;;-------------- ---------------- ---------------- ---------------- ------ -------- --------
4 5 7 * ON 0 0

[ORIFICES]
;;Name From Node To Node Type Offset Qcoeff Gated CloseTime
;;-------------- ---------------- ---------------- ------------ ---------- ---------- -------- ----------
3 5 6 SIDE 0 0.65 NO 0

[WEIRS]
;;Name From Node To Node Type CrestHt Qcoeff Gated EndCon EndCoeff Surcharge RoadWidth RoadSurf Coeff. Curve
;;-------------- ---------------- ---------------- ------------ ---------- ---------- -------- -------- ---------- ---------- ---------- ---------- ----------------
2 5 4 TRANSVERSE 0.25 3.33 NO 0 0 YES

[XSECTIONS]
;;Link Shape Geom1 Geom2 Geom3 Geom4 Barrels Culvert
;;-------------- ------------ ---------------- ---------- ---------- ---------- ---------- ----------
1 TRIANGULAR 10.7 43.0 0.0 0.0 1
6 CIRCULAR 1 0 0 0 1
7 CIRCULAR 1 0 0 0 1
8 RECT_CLOSED 1.5 0.5 0 0 1
9 CIRCULAR 1 0 0 0 1
3 CIRCULAR 1 0 0 0
2 RECT_OPEN 1 2 0 0

[CURVES]
;;Name Type X-Value Y-Value
;;-------------- ---------- ---------- ----------
t1 Storage 0 1
t1 1 2

[REPORT]
;;Reporting Options
SUBCATCHMENTS ALL
NODES ALL
LINKS ALL

[TAGS]

[MAP]
DIMENSIONS 0.000 0.000 10000.000 10000.000
Units None

[COORDINATES]
;;Node X-Coord Y-Coord
;;-------------- ------------------ ------------------
4 4743.590 5396.270
6 4615.807 4829.857
7 4484.083 4204.171
3 6072.261 5477.855
5 3298.368 5069.930
8 3092.287 3801.653

[VERTICES]
;;Link X-Coord Y-Coord
;;-------------- ------------------ ------------------

[Polygons]
;;Subcatchment X-Coord Y-Coord
;;-------------- ------------------ ------------------
1 -594.002 2399.077
1 2750.865 5801.615
1 1516.724 7347.174
1 -836.217 5963.091

[SYMBOLS]
;;Gage X-Coord Y-Coord
;;-------------- ------------------ ------------------
1 268.065 7715.618

Loading

0 comments on commit fe39478

Please sign in to comment.