TUFLOW SWMM Tutorial M03: Difference between revisions
Content deleted Content added
| (23 intermediate revisions by 4 users not shown) | |||
Line 1:
= Introduction =
This tutorial, Module 3 of the TUFLOW
= Project Initialization =
==QGIS==
QGIS Version 3.34 or newer, and QGIS TUFLOW Plugin 3.
Define the Coordinate Reference System (CRS), also called ‘Projection’, for the QGIS workspace:
<ol>
Line 16:
<br>
{{Video|name=Animation_TS1_Initialization_01a.mp4|width=1235}}<br>
==TUFLOW Plugin==▼
Next we need to configure the QGIS TUFLOW Plugin settings to link with the project folder where we will build our model:<br>▼
<ol>▼
<li>Open the 'Configure TUFLOW Project' tool by selecting Plugins > TUFLOW > Editing > Configure / Create TUFLOW Project.▼
<li>To set the location of the TUFLOW folder, click 'Browse...' and navigate to the '''TUFLOW_SWMM_Module_03''' folder. Click 'Select Folder'. ▼
<li>To set the location of the TUFLOW single precision executable file, click 'Browse...' and navigate to the '''exe\2023-03-AD''' folder. Select '''TUFLOW_iSP_w64.exe''' and click 'Open'.▼
<li>Select 'GPKG' as the GIS Format. ▼
<li>Select 'TUFLOW Classic / HPC' as the TUFLOW Engine.▼
<li>Tick on 'Save Default Settings Globally'.▼
<li>Click 'OK'.<br>▼
<br>▼
</ol>▼
<br>▼
==TUFLOW Model==
Line 50 ⟶ 34:
<br>
Style the TUFLOW layers. Suggested styling steps were provided in <u>[[TUFLOW_SWMM_Tutorial_M01#Load_and_Style_TUFLOW_Model_Files|TUFLOW SWMM Tutorial M01]]</u>. They have not been duplicated here.<br>
▲<br>
▲===TUFLOW Plugin===
▲Next we need to configure the QGIS TUFLOW Plugin settings to link with the project folder where we will build our model:<br>
▲<ol>
▲<li>Open the 'Configure TUFLOW Project' tool by selecting Plugins > TUFLOW > Editing > Configure / Create TUFLOW Project.
<li>Set the CRS (Coordinate Reference System) by selecting one of the vector layers associated with the opened model using the drop menu list. For example, ''2d_bc_M01_001_L''.
▲<li>To set the location of the TUFLOW folder, click 'Browse...' and navigate to the '''TUFLOW_SWMM_Module_03''' folder. Click 'Select Folder'.
▲<li>To set the location of the TUFLOW single precision executable file, click 'Browse...' and navigate to the '''exe\2023-03-
▲<li>Select 'GPKG' as the GIS Format.
▲<li>Select 'TUFLOW Classic / HPC' as the TUFLOW Engine.
▲<li>Tick on 'Save Default Settings Globally'.
▲<li>Click 'OK'.<br>
▲<br>
[[File: TS3_Configure_Project_01a.png]]<br>
▲</ol>
<br>
Line 56:
<ol>
<li>In the QGIS Layers
<li>Click on the 'Increment Selected Layer' symbol from the TUFLOW Plugin toolbar. This opens the dialog shown below.
<br>
Line 70:
<li>The GeoPackage database, '''TS03_001.gpkg''' will now be in the '''TUFLOW_SWMM_Module_03\TUFLOW\model\gis''' folder.
<br><br>
{{Video|name=
<br>
</ol>
=== Increment SWMM GeoPackage File ===
SWMM pipe network junction attributes need to be updated when converting a TUFLOW 2D direct rainfall / SWMM 1D model <u>([[TUFLOW_SWMM_Tutorial_M02|TUFLOW SWMM Tutorial Module 2]]</u>). into a format that uses SWMM hydrology instead of direct rainfall. Similar to above (incrementing the TUFLOW GeoPackage file), we will increment the SWMM pipe network database name so we do not alter the inputs necessary for '''TS02_5m_001.tcf''' to function without issue.
<ol>
<li> In the QGIS Layers
<li> Select TUFLOW > SWMM - Increment GeoPackage. This opens the dialog shown below.
:*Output File: Click the '...'.
:*Existing GeoPackage Layers: 'Unload -- do not move'.
<li> Select 'OK'.
<li> The tool will automatically load '''sw03_001.gpkg''' into the QGIS workspace and remove '''sw02_001.
<li> In the QGIS Layers
<br><br>
{{Video|name=
<br>
</ol>
Line 104:
<li>Go to TUFLOW >> SWMM in the processing tool list and select '<u>[[QGIS_SWMM_GeoPackage_Add_Sections |GeoPackage - Add sections]]</u>'. This opens the dialog shown below.
:*GPKG filename modify: Click the ... and navigate to the '''TUFLOW_SWMM_Module_03\TUFLOW\model\swmm''' folder. Select '''sw03_001.gpkg'''.
:*CRS for GeoPackage
:*SWMM Sections to add: Click the ..., and tick on:
::*'''Hydrology--Raingages'''
Line 111:
<li>Once the tool is finished, click 'Close'.
<br><br>
{{Video|name=
<br>
</ol>
The above steps have added the new sections to the SWMM GeoPackage database, '''sw03_001.gpkg'''. However, the new sections are not currently displayed in the QGIS Layers
<ol>
<li>In the QGIS Layers
<li>In Windows File Explorer, navigate to the '''TUFLOW\model\swmm''' folder and drag and drop '''sw03_001.gpkg''' into QGIS.
<li>When prompted by QGIS, under 'Options', tick on 'Add layers to group', then select 'Add Layers' to open all vectors within '''sw03_001.gpkg'''. By default, all items in the available list should have been selected.
<li>In the QGIS Layers
<li>In the QGIS Layers
<br><br>
{{Video|name=
<br>
</ol>
Line 137:
<li>In Windows File Explorer, navigate to the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. Drag and drop the '''Urban_Hydrology.gpkg''' into QGIS.
<li>When prompted by QGIS select '''SWMM_Subcatchments'''. Click 'Add Layers'.
<li>In the QGIS Layers
<li>Use the 'Select Features' tool to highlight all items included in '''SWMM_Subcatchments'''.
<li>Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
<li>In the QGIS Layers
<li>Make the '''sw03_001 >> Hydrology--Subcatchments''' layer editable by clicking the 'Toggle Editing' symbol [[File:toggle_editing_icon.png|27x27px]].
<li>Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.
<li>Toggle the editing off to save the edits.
<li>Remove '''
<br><br>
{{Video|name=
<br>
</ol>
Line 154 ⟶ 155:
===Update SWMM Hydrology Raingages===
The text information within '''Hydrology--Raingages''' defines the pluviographs in the catchment. We will link to two different rain gages in this example. <br>
'''Note:''' 'Gage' is the American spelling of 'Gauge' in Oxford English.
<ol>
<li>In the QGIS Layers
<li>Right click '''Hydrology--Raingages''' and select 'Open Attribute Table'.
<li>Click 'Add Feature' twice. Enter the following attributes (leave all other fields as ''NULL''):
Line 173 ⟶ 174:
| RF_G2 || Volume || 0.1 || 1 || TIMESERIES || RF_FC07
|}
For a summary of the attributes associated with '''Hydrology--Raingages''', refer to <u>[https://docs.tuflow.com/classic-hpc/release/2023-03-AD/SWMM-Input-Detailed-1.html#tab:tab-SWMM-Input-Raingages TUFLOW 2023-03-AD Release Notes (Table A.11)]</u> and the <u>[https://downloads.tuflow.com/SWMM/SWMM5_Reference_Manual_Volume1_Hydrology_P100NYRA.pdf SWMM5 Reference Manual - Volume 1 (Hydrology)]</u>.<br>
Note, the spatial locations where the gage information is applied is covered in the following section.
<li> Turn off editing and save the information.
<br><br>
{{Video|name=
<br>
</ol>
Line 183 ⟶ 185:
The information within '''Hydrology--Subcatchments''' defines the subcatchment parameters (including catchment area, width, slope, percent impervious, outlet specification and infiltration details). All required data entries have been pre-filled in the supplied dataset except the 'Area' information, which we will determine using QGIS. SWMM requires the hydrology subcatchment area information in hectares.
<ol>
<li>In the QGIS Layers
<li>Right click '''Hydrology--Subcatchments''' and select 'Open Attribute Table'.
<li>Choose 'Area' as the target field and type the calculation expression, '
:* '
:* '/ 10000': Converts the area values into hectares.<br>
'''Note:''' The projection used in these tutorials is measured in meters. Thus, when QGIS extracts the area from a region, it reports the area in m<sup>2</sup>. If using a projection that is measured in feet, QGIS would extract the area in ft<sup>2</sup>.
Line 192 ⟶ 194:
<li>Turn off editing and save the information.
<li>Inspect the attribute information within '''Hydrology--Subcatchments''' to familiarize yourself with the data. A few demonstration features have been included in the dataset.
:*Two rainfall gages are linked to the subcatchments. Downstream subcatchments
:*Subcatchments 'SPit11A' and '
For a summary of the attributes associated with the layer, refer to <u>[https://docs.tuflow.com/classic-hpc/release/2023-03-AD/SWMM-Input-Detailed-1.html#tab:tab-SWMM-Input-Subcatchments TUFLOW 2023-03-AD Release Notes (Table A.38)]</u> and the <u>[https://downloads.tuflow.com/SWMM/SWMM5_Reference_Manual_Volume1_Hydrology_P100NYRA.pdf SWMM5 Reference Manual - Volume 1 (Hydrology)]</u>.
<br><br>
{{Video|name=
<br>
</ol>
Line 204 ⟶ 206:
:*'''sw01_001.inp''' (road culverts).
:*'''sw03_001.inp''' (underground pipe network inputs and SWMM hydrology).
When TUFLOW processes SWMM inputs, it combines the multiple INP files into one single INP prior to simulation. For this model, the simulation control parameters defined in Module 1 ('''sw01_001
:*'''
:*'''
We need to change the SWMM hydrology timestep details. Updating this setting in the '''sw01_001.inp''' does not impact any of the previous tutorial modules, as they did not include any hydrology components.
<br><br>▼
<ol>
<li>In the QGIS Layers
<li>Right click '''Project--Options''' and select 'Open Attribute Table'.
<li>Update the following hydrology timestep options:
:*WET_STEP: 00:01:00
:*DRY_STEP: 00:01:00
<li>Turn off editing to save the edits.
<br><br>
{{Video|name=
<br>
</ol>
== Export SWMM INP File ==
We will now create a new INP file for the pipe network and SWMM urban hydrology inputs
<ol>
<li>In the QGIS Layers Panel, right click '''Hydrology--Subcatchments''' (or any other SWMM layer in the same GeoPackage) and select 'TUFLOW' > 'SWMM - Export inp file'.
<li>
:*GeoPackage Input File: Navigate to the '''TUFLOW\model\swmm''' folder and select '''sw03_001.gpkg'''.▼
'''Note:''' This tool can also be activated from the Processing Toolbox.
<li>By default, this tool will save the SWMM inp file in the same folder location and with the same name as the GeoPackage input file. In this case, it will save '''sw03_001.inp''' to the '''TUFLOW\model\swmm''' folder. ▼
<li>Click 'Run'.
▲
<li>Click 'Run'.
<li>Once the tool is finished, click 'Close'.
▲<li>
<br><br>
{{Video|name=
<br>
</ol>
Line 270 ⟶ 250:
<li>Tick the 'Regions' Geometry Type.
<li>In the Spatial Database Options, select 'All to one'. Navigate to the '''TUFLOW_SWMM_Module_03\TUFLOW\model\gis''' folder and select '''TS03_001.gpkg'''. Click Save and hit 'OK'.
<li>The '''
<br>
[[File:TS3_import_empty_2d_sa_01a.png]]<br>
Line 276 ⟶ 256:
<li>In Windows File Explorer, navigate to the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. Drag and drop the '''Urban_Hydrology.gpkg''' into QGIS.
<li>When prompted by QGIS, select '''TUFLOW_Subcatchments'''. Click 'Add Layers'.
<li>In the QGIS Layers
<li>Use the 'Select Features' tool to highlight the four regions included in '''TUFLOW_Subcatchments'''.
<li>Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
<li>In the QGIS Layers
<li>Make the '''2d_sa_TS03_001_R''' layer editable by clicking the 'Toggle Editing' symbol [[File:toggle_editing_icon.png|27x27px]].
<li>Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.
Line 287 ⟶ 267:
'''Note:''' Common hydrology software used in combination with TUFLOW by modelers include: HEC-HMS, RORB, Drains, WBNM, URBS and more.''
<br><br>
{{Video|name=
<br>
</ol>
Line 296 ⟶ 276:
<li>Copy '''bc_dbase_TS03_001.csv''' and '''TS03_01p2hr.csv''' from the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder to the '''TUFLOW_SWMM_Module_03\TUFLOW\bc_dbase''' folder.
<br><br>
{{Video|name=
<br>
</ol>
Line 312 ⟶ 292:
===TUFLOW Control File (TCF)===
<ol>
<li>
<font color="blue"><tt>Spatial Database </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>..\model\gis\TS03_001.gpkg</tt></font> <font color="green"><tt> ! Specify the location of the GeoPackage Spatial Database</tt></font><br>
<font color="blue"><tt>BC Control File</tt></font> <font color="red"><tt> == </tt></font> <font color="black"><tt>..\model\TS03_001.tbc</tt></font> <font color="green"><tt> ! Reference the TUFLOW Boundary Condition Control File</tt></font><br>
<font color="blue"><tt>BC Database</tt></font> <font color="red"><tt> == </tt></font> <font color="black"><tt>..\bc_dbase\bc_dbase_TS03_001.csv</tt></font> <font color="green"><tt> ! Reference the Boundary Condition Database</tt></font><br>
<font color="blue"><tt>SWMM Control File</tt></font> <font color="red"><tt> == </tt></font> <font color="black"><tt>..\model\TS03_001.tscf</tt></font> <font color="green"><tt> ! Reference the SWMM (1D) Control File</tt></font><br>
<li> Add the following command to the '<tt><font color="green">Time Control</font></tt>' section. This command is necessary for many TUFLOW-SWMM models, especially when using SWMM hydrology. The 2D timestep dictates the SWMM 1D timestep. Generally, this timestep is adequate for SWMM but in cases where the flows are contained in the 1D, the timestep may become too large for SWMM. This command forces it into the appropriate range. If this command is neglected, some models will experience very high mass errors. The range of timesteps used is reported in the SWMM .rpt file ('''TS03_5m_001_swmm.rpt''') in the '''TUFLOW\results''' folder.<br>
<font color="blue"><tt>Timestep Maximum </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>3</tt></font> <font color="green"><tt> ! Specifies a maximum timestep of 3 seconds</tt></font><br>
<li> Comment out the 'Map Cuttoff Depth' command by placing a '!' at the beginning of the line. This command is only necessary for 2D direct rainfall (rain on grid) modelling (SWMM Tutorial 2).<br>
<font color="green"><tt>! Map Cutoff Depth == 0.05</tt></font><br>
<br>
{{Video|name=
<br>
</ol>
Line 326 ⟶ 308:
===TUFLOW Boundary Control File (TBC)===
<ol>
<li>Edit '''TS03_001.tbc'''.
<li>Comment out the 'Global Rainfall BC' command by placing a '!' at the beginning of the line. This command is only necessary for 2D direct rainfall (rain on grid) modelling (SWMM Tutorial 2).<br>
<font color="green"><tt>! Global Rainfall BC == RF_FC04</tt></font>
Line 333 ⟶ 315:
<font color="blue"><tt>Read GIS SA</tt></font><font color="red"><tt> == </tt></font><font color="black"><tt>2d_sa_TS03_001_R </tt></font><font color="green"><tt>! Reads in 2D source area - Excluding SWMM areas</tt></font><br>
<br>
{{Video|name=
<br>
</ol>
Line 339 ⟶ 321:
===TUFLOW SWMM Control File (TSCF)===
<ol>
<li>
<li>Replace <font color="blue"><tt>Read SWMM</tt></font><font color="red"><tt> == </tt></font><font color="black"><tt>swmm\sw02_001.inp</tt></font> with the following command:<br>
<font color="blue"><tt>Read SWMM</tt></font><font color="red"><tt> == </tt></font><font color="black"><tt>swmm\sw03_001.inp</tt></font><br>
<li>As we are pushing flows from the subcatchments straight to the pipe network, the water level of the ponded water at the nodes can become much higher than the 2D water levels. The inlet will surcharge but the flow is throttled. The following command will pull water out of the 2D if the 1D ponded water level goes beyond 0.1 m higher than the 2D (not needed for rain on grid simulations). Add the following command:<br>
<li>Add the following additional command:<br>▼
<font color="blue"><tt>Maximum Inlet Ponded Depth</tt></font><font color="red"><tt> == </tt></font><font color="black"><tt>0.1 </tt></font><font color="green"><tt>! Pull ponded water out of the 1D domain as needed</tt></font><br>
<font color="blue"><tt>Read BC Timeseries</tt></font><font color="red"><tt> == </tt></font><font color="black"><tt>RF_FC04 | RF_FC07 </tt></font><font color="green"><tt>! TUFLOW BC Database / SWMM Rain Gage Linkage</tt></font><br>
<br>
{{Video|name=
<br>
</ol>
Line 353 ⟶ 337:
<li>Save a copy of '''_run_TS02_HPC.bat''' as '''_run_TS03_HPC.bat''' in the '''TUFLOW_SWMM_Module_03\TUFLOW\runs''' folder.
<li>Update the batch file to reference the '''TS03_5m_001.tcf''' :<br>
<font color="blue"><tt>'''set'''</tt></font> <font color="black"><tt>exe</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>"..\..\..\exe\2023-03-
<font color="blue"><tt>'''set'''</tt></font> <font color="black"><tt>run</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>start "TUFLOW" /wait</tt></font> <font color="orange"><tt> %exe%</tt></font> <font color="black"><tt> -b</tt></font> <br>
<font color="orange"><tt>%run% </tt></font> <font color="black"><tt>TS03_5m_001.tcf </tt></font>
<li>Save the batch file and double click it in Windows File Explorer to run the simulation. <br>
<br><br>
{{Video|name=
</ol>
= Check Files =
Line 382 ⟶ 362:
*The 1D SWMM pipe urban pipe network junction attributes were updated to accomodate for the change in model configuration, from 2D direct rainfall to 1D SWMM hydrology.
*Check and result files associated with the SWMM hydrology modelling were inspected.
*For further training opportunities see <u>[https://tuflow.com/training/training-course-catalogue/ TUFLOW Training Catalogue]</u> and/or contact <u>[mailto:training@tuflow.com training@tuflow.com]</u>.
=Other TUFLOW SWMM Tutorials=
| |||