1from apify_client import ApifyClient
2
3
4
5client = ApifyClient("<YOUR_API_TOKEN>")
6
7
8run_input = {
9 "pipes": [
10 "water at 20 C, 200 gpm through 300 ft of 3 in sch 40 steel with 6 elbows, 2 gate valves and 1 check valve, rise 20 ft",
11 "compressed air at 7 barg and 25 C, 300 scfm through 150 m of DN50 galvanized pipe, 4 elbows",
12 {
13 "fluid": "ethylene glycol 30%",
14 "temperature": "5 C",
15 "flow": "30 m3/h",
16 "material": "PVC",
17 "length": "80 m",
18 "fittings": [
19 "8 elbows",
20 "2 ball valves",
21 ],
22 "sizePipe": True,
23 },
24 ],
25 "pumpSystems": [{
26 "title": "Booster pump to a roof tank",
27 "fluid": "water",
28 "temperature": "60 F",
29 "pump": {
30 "curve": [
31 [
32 "0 gpm",
33 "160 ft",
34 ],
35 [
36 "100 gpm",
37 "155 ft",
38 ],
39 [
40 "200 gpm",
41 "140 ft",
42 ],
43 [
44 "300 gpm",
45 "115 ft",
46 ],
47 [
48 "400 gpm",
49 "80 ft",
50 ],
51 ],
52 "efficiency": [
53 [
54 "50 gpm",
55 "35%",
56 ],
57 [
58 "150 gpm",
59 "62%",
60 ],
61 [
62 "250 gpm",
63 "74%",
64 ],
65 [
66 "300 gpm",
67 "75%",
68 ],
69 [
70 "350 gpm",
71 "72%",
72 ],
73 [
74 "400 gpm",
75 "65%",
76 ],
77 ],
78 "npshr": [
79 [
80 "100 gpm",
81 "6 ft",
82 ],
83 [
84 "300 gpm",
85 "10 ft",
86 ],
87 [
88 "400 gpm",
89 "15 ft",
90 ],
91 ],
92 },
93 "staticHead": "85 ft",
94 "suction": {
95 "pipe": "5 in sch 40 steel",
96 "length": "20 ft",
97 "fittings": "entrance, 1 gate valve, 1 elbow",
98 "liquidLevel": "4 ft",
99 },
100 "discharge": "600 ft of 4 in sch 40 steel, 10 elbows, 1 check valve, 2 gate valves, exit",
101 }],
102 "networks": [{
103 "title": "Two-loop town main",
104 "fluid": "water",
105 "temperature": "15 C",
106 "headloss": "hazen-williams",
107 "nodes": [
108 {
109 "id": "Tank",
110 "type": "tank",
111 "head": "95 m",
112 "x": 0,
113 "y": 0,
114 },
115 {
116 "id": "A",
117 "elevation": "40 m",
118 "demand": "25 l/s",
119 "x": 1000,
120 "y": 0,
121 },
122 {
123 "id": "B",
124 "elevation": "38 m",
125 "demand": "30 l/s",
126 "x": 2000,
127 "y": 0,
128 },
129 {
130 "id": "C",
131 "elevation": "45 m",
132 "demand": "20 l/s",
133 "x": 2000,
134 "y": -900,
135 },
136 {
137 "id": "D",
138 "elevation": "42 m",
139 "demand": "35 l/s",
140 "x": 1000,
141 "y": -900,
142 },
143 {
144 "id": "E",
145 "elevation": "50 m",
146 "demand": "15 l/s",
147 "x": 0,
148 "y": -900,
149 },
150 ],
151 "pipes": [
152 {
153 "id": "P1",
154 "from": "Tank",
155 "to": "A",
156 "length": "1000 m",
157 "diameter": "400 mm",
158 "C": 130,
159 },
160 {
161 "id": "P2",
162 "from": "A",
163 "to": "B",
164 "length": "1000 m",
165 "diameter": "250 mm",
166 "C": 130,
167 },
168 {
169 "id": "P3",
170 "from": "B",
171 "to": "C",
172 "length": "900 m",
173 "diameter": "200 mm",
174 "C": 130,
175 },
176 {
177 "id": "P4",
178 "from": "D",
179 "to": "C",
180 "length": "1000 m",
181 "diameter": "200 mm",
182 "C": 130,
183 },
184 {
185 "id": "P5",
186 "from": "A",
187 "to": "D",
188 "length": "900 m",
189 "diameter": "300 mm",
190 "C": 130,
191 },
192 {
193 "id": "P6",
194 "from": "E",
195 "to": "D",
196 "length": "1000 m",
197 "diameter": "150 mm",
198 "C": 130,
199 },
200 {
201 "id": "P7",
202 "from": "Tank",
203 "to": "E",
204 "length": "900 m",
205 "diameter": "200 mm",
206 "C": 130,
207 },
208 ],
209 }],
210}
211
212
213run = client.actor("jumblemog/pipe-flow-calculator").call(run_input=run_input)
214
215
216print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
217for item in client.dataset(run.default_dataset_id).iterate_items():
218 print(item)
219
220