Skip to content

Commit ef5019b

Browse files
author
Sam Hatchett
committed
2 parents cda99c2 + 7c1faa8 commit ef5019b

5 files changed

Lines changed: 527 additions & 0 deletions

File tree

owa-epanet/test/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Run unittests with:
2+
3+
```python
4+
pytest test_owa_epanet.py
5+
```

owa-epanet/test/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# -*- coding: utf-8 -*-
2+
# -----------------------------------------------------------------------------
3+
"""test owa-epanet toolkit."""

owa-epanet/test/data/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# -*- coding: utf-8 -*-
2+
# -----------------------------------------------------------------------------
3+
# Copyright (c) 2019 CitiLogics, a Xylem Brand
4+
#
5+
# -----------------------------------------------------------------------------
6+
"""test data for owa-epanet toolkit."""
7+
8+
# Standard library imports
9+
import os
10+
11+
data_path = os.path.abspath(os.path.dirname(__file__))
12+
13+
# Test object paths
14+
example_1_path = os.path.join(data_path, 'example_1.inp')

owa-epanet/test/data/example_1.inp

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
[TITLE]
2+
EPANET Example Network 1
3+
A simple example of modeling chlorine decay. Both bulk and
4+
wall reactions are included.
5+
6+
[JUNCTIONS]
7+
;ID Elev Demand Pattern
8+
10 710 0 ;
9+
11 710 150 ;
10+
12 700 150 ;
11+
13 695 100 ;
12+
21 700 150 ;
13+
22 695 200 ;
14+
23 690 150 ;
15+
31 700 100 ;
16+
32 710 100 ;
17+
18+
[RESERVOIRS]
19+
;ID Head Pattern
20+
9 800 ;
21+
22+
[TANKS]
23+
;ID Elevation InitLevel MinLevel MaxLevel Diameter MinVol VolCurve
24+
2 850 120 100 150 50.5 0 ;
25+
26+
[PIPES]
27+
;ID Node1 Node2 Length Diameter Roughness MinorLoss Status
28+
10 10 11 10530 18 100 0 Open ;
29+
11 11 12 5280 14 100 0 Open ;
30+
12 12 13 5280 10 100 0 Open ;
31+
21 21 22 5280 10 100 0 Open ;
32+
22 22 23 5280 12 100 0 Open ;
33+
31 31 32 5280 6 100 0 Open ;
34+
110 2 12 200 18 100 0 Open ;
35+
111 11 21 5280 10 100 0 Open ;
36+
112 12 22 5280 12 100 0 Open ;
37+
113 13 23 5280 8 100 0 Open ;
38+
121 21 31 5280 8 100 0 Open ;
39+
122 22 32 5280 6 100 0 Open ;
40+
41+
[PUMPS]
42+
;ID Node1 Node2 Parameters
43+
9 9 10 HEAD 1 ;
44+
45+
[VALVES]
46+
;ID Node1 Node2 Diameter Type Setting MinorLoss
47+
48+
[TAGS]
49+
50+
[DEMANDS]
51+
;Junction Demand Pattern Category
52+
53+
[STATUS]
54+
;ID Status/Setting
55+
56+
[PATTERNS]
57+
;ID Multipliers
58+
;Demand Pattern
59+
1 1.0 1.2 1.4 1.6 1.4 1.2
60+
1 1.0 0.8 0.6 0.4 0.6 0.8
61+
62+
[CURVES]
63+
;ID X-Value Y-Value
64+
;PUMP: Pump Curve for Pump 9
65+
1 1500 250
66+
67+
[CONTROLS]
68+
LINK 9 OPEN IF NODE 2 BELOW 110
69+
LINK 9 CLOSED IF NODE 2 ABOVE 140
70+
71+
72+
[RULES]
73+
74+
[ENERGY]
75+
Global Efficiency 75
76+
Global Price 0.0
77+
Demand Charge 0.0
78+
79+
[EMITTERS]
80+
;Junction Coefficient
81+
82+
[QUALITY]
83+
;Node InitQual
84+
10 0.5
85+
11 0.5
86+
12 0.5
87+
13 0.5
88+
21 0.5
89+
22 0.5
90+
23 0.5
91+
31 0.5
92+
32 0.5
93+
9 1.0
94+
2 1.0
95+
96+
[SOURCES]
97+
;Node Type Quality Pattern
98+
99+
[REACTIONS]
100+
;Type Pipe/Tank Coefficient
101+
102+
103+
[REACTIONS]
104+
Order Bulk 1
105+
Order Tank 1
106+
Order Wall 1
107+
Global Bulk -.5
108+
Global Wall -1
109+
Limiting Potential 0.0
110+
Roughness Correlation 0.0
111+
112+
[MIXING]
113+
;Tank Model
114+
115+
[TIMES]
116+
Duration 24:00
117+
Hydraulic Timestep 1:00
118+
Quality Timestep 0:05
119+
Pattern Timestep 2:00
120+
Pattern Start 0:00
121+
Report Timestep 1:00
122+
Report Start 0:00
123+
Start ClockTime 12 am
124+
Statistic None
125+
126+
[REPORT]
127+
Status Yes
128+
Summary No
129+
Page 0
130+
131+
[OPTIONS]
132+
Units GPM
133+
Headloss H-W
134+
Specific Gravity 1.0
135+
Viscosity 1.0
136+
Trials 40
137+
Accuracy 0.001
138+
CHECKFREQ 2
139+
MAXCHECK 10
140+
DAMPLIMIT 0
141+
Unbalanced Continue 10
142+
Pattern 1
143+
Demand Multiplier 1.0
144+
Emitter Exponent 0.5
145+
Quality Chlorine mg/L
146+
Diffusivity 1.0
147+
Tolerance 0.01
148+
149+
[COORDINATES]
150+
;Node X-Coord Y-Coord
151+
10 20.00 70.00
152+
11 30.00 70.00
153+
12 50.00 70.00
154+
13 70.00 70.00
155+
21 30.00 40.00
156+
22 50.00 40.00
157+
23 70.00 40.00
158+
31 30.00 10.00
159+
32 50.00 10.00
160+
9 10.00 70.00
161+
2 50.00 90.00
162+
163+
[VERTICES]
164+
;Link X-Coord Y-Coord
165+
166+
[LABELS]
167+
;X-Coord Y-Coord Label & Anchor Node
168+
6.99 73.63 "Source"
169+
13.48 68.13 "Pump"
170+
43.85 91.21 "Tank"
171+
172+
[BACKDROP]
173+
DIMENSIONS 7.00 6.00 73.00 94.00
174+
UNITS None
175+
FILE
176+
OFFSET 0.00 0.00
177+
178+
[END]

0 commit comments

Comments
 (0)