|
5 | 5 | "cell_type": "markdown",
|
6 | 6 | "metadata": {},
|
7 | 7 | "source": [
|
8 |
| - "# Converting a Normal EPANET .inp File to a SWMM .inp file assuming Volume-Restricted Withdrawal (Outlet-Storage)\n", |
9 |
| - "This notebook takes an input EPANET file with demands input normally as a CWS base demand and outputs a .inp file configured for SWMM and uses a volume-restricted assumption \n", |
10 |
| - "A simplified schematic of the modified demand node in this method (Outlet-Storage) is seen below: \n", |
| 8 | + "# Converting a Normal EPANET .inp File to a SWMM .inp file: Float-valved Storage w/ concurrent consumption and leaks\n", |
| 9 | + "This notebook takes an input EPANET file with demands input normally as a CWS base demand and outputs a .inp file configured for SWMM in the Float-Storage Method \n", |
| 10 | + "A simplified schematic of the modified demand node in this method (Float-Storage) is seen below: \n", |
11 | 11 | "\n"
|
12 | 12 | ]
|
13 | 13 | },
|
|
24 | 24 | },
|
25 | 25 | {
|
26 | 26 | "cell_type": "code",
|
27 |
| - "execution_count": 9, |
| 27 | + "execution_count": 1, |
28 | 28 | "metadata": {},
|
29 |
| - "outputs": [], |
| 29 | + "outputs": [ |
| 30 | + { |
| 31 | + "ename": "ModuleNotFoundError", |
| 32 | + "evalue": "No module named 'pyperclip'", |
| 33 | + "output_type": "error", |
| 34 | + "traceback": [ |
| 35 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 36 | + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", |
| 37 | + "Cell \u001b[0;32mIn[1], line 6\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mre\u001b[39;00m\n\u001b[1;32m 5\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mmath\u001b[39;00m\n\u001b[0;32m----> 6\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpyperclip\u001b[39;00m\n", |
| 38 | + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'pyperclip'" |
| 39 | + ] |
| 40 | + } |
| 41 | + ], |
30 | 42 | "source": [
|
31 | 43 | "import wntr\n",
|
32 | 44 | "import numpy as np \n",
|
|
62 | 74 | ],
|
63 | 75 | "source": [
|
64 | 76 | " # Replace with appropriate path and filename\n",
|
65 |
| - "directory=r\"C:/IWS_Modelling/Other SWMM Trials/Mohan and Abhi Undulating/Pipe_Length_Comparison/\"\n", |
66 |
| - "filename=r'Network3_8hr_PDA.inp'\n", |
| 77 | + "directory=\"../Network-Files/Network 1/\"\n", |
| 78 | + "filename=\"Network3_4hr_PDA.inp\"\n", |
67 | 79 | "name_only=filename.rsplit('_',maxsplit=1)[0]\n",
|
68 | 80 | "print(\"Selected File: \",name_only)\n",
|
69 | 81 | "abs_path=directory+filename"
|
|
118 | 130 | "coords=dict() # For storing coordinates corresponding to each node as a tuple with the id as key\n",
|
119 | 131 | "all_nodes=[] # For storing list of node ids of all nodes\n",
|
120 | 132 | "all_elevations=[] # For storing elevations of all nodes\n",
|
121 |
| - "## MAYBE SAVE ALL NODE IDS IN DATAFRAME WITH ELEVATION AND BASE DEMAND AND THEN FILTER DATA FRAME LATER FOR DEMAND NODES ONLY\n", |
122 | 133 | "\n",
|
123 | 134 | "# Creates a network model object using EPANET .inp file\n",
|
124 | 135 | "network=wntr.network.WaterNetworkModel(abs_path)\n",
|
|
176 | 187 | " supply_hh='0'+supply_hh"
|
177 | 188 | ]
|
178 | 189 | },
|
| 190 | + { |
| 191 | + "cell_type": "code", |
| 192 | + "execution_count": null, |
| 193 | + "metadata": {}, |
| 194 | + "outputs": [], |
| 195 | + "source": [ |
| 196 | + "for conduit in conduits.index:" |
| 197 | + ] |
| 198 | + }, |
179 | 199 | {
|
180 | 200 | "attachments": {},
|
181 | 201 | "cell_type": "markdown",
|
|
243 | 263 | " \n",
|
244 | 264 | " # If the end node is a reservoir\n",
|
245 | 265 | " if end_node in reservoir_ids:\n",
|
246 |
| - " # MAke the end elevation the same as the start but subtract 1 (since reservoirs don't have ground elevation in EPANET)\n", |
| 266 | + " # Make the end elevation the same as the start but subtract 1 (since reservoirs don't have ground elevation in EPANET)\n", |
247 | 267 | " end_elevation=start_elevation-1\n",
|
248 | 268 | " # Make the end elevation equal to the elevation of the end node\n",
|
249 | 269 | " else: end_elevation=junctions.at[end_node,\"Elevation\"]\n",
|
|
873 | 893 | ],
|
874 | 894 | "metadata": {
|
875 | 895 | "kernelspec": {
|
876 |
| - "display_name": "base", |
| 896 | + "display_name": "Python 3.9.15 ('base')", |
877 | 897 | "language": "python",
|
878 | 898 | "name": "python3"
|
879 | 899 | },
|
|
887 | 907 | "name": "python",
|
888 | 908 | "nbconvert_exporter": "python",
|
889 | 909 | "pygments_lexer": "ipython3",
|
890 |
| - "version": "3.9.13" |
| 910 | + "version": "3.9.15" |
891 | 911 | },
|
892 | 912 | "orig_nbformat": 4,
|
893 | 913 | "vscode": {
|
894 | 914 | "interpreter": {
|
895 |
| - "hash": "fcd9f59ab1bf6e16dbc8d4c230f1b8c30298bc0144001d70fccf9fa6dc2fc062" |
| 915 | + "hash": "dd6a0ae2e89424b22bc0c3fd46707be6f981ef35bdac29f85707eba2fc78ecd7" |
896 | 916 | }
|
897 | 917 | }
|
898 | 918 | },
|
|
0 commit comments