TUFLOW SWMM Tutorial M01: Difference between revisions
Content deleted Content added
| (33 intermediate revisions by 3 users not shown) | |||
Line 13:
== QGIS ==
QGIS Version 3.34 or newer, and QGIS TUFLOW Plugin 3.
Firstly, define the Coordinate Reference System (CRS), also called ‘Projection’, for the QGIS workspace:
<ol>
Line 25:
<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_01'''. 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>▼
<br>▼
</ol>▼
==TUFLOW Model==
Line 75 ⟶ 59:
*Click 'Apply' and 'OK'.
<br>
{{Video|name=
<li>Create a hillshade of the DEM:
*Right click on the '''DEM''' file in the QGIS Layers Panel and select 'Duplicate Layer'.
Line 85 ⟶ 69:
*Click 'Apply' and 'OK'.
<br>
{{Video|name=
</ol>
▲===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_01''' 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: TS1_Configure_Project_01a.png]]<br>
▲</ol>
▲<br>
=== Increment Model GeoPackage File ===
Line 106:
<li>The GeoPackage database, '''TS01_001.gpkg''' will now be in the '''TUFLOW_SWMM_Module_01\TUFLOW\model\gis''' folder. <br>
<br>
{{Video|name=
<br>
</ol>
Line 112:
===Save QGIS Project Workspace===
<ol>
<li>Go to Project
<li>Navigate to the '''TUFLOW_SWMM_Module_01''' folder and type '''SWMM_M01''' as the filename with the extension .qgz.
</ol>
Line 124:
<ol>
<li>Go to Processing > Toolbox from the top dropdown menu options to open the Processing Toolbox.
<li>Go to TUFLOW >> SWMM in the processing tool list and select '<u>[[QGIS_SWMM_GeoPackage_Create |GeoPackage - Create]]</u>'. This opens the dialog shown below.
:*To set the ‘CRS for GeoPackage’: Click the drop down menu and select ‘Project CRS: EPSG:32760 - WGS 84 / UTM zone 60S’.
:*To set the ‘Initial SWMM Sections’: Click …, and tick on (if not already ticked):
:
:
:
:*To define the ‘GPKG filename to create’: Click …, select ‘Save to File’. Navigate to the '''TUFLOW\model\swmm''' folder and save the GeoPackage database as '''sw01_001.gpkg'''.
Line 135:
<li>Click ‘Run’.
<li>Once the tool has finished, click ‘Close’.
<li>In Windows File Explorer, navigate to the '''TUFLOW\model\swmm''' folder and drag and drop '''sw01_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 '''sw01_001.gpkg'''. By default, all items in the available list should have been selected.
<li>In the QGIS Layers Panel, move '''sw01_001.gpkg''' to the top of the list. This will ensure the data within this database file is displayed above all other layers in the project.
</ol>
<br>
{{Video|name=
<br>
<br>
Line 148:
A GeoPackage database called '''SWMM_Culverts.gpkg''' is provided in the '''TUFLOW_SWMM_Module_01\Tutorial_Data''' folder. It contains three layers:
:*'''Conduits:''' defines the culvert location, type and geometry.
:*'''Junctions:''' defines the upstream culvert inverts.▼
:*'''Outfalls:''' defines the downstream culvert inverts.
<br>
To populate the GeoPackage database created in the previous section:
<ol>
<li>In Windows File Explorer, navigate to the '''TUFLOW_SWMM_Module_01\Tutorial_Data''' folder. Drag and drop the '''SWMM_Culverts.gpkg''' into QGIS.
<li>When prompted by QGIS, under 'Options', tick on 'Add layers to group'. By default, all items in the GeoPackage database will be selected. Click 'Add Layers'.
<li>In the QGIS Layers Panel, right click on the '''SWMM_Culverts
<li>Use the 'Select Features' tool to highlight all items included in '''Conduits'''.
<li>Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
<li>In the QGIS Layers Panel, select (left click) the '''sw01_001.gpkg
<li>Make the '''Links--Conduits''' 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.<br>
<br>
{{Video|name=
<br>
<li>Similarly, copy the objects from '''
<li>Also copy the objects from '''Outfalls''' into '''Nodes--Outfalls'''. Outfalls are treated as outlets, and are required at the downstream end of culverts.
<li> Toggle off editing and save the edits.
<li>Remove '''SWMM_Culverts.gpkg'''.
<br><br>
{{Video|name=
<br>
<li>Inspect the attribute information within the respective layers to familiarize yourself with the data.
<br><br>
{{Video|name=
</ol>
<br>
Line 182:
===Update Conduit Details===
==== Node Details ====
The information we will be adding to '''Links--Conduits''' is extracted from '''Nodes--Storage''' and '''Nodes--Outfalls''' automatically using the '<u>[[QGIS_SWMM_Conduits_Assign_Node_Fields |Conduits - Assign node fields]]</u>' tool from the Processing Toolbox.
<ol>
<li>In the QGIS Layers Panel, select (left click) '''Links--Conduits''' and toggle on editing.
<li>In the Processing Toolbox, select the 'Edit Features In-Place' tool [[File:edit_features_in_place_icon.png]]. This allows the editing of an existing layer, instead of the creation of a new layer.
<li>Go to TUFLOW >> SWMM in the processing tool list and select '<u>[[QGIS_SWMM_Conduits_Assign_Node_Fields |Conduits - Assign node fields]]</u>'. This opens the dialog shown below.
<li>Select 'Modify All Features'.
<li>Once the tool has finished, click 'Close'.
<li>Turn off editing to save the edits.
<li>View the attributes associated within '''Links--Conduits''' to verify the data processing has been completed correctly. The 'From Node' and 'To Node' attribute information is now configured correctly. For a broader understanding of the other attributes associated with the '''Links
<br>
'''
'''
<br><br>
{{Video|name=
<br>
Line 203 ⟶ 204:
====Update Losses====
▲Step 2, update the loss attributes in the '''Links--Conduits''' layer. These values will be entered manually in this example using default values. Variation to the default values can be used in project models to reflect site specific information if desired.
<ol>
<li>In the QGIS Layers Panel, select (left click) '''Links--Conduits''' and toggle on editing.
<li>Right click '''Links--Conduits''' and select 'Open Attribute Table'.
<li>
:*losses_Kentry: 0.5
:*losses_Kexit: 1.0
Line 215:
<li>Turn off editing to save the edits.
<br><br>
{{Video|name=
</ol>
<br>
<br>
<br>
Line 226 ⟶ 227:
<ol>
<li>In the QGIS Layers Panel, select (left click) '''Links--Conduits'''.
<li>In the Processing Toolbox, go to TUFLOW >> SWMM and select '<u>[[QGIS_SWMM_BC_Create_Channel_Endpoint_1D/2D_Connections |BC - Create channel endpoint 1D/2D connections]]</u>'. This opens the dialog shown below. <br>
'''Note:''' Ensure the 'Edit Features In-Place' tool has been turned off.
:*Input Conduits Layer: '''Links--Conduits'''
:*Create connections at: 'Both ends'.
Line 243 ⟶ 245:
<li>The '''2d_bc_SWMM_Culvert_Connections_001_L''' appears in the QGIS Layers Panel. Select 'Apply TUFLOW Styles to Current Layer'.
<br><br>
{{Video|name=
</ol>
<br>
Line 250 ⟶ 252:
<br>
===Update
The attributes of the storage nodes need to be modified to represent the storage of the connected HX cells since these cells do not represent storage themselves. The area associated with the storage nodes should be similar to the areas of the HX cells. To set the area, we will use a "PYRAMIDAL" shape with the SWMM side slope (run/rise) (Z) set to 0 to represent vertical walls. As the cell size is 5m, and the length of each polyline is 10m, the length (L) will be set to 10m and the width (W) to 5m. These sizes will be modified later when we change the boundary conditions.
<ol>
<li> In the QGIS Layers Panel, select (left click) '''Nodes--
<li> Right click '''Nodes--Storage''' and select 'Open Attribute Table'.
<li> Set the following attributes:
:* YMax: 50.0 (this is a value greater than the expected water level. It is required to allow water to fill node)
:* TYPE: 'PYRAMIDAL'
:* L: 10
:* W: 5
:* Z: 0.0
<li>
<br><br>
{{Video|name=
<br>
</ol>
Line 280 ⟶ 281:
</ol>
{{Video|name=
<br>Save the QGIS Project Workspace:
# Go to Project > Save. This will update '''SWMM_M01.qgz''', which
== Export SWMM INP File ==
Line 289 ⟶ 290:
<ol>
<li>In the
<li>This will open the '<u>[[QGIS_SWMM_GeoPackage_Write_to_SWMM_inp |GeoPackage - Write to SWMM inp]]</u>' processing tool, prepopulated with the filename of the layer's GeoPackage. <br>
'''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 '''sw01_001.inp''' to the '''TUFLOW\model\swmm''' folder.▼
<li>Click 'Run'.
<li>Once the tool is finished, click 'Close'.
▲<li>
<br><br>
{{Video|name=
</ol><br>
Line 302 ⟶ 303:
The following steps will require use of a text editor. The tutorial demonstration uses Notepad++. For its configuration information refer to <u>[[NotepadPlusPlus_Tips | Notepad++ Tips]]</u>. <br>
To differentiate the TUFLOW SWMM tutorials from the TUFLOW/ESTRY tutorials, 'TS'
Set up the simulation control files:
<ol>
<li>
<li>
<li>Open '''M01_001.tbc''' using the 'Open File' function in Notepad++. Save the file as '''TS01_001.tbc''' in the '''TUFLOW_SWMM_Module_01\TUFLOW\model''' folder.
<li>Create a new blank text file called '''TS01_001.tscf''' and save it in the '''TUFLOW_SWMM_Module_01\TUFLOW\model''' folder.
<br><br>
Line 315 ⟶ 317:
=== TUFLOW Control File (TCF) ===
<ol>
<li>Open '''TS01_5m_001.tcf'''
<font color="blue"><tt>Spatial Database </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt> ..\model\gis\TS01_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\TS01_001.tbc</tt></font> <font color="green"><tt> ! Reference the TUFLOW Boundary Conditions Control File</tt></font>
Line 338 ⟶ 340:
=== TUFLOW SWMM Control File (TSCF) ===
A new control file, the TUFLOW SWMM Control File (TSCF), is used to control the SWMM input data
<ol>
<li>From '''TS01_001.tcf''', right click '''TS01_001.tscf''' and select 'Open File'. This opens '''TS01_001.tscf''' into a new tab in Notepad ++.
Line 353 ⟶ 355:
<li>Save a copy of '''_run_M02_HPC.bat''' as '''_run_TS01_HPC.bat''' in the '''TUFLOW_SWMM_Module_01\TUFLOW\runs''' folder.
<li>Update the batch file to reference the '''TS01_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>TS01_5m_001.tcf </tt></font>
Line 359 ⟶ 361:
<li>Save the batch file and double click it in Windows File Explorer to run the simulation.
<br>
If the model simulation doesn't run
<ol>
<li> Check in the screen output or the tlf file near the end for "For SWMM Model Errors see:". This indicates that there is something wrong with the SWMM inputs. Reviewing that file will provide feedback on what is wrong.
</ol>
<br><br>
{{Video|name=
</ol>
▲Did your TUFLOW SWMM model fail to run successfully? If so, here is a link to a troubleshooting guide: <u>[[TUFLOW_SWMM_Troubleshooting | TUFLOW SWMM Troubleshooting]]</u>.<br>
= Check Files and Results Output=
Complete the steps outlined in following links to review check files and simulation results from the TUFLOW SWMM model simulation:
<u>[[TUFLOW_SWMM_Tutorial_M01_Results_QGIS | TUFLOW SWMM Tutorial 01 Results]]</u><br>▼
<u>[[TUFLOW_SWMM_Tutorial_M01_Check_QGIS | TUFLOW SWMM Tutorial 01 Check Files]]</u> <br>
▲<u>[[TUFLOW_SWMM_Tutorial_M01_Results_QGIS | TUFLOW SWMM Tutorial 01 Results]]</u><br>
= Conclusion =
Line 376 ⟶ 380:
*Check files were used to review the inclusion of 1D SWMM culverts to a 2D TUFLOW model.
*Results through the 1D culverts were assessed.
*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>.
<br>
Line 383 ⟶ 388:
*<u>[[TUFLOW_SWMM_Tutorial_M03 | TUFLOW SWMM Module 3]]</u> - 1D SWMM Pipe Network / 1D SWMM Urban Hydrology
*<u>[[TUFLOW_SWMM_Tutorial_M04 | TUFLOW SWMM Module 4]]</u> - 1D SWMM Pipe Network / 1D SWMM Urban Hydrology: Executing multiple different event simulations from a single model control file.
*<u>[[XPSWMM_to_TUFLOW-SWMM | XPSWMM to TUFLOW SWMM]]</u> - How to convert an XPSWMM model to TUFLOW SWMM.<br>
<br>
{{Tips Navigation
| |||