Difference between revisions of "TUFLOW SWMM Tutorial M03"

From Tuflow
Jump to navigation Jump to search
(158 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
= Introduction =
 
= Introduction =
This tutorial, Module 3 of the TUFLOW SWMM tutorial dataset, demonstrates how to add SWMM urban hydrology to a 1D / 2D SWMM stormwater pipe network / 2D TUFLOW HPC catchment model. TUFLOW SWMM Tutorial Module 3 builds from the model created in <u>[[TUFLOW_SWMM_Tutorial_M02|TUFLOW SWMM Tutorial Module 2]]</u>. The completed TUFLOW SWMM Module 2 model is provided in the '''''TUFLOW_SWMM_Module_03\TUFLOW''''' folder of the download dataset as the starting point for this tutorial. If you are not already familiar with TUFLOW SWMM linking, we recommend first completing Module 1 and 2 before this tutorial. <br>
+
This tutorial, Module 3 of the TUFLOW-SWMM tutorial dataset, demonstrates how to add SWMM urban hydrology to a 1D SWMM stormwater pipe network / 2D TUFLOW HPC catchment model. TUFLOW-SWMM Tutorial Module 3 builds from the model created in <u>[[TUFLOW_SWMM_Tutorial_M02|TUFLOW SWMM Tutorial Module 2]]</u>. The completed TUFLOW-SWMM Module 2 model is provided in the '''''TUFLOW_SWMM_Module_03\TUFLOW''''' folder of the download dataset as the starting point for this tutorial. If you are not already familiar with TUFLOW-SWMM linking, we recommend completing TUFLOW-SWMM Modules 1 and 2 prior to starting this tutorial. <br>
  
 
= Project Initialization =
 
= Project Initialization =
 
==QGIS==
 
==QGIS==
QGIS Version 3.34 or newer, and QGIS TUFLOW Plugin 3.9.0.49 or newer are required to access the SWMM Processing Tools described in the following sections. For installation, see <u>[https://wiki.tuflow.com/index.php?title=TUFLOW_QGIS_Plugin#Installation_of_Plugin Installation of TUFLOW Plugin]</u>.<br>
+
QGIS Version 3.34 or newer, and QGIS TUFLOW Plugin 3.11 or newer are required to access the SWMM Processing Tools described in the following sections. For installation, see <u>[https://wiki.tuflow.com/TUFLOW_QGIS_Plugin Installation of TUFLOW Plugin]</u>.<br>
 
Define the Coordinate Reference System (CRS), also called ‘Projection’, for the QGIS workspace:
 
Define the Coordinate Reference System (CRS), also called ‘Projection’, for the QGIS workspace:
 
<ol>  
 
<ol>  
Line 16: Line 16:
 
<br>
 
<br>
 
{{Video|name=Animation_TS1_Initialization_01a.mp4|width=1235}}<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>Go to Plugins > TUFLOW > Editing > Configure / Create TUFLOW Project.
 
<li>Change the folder which contains TUFLOW to the '''TUFLOW_SWMM_Module_03''' folder.
 
<li> Set the GIS Format to '''GPKG'''.
 
<li>Click 'OK' and save the workspace by selecting Project > Save As.<br>
 
<br>
 
'''<<image>>'''<br>
 
</ol>
 
<br>
 
  
 
==TUFLOW Model==
 
==TUFLOW Model==
Line 37: Line 25:
 
[[File: Tuflow_plugin_load_tcf_layers.png]]<br>
 
[[File: Tuflow_plugin_load_tcf_layers.png]]<br>
 
<br>
 
<br>
<li>In File Explorer, navigate to the '''TUFLOW_SWMM_Module_03\TUFLOW\runs''' folder and select '''TS02_5m_001.tcf'''.
+
<li>Navigate to the '''TUFLOW_SWMM_Module_03\TUFLOW\runs''' folder and select '''TS02_5m_001.tcf'''.
 
<li>In the Load Layers window, select:
 
<li>In the Load Layers window, select:
 
* Ordering Options: Alphabetical
 
* Ordering Options: Alphabetical
Line 45: Line 33:
 
</ol>
 
</ol>
 
<br>
 
<br>
Style the TUFLOW layers. Suggested styling steps were provided in <u>[[TUFLOW_SWMM_Tutorial_M01#QGIS_Project_Initialization|TUFLOW SWMM Tutorial M01]]</u>. They have not been duplicated here.<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>
 
<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-AF''' 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>
 +
[[File: TS3_Configure_Project_01a.png]]<br>
 +
</ol>
 +
<br>
 +
 
=== Increment TUFLOW GeoPackage File ===  
 
=== Increment TUFLOW GeoPackage File ===  
Save a copy of TS02_001.gpkg with a new name (TS03_001.gpkg). This project initialization step is recommended so prior model versions from a project are not broken as a result of changes being made to GIS inputs.
+
We will now save a copy of '''TS02_001.gpkg''' with a new name, '''TS03_001.gpkg'''. This project initialization step is recommended so prior model versions from a project are not broken as a result of changes being made to GIS inputs.
  
 
<ol>
 
<ol>
 
<li>In the QGIS Layers Panel, select (left click) '''2d_bc_M01_001_L'''.
 
<li>In the QGIS Layers Panel, select (left click) '''2d_bc_M01_001_L'''.
<li>Click on the '''Increment Selected Layer''' symbol from the TUFLOW Plugin toolbar. This opens the dialog shown below.  
+
<li>Click on the 'Increment Selected Layer' symbol from the TUFLOW Plugin toolbar. This opens the dialog shown below.  
 
<br>
 
<br>
 
[[File:tuflow_plugin_increment_layer.png]]<br>
 
[[File:tuflow_plugin_increment_layer.png]]<br>
 
<br>
 
<br>
 
:*Source Layer: Automatically set to the selected layer, '''2d_bc_M01_001_L'''.
 
:*Source Layer: Automatically set to the selected layer, '''2d_bc_M01_001_L'''.
:*Output Database: Click 'Browse...'. This will automatically open to the '''TUFLOW\model\gis''' folder. Set the new output database name to '''TS02_001.gpkg''' and click 'Save'.
+
:*Output Database: Click 'Browse...'. This will automatically open to the '''TUFLOW\model\gis''' folder. Set the new output database name to '''TS03_001.gpkg''' and click 'Save'.
:*Output Layer Name: This was automatically incremented to, '''2d_bc_M01_002_L'''. Change the value to '''2d_bc_M01_001_L'''.
+
:*Output Layer Name: This will automatically increment to '''2d_bc_M01_00''2''_L'''. Change the name back to '''2d_bc_M01_00''1''_L'''.
 
:*Delete the pre-filled 'Incremented Layer' entry in the table. We do not wish to modify the version number associated with the 2d_bc file. This current exercise will not change the version number of any of the GIS layer inputs, it is simply establishing a copy of the existing GeoPackage where future edits will be saved to.
 
:*Delete the pre-filled 'Incremented Layer' entry in the table. We do not wish to modify the version number associated with the 2d_bc file. This current exercise will not change the version number of any of the GIS layer inputs, it is simply establishing a copy of the existing GeoPackage where future edits will be saved to.
 
:*Select 'Remove Source Layer from Workspace'.
 
:*Select 'Remove Source Layer from Workspace'.
 
:*Select 'Increment Layer and Preserve Database'.
 
:*Select 'Increment Layer and Preserve Database'.
<li>Click 'OK'.<br>
+
<li>Click 'OK'.
 +
<li>The GeoPackage database, '''TS03_001.gpkg''' will now be in the '''TUFLOW_SWMM_Module_03\TUFLOW\model\gis''' folder.
 +
<br><br>
 +
{{Video|name=Animation_TS3_Initialization_02b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
'''<<video>>'''<br>
 
  
 
=== Increment SWMM GeoPackage File ===  
 
=== Increment SWMM GeoPackage File ===  
SWMM pipe network junction attributes need to be updated when converting a TUFLOW 2D direct rainfall / SWMM 1D model (Module 2) into a format that uses SWMM hydrology instead of direct rainfall. Similar to the versioning of the TUFLOW Geopackage File, we will increment the SWMM pipe network database name so we do not alter the inputs necessary for TS03_5m_001.tcf to function without issue.
+
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>
 
<ol>
<li> Left click '''sw02_001''' in the QGIS Layers panel.
+
<li> In the QGIS Layers Panel, open the '''TS02_001.tscf''' group. In the '''sw02_001.inp''' group, right click '''Links--Conduits'''.
<li> <font color="red">'''Waiting for Rusty's SWMM Increment Selected Layer tool.'''</font>
+
<li> Select TUFLOW > SWMM - Increment GeoPackage. This opens the dialog shown below.
<li> Set the new Database name to '''sw03_001.gpkg'''
+
:*Output File: Click the '...'. This will automatically open to the '''TUFLOW\model\swmm''' folder. Set the output database name to '''sw03_001.gpkg''' and click 'Save'.
<li> Select '''OK'''.
+
:*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.inp''' from the QGIS workspace.
 +
<li> In the QGIS Layers Panel, move '''sw03_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.  
 +
<br><br>
 +
{{Video|name=Animation_TS3_Initialization_03b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
'''<<image>>'''<br>
 
  
 
===Save QGIS Project Workspace===
 
===Save QGIS Project Workspace===
Save the QGIS Workspace:
 
 
<ol>
 
<ol>
 
<li>Go to Project > Save As.
 
<li>Go to Project > Save As.
Line 85: Line 96:
 
<br>
 
<br>
  
= SWMM Inputs =
+
= GIS Inputs =
 
==Update SWMM GeoPackage Spatial Database==  
 
==Update SWMM GeoPackage Spatial Database==  
In previous tutorials we have created new SWMM GeoPackage databases for our new entries. This tutorial will demonstrate a different update approach. Instead of creating a new SWMM GeoPackage database, we will update an existing database (sw03_001) by adding new SWMM Sections for the hydrology elements we will be incorporating into the model in this tutorial.
+
In previous tutorials we have created new SWMM GeoPackage databases for our new entries. This tutorial will demonstrate a different update approach. Instead of creating a new SWMM GeoPackage database, we will update the existing database, '''sw03_001.gpkg''' by adding new SWMM Sections for the hydrology elements we will be incorporating into the model in this tutorial.
  
 
<ol>
 
<ol>
<li>Go to '''Processing > Toolbox''' from the top dropdown menu options to open the Processing Toolbox Panel.
+
<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 'GeoPackage - Add Sections'.  
+
<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.
<li>Select the following:
+
:*GPKG filename modify: Click the ... and navigate to the '''TUFLOW_SWMM_Module_03\TUFLOW\model\swmm''' folder. Select '''sw03_001.gpkg'''.
: GPKG filename modify: '''TUFLOW_SWMM_Module_03\TUFLOW\model\swmm\sw03_001.gpkg'''
+
:*CRS for GeoPackage: Click the drop down menu and select 'Project CRS: EPSG:32760 - WGS 84 / UTM zone 60S'.
: CRS for GeoPackage: '''Project CRS: EPSG:32760 - WGS 84 / UTM zone 60S'''.
+
:*SWMM Sections to add: Click the ..., and tick on:
: SWMM Sections to add: '''Hydrology--Raingages''', '''Hydrology--Subcatchments'''
+
::*'''Hydrology--Raingages'''
 +
::*'''Hydrology--Subcatchments'''
 
<li>Click 'Run'.
 
<li>Click 'Run'.
 +
<li>Once the tool is finished, click 'Close'.
 +
<br><br>
 +
{{Video|name=Animation_TS3_SWMM_Inputs_01b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
'''<video>'''
 
  
The above steps have added the new Sections to the SWMM GeoPackage database. The new additonal sections however are not currently displayed in the QGIS layers panel. We need to close the database and reopen it to view the change.
+
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 Panel. We need to close the database and reopen it to view the changes.
 
<ol>
 
<ol>
<li> Right click '''sw03_001''' in the QGIS layer panel and select '''Remove Group...'''.
+
<li>In the QGIS Layers Panel, right click '''sw03_001''' and select 'Remove Group...'.
<li> In File Explorer, navigate to the '''TUFLOW\model\swmm''' folder and drag and drop '''sw03_001.gpkg''' into QGIS.  
+
<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>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 panel, move '''sw03_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 when we are making edits.  
+
<li>In the QGIS Layers Panel, move '''sw03_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 when we are making edits.  
 +
<li>In the QGIS Layers Panel, within the '''sw03_001''' group, move '''Hydrology--Subcatchments''' to the bottom. This will ensure that the other data within this database can be seen.
 +
<br><br>
 +
{{Video|name=Animation_TS3_SWMM_Inputs_02b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
'''<<Video>>'''
 
<br>
 
  
 
== SWMM GIS Data Entry ==
 
== SWMM GIS Data Entry ==
  
A GeoPackage called '''Urban_Hydrology.gpkg''' is provided in the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. It contains one SWMM input layer:  
+
A GeoPackage called '''Urban_Hydrology.gpkg''' is provided in the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. It contains one SWMM input layer and one TUFLOW input layer:  
:*'''SWMM_Subcatchments''': defining the 1D SWMM urban hydrology subcatchment delineation and associated parameters.
+
:*'''SWMM_Subcatchments''': defines the 1D SWMM urban hydrology subcatchment delineation and associated parameters.
It also contains a TUFLOW input layer
+
:*'''TUFLOW_Subcatchments''': defines the remaining 2D TUFLOW catchment hydrology subcatchment delineation.<br>
:*'''TUFLOW_Subcatchments''': defining the remaining 2D TUFLOW catchment hydrology subcatchment delineation.<br>
 
  
===SWMM===
 
 
To populate the SWMM GeoPackage created in the previous section:
 
To populate the SWMM GeoPackage created in the previous section:
 
<ol>
 
<ol>
<li>In Windows Explorer, navigate to the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. Drag and drop the '''Urban_Hydrology.gpkg''' into QGIS.  
+
<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>When prompted by QGIS select '''SWMM_Subcatchments'''. Click 'Add Layers'.
<li>In the QGIS Layers panel, right click on the '''SWMM_Subcatchments''' layer and select 'Zoom to Layer'.
+
<li>In the QGIS Layers Panel, right click on the '''SWMM_Subcatchments''' layer and select 'Zoom to Layer(s)'.
 
<li>Use the 'Select Features' tool to highlight all items included in '''SWMM_Subcatchments'''.
 
<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>Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.  
<li>Select the '''sw03_001 > Hydrology--Subcatchments''' layer in the Layers panel by left clicking on it once.  
+
<li>In the QGIS Layers Panel, select (left click) the '''sw03_001 >> Hydrology--Subcatchments''' layer.  
<li>Make the '''sw03_001 > Hydrology--Subcatchments''' layer editable by clicking the 'Toggle Editing' symbol [[File:toggle_editing_icon.png|27x27px]].
+
<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>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>Toggle the editing off to save the edits.
<li>Remove '''Urban_Hydrology.gpkg''' from QGIS.
+
<li>Remove '''Urban_Hydrology''' from the QGIS Layers Panel.
 
<br><br>
 
<br><br>
'''<<Video>>'''<br>
+
{{Video|name=Animation_TS3_SWMM_Inputs_03b.mp4|width=1236}}
 
<br>
 
<br>
 +
 
</ol>
 
</ol>
  
 
==SWMM GIS Data Updates==
 
==SWMM GIS Data Updates==
The following updates shall be made to '''sw03_001.gpkg'''.  
+
The following updates are being made to the objects and layers within '''sw03_001.gpkg'''.  
  
===Update SWMM Hydrology--Raingage===
+
===Update SWMM Hydrology Raingages===
The information within '''Hydrology--Raingage''' (Note: 'Gage' is the American spelling of 'Gauge' in Oxford English) defines the pluviographs in the catchment. We will link to two different rain gages in this example.  
+
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>
 
<ol>
<li> In the QGIS Layers panel, select (left click) Hydrology--Raingage and toggle on editing.
+
<li>In the QGIS Layers Panel, select (left click) '''Hydrology--Raingages''' and toggle on editing.
<li> Right click Hydrology--Raingage and select 'Open Attribute Table'.
+
<li>Right click '''Hydrology--Raingages''' and select 'Open Attribute Table'.
<li> Click 'Add Feature'. Enter the following attributes (leave all other fields as NULL):
+
<li>Click 'Add Feature' twice. Enter the following attributes (leave all other fields as ''NULL''):
 
{| class="wikitable" width="60%"
 
{| class="wikitable" width="60%"
 
!style="background-color:#005581; font-weight:bold; color:white;"| Name  
 
!style="background-color:#005581; font-weight:bold; color:white;"| Name  
Line 153: Line 170:
 
!style="background-color:#005581; font-weight:bold; color:white;"| Tseries  
 
!style="background-color:#005581; font-weight:bold; color:white;"| Tseries  
 
|-
 
|-
| RF_G1 || Volume || 0.15 || 1 || TIMESERIES || RF_FC04  
+
| RF_G1 || Volume || 0.1 || 1 || TIMESERIES || RF_FC04  
 
|-
 
|-
| RF_G2 || Volume || 0.15 || 1 || TIMESERIES || RF_FC07  
+
| RF_G2 || Volume || 0.1 || 1 || TIMESERIES || RF_FC07  
 
|}
 
|}
Remaining attributes remain blank.<br>
+
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>
SWMM entries are case sensitive. If the input above uses upper case, please double check your data entry does too.  
+
Note, the spatial locations where the gage information is applied is covered in the following section.
 
<li> Turn off editing and save the information.
 
<li> Turn off editing and save the information.
 +
<br><br>
 +
{{Video|name=Animation_TS3_SWMM_Inputs_04b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
 
For a summary of the attributes associated with '''Hydrology--Raingage''', 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>.
 
  
 
===Update SWMM Hydrology Subcatchments===
 
===Update SWMM Hydrology Subcatchments===
The information within '''Hydrology--Subcatchments''' defines the subcatchment parameters (including catchment area, width, slope, percent impervious, outlet specification and infiltration details).  
+
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>
 
<ol>
<li> All required data entries have been pre-filled in the supplied dataset except the Area information. SWMM requires the hydrology subcatchment area information in hectares. In the QGIS Layers panel, select (left click) Hydrology--Subcatchments and toggle on editing.
+
<li>In the QGIS Layers Panel, select (left click) '''Hydrology--Subcatchments''' and toggle on editing.
<li> Right click Hydrology--Subcatchments and select 'Open Attribute Table'.
+
<li>Right click '''Hydrology--Subcatchments''' and select 'Open Attribute Table'.
<li> Choose '''Area''' as the target field.
+
<li>Choose 'Area' as the target field and type the calculation expression, 'area($geometry) / 10000'.
<li> Type the calculation expression: '''$area / 10000'''.
+
:* 'area($geometry) ': Extracts the area of each region (subcatchment) in '''Hydrology--Subcatchments'''.
<li> Click, '''Update All'''.
+
:* '/ 10000': Converts the area values into hectares.<br>
<li> Turn off editing and save the information.
+
'''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>.
<li> Before moving on to the next step, inspect the attribute information within '''Hydrology--Subcatchments''' to familiarize yourself with the data. 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>. A few demonstration features have been included in the dataset.
+
<li>Click 'Update All'.
* Two rainfall gages are linked to the subcatchments. Downstream subcatchments linked to rain gage RF_G1. Upstream subcatchments are linked to rain gage RF_G2.
+
<li>Turn off editing and save the information.
* Subcatchment SPit11A and SPit11A are being routed to subcatchment SPit11C before entering the SWMM pipe network. All other hydrology subcatchments route directly to a SWMM Node--Junctions.
+
<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 linked to rain gage 'RF_G1'. Upstream subcatchments are linked to rain gage 'RF_G2'.
 +
:*Subcatchments 'SPit11A' and 'SPit11A' are being routed to subcatchment 'SPit11C' before entering the SWMM pipe network. All other hydrology subcatchments route directly to a SWMM '''Node--Junctions'''.<br>
 +
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>
 
<br><br>
'''<<Video>>'''<br>
+
{{Video|name=Animation_TS3_SWMM_Inputs_05b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
  
===SWMM Project--Options===
+
===SWMM Options===
SWMM '''Project--Options''' define the SWMM simulation controls, such as hydrology computation timestep. Project--Options are not required in the new geopackage database we are creating for this Tutorial. This is because this model will be constructed from multiple SWMM input (INP) files:
+
SWMM '''Project--Options''' defines the SWMM simulation controls, such as hydrology computation timestep. '''Project--Options''' are not required in the new GeoPackage database we are creating for this Tutorial. This is because this model will be constructed from multiple SWMM input (INP) files:
*The SWMM INP file sw01_001(road culverts).
+
:*'''sw01_001.inp''' (road culverts).
*The SWMM INP file sw03_001 (underground pipe network inputs and SWMM hydrology).
+
:*'''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) '''Project--Options''' will apply. Options relevant to this tutorial that have already been defined in the Module 1 input include:
+
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 > Project--Options''') will apply. The options relevant to this tutorial that have already been defined in the Module 1 input include:
* '''flow_units''': set to metric.
+
:*'''flow_units''': set to metric.
* '''infiltration''' method: set to Green Ampt.
+
:*'''infiltration''' method: set to Green Ampt.
* '''wetstep''' hydrology timestep: set to 1 minute.
+
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.  
* '''dry step''' hydrology timestep: set to 1 minute.
 
''Note: If we wanted to change the Project--Options as a result of this modules additional data, Project--Options should have been included as a item in the earlier <u>[[TUFLOW_SWMM_Tutorial_M03#Update_SWMM_GeoPackage_Spatial_Database | SWMM Geopackage Update]]</u> step, or SWMM Geopackage Create step if using the model development workflow demonstrated in the previous tutorials. If the SWMM INP file reference is specified lower in the TCSF control file, the information contained in the file supersedes any duplicate information defined by INP files higher in the TCSF control file .''
 
 
 
===Update SWMM Nodes--Junctions===
 
When coupling SWMM hydrology with a 1D pipe network, updated Nodes--Junction attribute details are needed if converting from 2D direct rainfall (rain-on-grid) model design. Now the SWMM hydrology inputs are complete, we will make the necessary changes to Nodes--Junctions in '''sw03_001.gpkg'''.<br>
 
 
 
 
 
 
<ol>
 
<ol>
<li>In the QGIS Layers panel, select (left click) '''Nodes--Junctions''' and toggle on editing.
+
<li>In the QGIS Layers Panel, open the '''TS02_001.tscf''' group and select (left click) '''sw01_001 >> Project--Options''' and toggle on editing.  
<li>In the Processing Toolbox, select the 'Edit Features In-Place' tool. This allows the editing of an existing layer, instead of the creation of a new layer.
+
<li>Right click '''Project--Options''' and select 'Open Attribute Table'.
<li>Go to TUFLOW > SWMM in the processing tool list and select '<u>[[QGIS_SWMM_Junctions_Set_Attributes |Junctions - Set attributes ]]</u>' processing tool. This opens the dialog shown below.
+
<li>Update the following hydrology timestep options:  
:*Input Subcatchments: '''Hydrology--Subcatchments'''
+
:*WET_STEP: 00:01:00
:*Input Inlet Usage Layers: '''swmm_iu_TS02_001'''
+
:*DRY_STEP: 00:01:00
:*Input BC Connection Layers: '''2d_bc_SWMM_Pipe_Network_Connections_001_L'''
 
:*Maximum Depth Option: Set to 0.0
 
:*Nodes recieving subcatchment flows (if connected to 2D): Set Apond = 0.0; Ksur = 0.0 (overwrites options below)
 
:*Nodes connected to 2D with Inlets (Maximum depth) = Use global option
 
:*Nodes connected to 2D with Inlets (Ysur): 0
 
:*Nodes connected to 2D with Inlets (Area of ponding): 25
 
:*Nodes connected to 2D without Inlets (Ysur): 0
 
:*Nodes connected to 2D without Inlets (Area of ponding): 50
 
:*Nodes without 2D Connection (Surcharge Depth): 50
 
:*Nodes without 2D Connection (Area of ponding): 1
 
 
 
 
 
<li>Select 'Modify All Features'.
 
<li>Once the tool has finished, click 'Close'.
 
 
<li>Turn off editing to save the edits.
 
<li>Turn off editing to save the edits.
<li>View the attributes associated within '''Nodes--Junctions''' to verify the data processing has been completed correctly. For a summary of the attributes associated with the '''Inlets--Inlets''' layer, refer to <u>[https://docs.tuflow.com/classic-hpc/release/2023-03-AD/SWMM-Input-Detailed-1.html#tab:tab-SWMM-Input-Junctions TUFLOW 2023-03-AD Release Notes (Table A.30)]</u> and the <u>[https://downloads.tuflow.com/SWMM/SWMM5_Reference_Manual_Volume2_Hydaulics_P100S9AS.pdf SWMM Reference Manual - Volume 2 (Hydraulics)]</u>.
+
<br><br>
 +
{{Video|name=Animation_TS3_SWMM_Inputs_06b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
  
 
== Export SWMM INP File ==
 
== Export SWMM INP File ==
We will now export SWMM INP files with the pipe network and SWMM urban hydrology inputs.  
+
We will now create a new INP file for the pipe network and SWMM urban hydrology inputs and update '''sw01_001.inp''' to reflect the changes made to the hydrology options above.
  
 
<ol>
 
<ol>
<li> In the Processing Toolbox, go to TUFLOW > SWMM and select 'GeoPackage - Write to SWMM inp'. This opens the dialog shown below.<li> Select the GeoPackage Input File: Navigate to the '''TUFLOW\model\swmm''' folder and select '''sw03_001.gpkg'''.<br>Click 'Run'.
+
<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>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 files in the same folder location and with the same name as the GeoPackage input files. In this case, it saved the INP files to the '''TUFLOW\model\swmm''' folder.  
+
<li>Click 'Run'.
 +
<li>Once the tool is finished, update the 'GeoPackage Input File' parameter. Click '...', and navigate to the '''TUFLOW\model\gis''' folder. Select '''sw01_001.gpkg'''.
 +
<li>Click 'Run'.
 
<li>Once the tool is finished, click 'Close'.
 
<li>Once the tool is finished, click 'Close'.
 +
<li>This tool will save the SWMM inp files in the same folder location and with the same name as the GeoPackage input file. In this case, it will save '''sw03_001.inp''' and '''sw01_001.inp''' to the '''TUFLOW\model\swmm''' folder.
 
<br><br>
 
<br><br>
'''<<Video>>'''
+
{{Video|name=Animation_TS3_SWMM_Inputs_07b.mp4|width=1236}}
 
<br>
 
<br>
 
</ol>
 
</ol>
  
 
==TUFLOW GIS Updates==
 
==TUFLOW GIS Updates==
We will be reverting the TUFLOW model back to a configuration that uses inflows from an external hydrology model (as per Module 1), instead of 2D direct rainfall (Module 2), in the areas not covered by SWMM urban hydrology. We will need to use a new TUFLOW source area inflow layer, instead of reusing the input from Module 1 so we do not double counting the flow generated over the area now represented by SWMM.
+
We will be reverting the TUFLOW model back to a configuration that uses inflows from an external hydrology model (as per Module 1), instead of 2D direct rainfall (Module 2), in the areas not covered by SWMM urban hydrology. Instead of reusing the input from Module 1, we will need to use a new TUFLOW source area inflow layer. This will ensure that we do not double count the flow generated over the area now represented by SWMM.
  
 
<ol>
 
<ol>
<li>Click on the ‘Import Empty File’ symbol from the TUFLOW plugin toolbar.  
+
<li>Click on the ‘Import Empty File’ symbol from the TUFLOW plugin toolbar. <br>
 +
[[File:tuflow_plugin_import_empty_file.png]]<br>
 +
<br>
 
<li>Select '2d_sa' from the Empty Type list.
 
<li>Select '2d_sa' from the Empty Type list.
 
<li>In the Run ID box write 'TS03_001'.
 
<li>In the Run ID box write 'TS03_001'.
 
<li>Tick the 'Regions' Geometry Type.
 
<li>Tick the 'Regions' Geometry Type.
<li>Tick 'Convert to Geopackage'.
 
 
<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>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>'''2d_sa_TS03_001_L''' should now appear in the QGIS Layers panel.
+
<li>The '''2d_sa_TS03_001_R''' appears in the QGIS Layers Panel.<br>
<li>In Windows Explorer, navigate to the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. Drag and drop the '''Urban_Hydrology.gpkg''' into QGIS, and when prompted by QGIS select '''TUFLOW_Subcatchments'''. Click 'Add Layers'.
+
<br>
<li>Select the '''TUFLOW_Subcatchments''' layer in the Layers panel by left clicking on it once.  
+
[[File:TS3_import_empty_2d_sa_01a.png]]<br>
 +
<br>
 +
<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 Panel, select (left click) the '''TUFLOW_Subcatchments''' layer.
 
<li>Use the 'Select Features' tool to highlight the four regions included in '''TUFLOW_Subcatchments'''.
 
<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>Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.  
<li>Select the '''2d_sa_TS03_001_R''' layer in the Layers panel by left clicking on it once.
+
<li>In the QGIS Layers Panel, select (left click) the '''2d_sa_TS03_001_R''' layer.
 +
<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.
 
<li>Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.
<li>Toggle the editing off for '''2d_sa_TS03_001_R''' to save the edits.
+
<li>Toggle off editing to save the edits.
<li>Remove '''Urban_Hydrology.gpkg''' from QGIS.<br>
+
<li>Remove '''Urban_Hydrology.gpkg'''.<br>
 +
The polygon entry we have updated refers to a new subcatchment name for the region adjacent to the SWMM subcatchments. The new name is 'FC06.62', instead of 'FC06'. When we update the TUFLOW Control files we will configure the file references so we are sourcing data from a new flow file obtained from an external hydrology model that has been updated with the reduced catchment area, in recognition of SWMM being used for the flow estimate in the proposed urban development area. <br>
 +
'''Note:''' Common hydrology software used in combination with TUFLOW by modelers include: HEC-HMS, RORB, Drains, WBNM, URBS and more.''
 +
<br><br>
 +
{{Video|name=Animation_TS3_TUFLOW_Inputs_01b.mp4|width=1236}}
 +
<br>
 
</ol>
 
</ol>
The polygon entry we have updated refers to a new subcatchment name for the region adjacent to the SWMM subcatchments. The new name is '''FC06.62''', instead of FC06. When we update the TUFLOW Control files we will configure the file references so we are sourcing data from a new flow file obtained from an external hydrology model that has been updated with the reduced catchment area, in recognition of SWMM being used for the flow estimate in the proposed urban development area. <br>
 
 
''Note: Common hydrology software used in combination with TUFLOW by modelers include: HEC-HMS, RORB, Drains, WBNM, URBS and more.''<br><br>
 
'''<<Video>>'''<br>
 
  
 
==TUFLOW Boundary Updates==
 
==TUFLOW Boundary Updates==
As a result of the changes beng made to the TUFLOW inflows, new TUFLOW boundary condition csv files are also needed. Updated files have been provided in the ''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. Save '''bc_dbase_TS03_001.csv''' and '''TS03_01p2hr.csv''' to the '''TUFLOW_SWMM_Module_03\TUFLOW\bc_dbase''' folder. These files provide the values and model linkages to the new hydrology inflows, which include the '''FC06.62''' entry. <br><br>
+
As a result of the changes made to the TUFLOW inflows, new TUFLOW Boundary Condition csv files are also needed. Updated files have been provided in the '''TUFLOW_SWMM_Module_03\Tutorial_Data''' folder. These files provide the values and model linkages to the new hydrology inflows, which include the 'FC06.62' entry.
'''<<video>>'''
+
<ol>
 +
<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=Animation_TS3_TUFLOW_Boundary_01b.mp4|width=1236}}
 +
<br>
 +
</ol>
  
 
=Simulation Control Files=
 
=Simulation Control Files=
Line 270: Line 288:
 
:*Open '''TS02_001.tscf,'''  and save the file as '''TS03_001.tscf''' in the '''TUFLOW\model''' folder.
 
:*Open '''TS02_001.tscf,'''  and save the file as '''TS03_001.tscf''' in the '''TUFLOW\model''' folder.
 
<br>
 
<br>
'''<<video>>'''
 
 
</ol>
 
</ol>
 +
 
===TUFLOW Control File (TCF)===
 
===TUFLOW Control File (TCF)===
 
<ol>
 
<ol>
<li>Open '''TS03_001.tcf'''.
+
<li>Edit '''TS03_5m_001.tcf''' by making the following reference updates:<br>
<li>Make the following reference updates:<br>
 
 
<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>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 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>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><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> 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>
<li> Comment out the Map Cuttoff Depth command using a <font color="green"><tt>!</tt></font>. It 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>
<font color="green"><tt>!Map Cutoff Depth == 0.05</tt></font><br>
+
<br>
 +
{{Video|name=Animation_TS3_Sim_Control_01a.mp4|width=1235}}
 
<br>
 
<br>
'''<<video>>'''
 
 
</ol>
 
</ol>
  
 
===TUFLOW Boundary Control File (TBC)===
 
===TUFLOW Boundary Control File (TBC)===
 
<ol>
 
<ol>
<li>Open '''TS03_001.tbc'''.
+
<li>Edit '''TS03_001.tbc'''.  
<li> Comment out the Global Rainfall BC command using a <font color="green"><tt>!</tt></font>. It is only necessary for 2D direct rainfall (rain on grid) modelling (SWMM Tutorial 2)<br>
+
<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>
+
<font color="green"><tt>! Global Rainfall BC == RF_FC04</tt></font>
 +
<br>
 +
<li>Add the following additional command:<br>
 +
<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>
 
<br>
<li> Add the following commands:
+
{{Video|name=Animation_TS3_Sim_Control_02b.mp4|width=1236}}
<li> <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>
 
<br>
'''<<video>>'''
 
 
 
</ol>
 
</ol>
  
 
===TUFLOW SWMM Control File (TSCF)===
 
===TUFLOW SWMM Control File (TSCF)===
 
<ol>
 
<ol>
<li>Open '''TS03_001.tscf'''.
+
<li>Edit '''TS03_001.tscf'''.  
<li>Replace <font color="blue"><tt>Read SWMM </tt></font> <font color="red"><tt> == </tt></font> <font color="black"><tt> swmm\sw02_002.inp with</tt></font> the following command:<br>
+
<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> <font color="green"><tt> ! 1D SWMM Pipe Network and SWMM Hydrology Input File </tt></font><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>
 +
<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>
 +
<li>Add the following command:<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=Animation_TS3_Sim_Control_03b.mp4|width=1236}}
 
<br>
 
<br>
'''<<video>>'''
 
 
</ol>
 
</ol>
  
Line 313: Line 335:
 
<li>Save a copy of '''_run_TS02_HPC.bat''' as '''_run_TS03_HPC.bat''' in the '''TUFLOW_SWMM_Module_03\TUFLOW\runs''' folder.
 
<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>
 
<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-AD\TUFLOW_iSP_w64.exe"</tt></font><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-AF\TUFLOW_iSP_w64.exe"</tt></font><br>
 
<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="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>  
 
<font color="orange"><tt>%run% </tt></font> <font color="black"><tt>TS03_5m_001.tcf </tt></font>  
  
<li>Double click the batch file in Windows Explorer to run the simulation. <br>
+
<li>Save the batch file and double click it in Windows File Explorer to run the simulation. <br>
<br>
+
<li>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>
'''<<video>>'''
+
<br><br>
 +
{{Video|name=Animation_TS3_Run_Sim_01b.mp4|width=1236}}<br>
 
</ol>
 
</ol>
<br>
 
  
= Check Files and Results Output =
+
= Check Files =
 +
Review the SWMM INP and simulation report file from the '''TUFLOW_SWMM_Module_03\TUFLOW\results''' folder to confirm the new hydrology inputs are being processed correctly:
 +
* View '''TS03_5m_001_swmm.inp''' in a text editor to confirm the combining of the two input INP files has occurred correctly. Also use the QGIS Processing tool, <u>[[QGIS_SWMM_GeoPackage_Create_from_SWMM_inp |GeoPackage - Create from SWMM inp ]]</u>, to view the information in QGIS.
 +
* View '''TS03_5m_001_swmm_curves.inp''' in a text editor to confirm the rainfall time series that has been used by the SWMM hydrology engine matches the input dataset.
 +
* View '''TS03_5m_001_swmm.rpt''' in a text editor to confirm the model computation is healthy in term of mass conservation.
 +
 
 +
= Results Output =
 +
Complete the steps outlined in following link to review the simulation results from the TUFLOW SWMM model simulation:
 +
 
 +
<u>[[TUFLOW_SWMM_Tutorial_M03_Results_QGIS | TUFLOW SWMM Tutorial 03 Results]]</u> <br>
  
 
= Conclusion =
 
= Conclusion =
:*EPA SWMM urban hydrology was added to the model (replacing 2D drect rainfall / rain-on-grid)
+
*EPA SWMM urban hydrology was added to the model (replacing 2D drect rainfall / rain-on-grid).
:*The 1D SWMM pipe urban pipe network junction attributes were updated to accomodate for change in model configuration from 2D direct rainfall to 1D SWMM hydrology.
+
*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.
  
 +
=Other TUFLOW SWMM Tutorials=
 +
*<u>[[TUFLOW_SWMM_Tutorial_M01 | TUFLOW SWMM Module 1]]</u>  - 1D SWMM Culverts
 +
*<u>[[TUFLOW_SWMM_Tutorial_M02 | TUFLOW SWMM Module 2]]</u>  - 1D SWMM Pipe Network / 2D TUFLOW Direct Rainfall Hydrology
 +
*<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
 
{{Tips Navigation
 
|uplink=[[TUFLOW_SWMM_Tutorial_Introduction#Tutorial_Modules| Return to TUFLOW SWMM Tutorial Introduction Main Page]]
 
|uplink=[[TUFLOW_SWMM_Tutorial_Introduction#Tutorial_Modules| Return to TUFLOW SWMM Tutorial Introduction Main Page]]
 
}}
 
}}

Revision as of 12:16, 19 July 2024

Introduction

This tutorial, Module 3 of the TUFLOW-SWMM tutorial dataset, demonstrates how to add SWMM urban hydrology to a 1D SWMM stormwater pipe network / 2D TUFLOW HPC catchment model. TUFLOW-SWMM Tutorial Module 3 builds from the model created in TUFLOW SWMM Tutorial Module 2. The completed TUFLOW-SWMM Module 2 model is provided in the TUFLOW_SWMM_Module_03\TUFLOW folder of the download dataset as the starting point for this tutorial. If you are not already familiar with TUFLOW-SWMM linking, we recommend completing TUFLOW-SWMM Modules 1 and 2 prior to starting this tutorial.

Project Initialization

QGIS

QGIS Version 3.34 or newer, and QGIS TUFLOW Plugin 3.11 or newer are required to access the SWMM Processing Tools described in the following sections. For installation, see Installation of TUFLOW Plugin.
Define the Coordinate Reference System (CRS), also called ‘Projection’, for the QGIS workspace:

  1. Open QGIS.
  2. Go to Project > Properties…
  3. In the CRS tab, type ‘WGS 84 / UTM Zone 60S’.
  4. Select the matching projection in the 'Predefined Coordinate Reference Systems' section.
  5. Click ‘Apply’ and ‘OK’.
  6. Ensure that the projection is set correctly by viewing the bottom right hand corner of the workspace. It should read ‘EPSG:32760’.



TUFLOW Model

Load and Style TUFLOW Model Files

Load in the project GIS layers:

  1. Click on the ‘Load TUFLOW Layers from TCF’ symbol from the TUFLOW Plugin toolbar.
    Tuflow plugin load tcf layers.png

  2. Navigate to the TUFLOW_SWMM_Module_03\TUFLOW\runs folder and select TS02_5m_001.tcf.
  3. In the Load Layers window, select:
    • Ordering Options: Alphabetical
    • Grouping Options: Group by control file
    • Raster Load Options: Load Normally
  4. Click ‘Open’ and ‘OK’.


Style the TUFLOW layers. Suggested styling steps were provided in TUFLOW SWMM Tutorial M01. They have not been duplicated here.

TUFLOW Plugin

Next we need to configure the QGIS TUFLOW Plugin settings to link with the project folder where we will build our model:

  1. Open the 'Configure TUFLOW Project' tool by selecting Plugins > TUFLOW > Editing > Configure / Create TUFLOW Project.
  2. 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.
  3. To set the location of the TUFLOW folder, click 'Browse...' and navigate to the TUFLOW_SWMM_Module_03 folder. Click 'Select Folder'.
  4. To set the location of the TUFLOW single precision executable file, click 'Browse...' and navigate to the exe\2023-03-AF folder. Select TUFLOW_iSP_w64.exe and click 'Open'.
  5. Select 'GPKG' as the GIS Format.
  6. Select 'TUFLOW Classic / HPC' as the TUFLOW Engine.
  7. Tick on 'Save Default Settings Globally'.
  8. Click 'OK'.

    TS3 Configure Project 01a.png


Increment TUFLOW GeoPackage File

We will now save a copy of TS02_001.gpkg with a new name, TS03_001.gpkg. This project initialization step is recommended so prior model versions from a project are not broken as a result of changes being made to GIS inputs.

  1. In the QGIS Layers Panel, select (left click) 2d_bc_M01_001_L.
  2. Click on the 'Increment Selected Layer' symbol from the TUFLOW Plugin toolbar. This opens the dialog shown below.
    Tuflow plugin increment layer.png

    • Source Layer: Automatically set to the selected layer, 2d_bc_M01_001_L.
    • Output Database: Click 'Browse...'. This will automatically open to the TUFLOW\model\gis folder. Set the new output database name to TS03_001.gpkg and click 'Save'.
    • Output Layer Name: This will automatically increment to 2d_bc_M01_002_L. Change the name back to 2d_bc_M01_001_L.
    • Delete the pre-filled 'Incremented Layer' entry in the table. We do not wish to modify the version number associated with the 2d_bc file. This current exercise will not change the version number of any of the GIS layer inputs, it is simply establishing a copy of the existing GeoPackage where future edits will be saved to.
    • Select 'Remove Source Layer from Workspace'.
    • Select 'Increment Layer and Preserve Database'.
  3. Click 'OK'.
  4. The GeoPackage database, TS03_001.gpkg will now be in the TUFLOW_SWMM_Module_03\TUFLOW\model\gis folder.


Increment SWMM GeoPackage File

SWMM pipe network junction attributes need to be updated when converting a TUFLOW 2D direct rainfall / SWMM 1D model (TUFLOW SWMM Tutorial Module 2). 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.

  1. In the QGIS Layers Panel, open the TS02_001.tscf group. In the sw02_001.inp group, right click Links--Conduits.
  2. Select TUFLOW > SWMM - Increment GeoPackage. This opens the dialog shown below.
    • Output File: Click the '...'. This will automatically open to the TUFLOW\model\swmm folder. Set the output database name to sw03_001.gpkg and click 'Save'.
    • Existing GeoPackage Layers: 'Unload -- do not move'.
  3. Select 'OK'.
  4. The tool will automatically load sw03_001.gpkg into the QGIS workspace and remove sw02_001.inp from the QGIS workspace.
  5. In the QGIS Layers Panel, move sw03_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.


Save QGIS Project Workspace

  1. Go to Project > Save As.
  2. Navigate to the TUFLOW_SWMM_Module_03 folder and type SWMM_M03 as the filename with the extension .qgz.


GIS Inputs

Update SWMM GeoPackage Spatial Database

In previous tutorials we have created new SWMM GeoPackage databases for our new entries. This tutorial will demonstrate a different update approach. Instead of creating a new SWMM GeoPackage database, we will update the existing database, sw03_001.gpkg by adding new SWMM Sections for the hydrology elements we will be incorporating into the model in this tutorial.

  1. Go to Processing > Toolbox from the top dropdown menu options to open the Processing Toolbox.
  2. Go to TUFLOW >> SWMM in the processing tool list and select 'GeoPackage - Add sections'. 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: Click the drop down menu and select 'Project CRS: EPSG:32760 - WGS 84 / UTM zone 60S'.
    • SWMM Sections to add: Click the ..., and tick on:
    • Hydrology--Raingages
    • Hydrology--Subcatchments
  3. Click 'Run'.
  4. Once the tool is finished, click 'Close'.


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 Panel. We need to close the database and reopen it to view the changes.

  1. In the QGIS Layers Panel, right click sw03_001 and select 'Remove Group...'.
  2. In Windows File Explorer, navigate to the TUFLOW\model\swmm folder and drag and drop sw03_001.gpkg into QGIS.
  3. 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.
  4. In the QGIS Layers Panel, move sw03_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 when we are making edits.
  5. In the QGIS Layers Panel, within the sw03_001 group, move Hydrology--Subcatchments to the bottom. This will ensure that the other data within this database can be seen.


SWMM GIS Data Entry

A GeoPackage called Urban_Hydrology.gpkg is provided in the TUFLOW_SWMM_Module_03\Tutorial_Data folder. It contains one SWMM input layer and one TUFLOW input layer:

  • SWMM_Subcatchments: defines the 1D SWMM urban hydrology subcatchment delineation and associated parameters.
  • TUFLOW_Subcatchments: defines the remaining 2D TUFLOW catchment hydrology subcatchment delineation.

To populate the SWMM GeoPackage created in the previous section:

  1. In Windows File Explorer, navigate to the TUFLOW_SWMM_Module_03\Tutorial_Data folder. Drag and drop the Urban_Hydrology.gpkg into QGIS.
  2. When prompted by QGIS select SWMM_Subcatchments. Click 'Add Layers'.
  3. In the QGIS Layers Panel, right click on the SWMM_Subcatchments layer and select 'Zoom to Layer(s)'.
  4. Use the 'Select Features' tool to highlight all items included in SWMM_Subcatchments.
  5. Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
  6. In the QGIS Layers Panel, select (left click) the sw03_001 >> Hydrology--Subcatchments layer.
  7. Make the sw03_001 >> Hydrology--Subcatchments layer editable by clicking the 'Toggle Editing' symbol Toggle editing icon.png.
  8. Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.
  9. Toggle the editing off to save the edits.
  10. Remove Urban_Hydrology from the QGIS Layers Panel.


SWMM GIS Data Updates

The following updates are being made to the objects and layers within sw03_001.gpkg.

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.
Note: 'Gage' is the American spelling of 'Gauge' in Oxford English.

  1. In the QGIS Layers Panel, select (left click) Hydrology--Raingages and toggle on editing.
  2. Right click Hydrology--Raingages and select 'Open Attribute Table'.
  3. Click 'Add Feature' twice. Enter the following attributes (leave all other fields as NULL):
    Name Form Intevl SnowCatchDeficiency Format Tseries
    RF_G1 Volume 0.1 1 TIMESERIES RF_FC04
    RF_G2 Volume 0.1 1 TIMESERIES RF_FC07

    For a summary of the attributes associated with Hydrology--Raingages, refer to TUFLOW 2023-03-AD Release Notes (Table A.11) and the SWMM5 Reference Manual - Volume 1 (Hydrology).
    Note, the spatial locations where the gage information is applied is covered in the following section.

  4. Turn off editing and save the information.


Update SWMM Hydrology Subcatchments

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.

  1. In the QGIS Layers Panel, select (left click) Hydrology--Subcatchments and toggle on editing.
  2. Right click Hydrology--Subcatchments and select 'Open Attribute Table'.
  3. Choose 'Area' as the target field and type the calculation expression, 'area($geometry) / 10000'.
    • 'area($geometry) ': Extracts the area of each region (subcatchment) in Hydrology--Subcatchments.
    • '/ 10000': Converts the area values into hectares.
    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 m2. If using a projection that is measured in feet, QGIS would extract the area in ft2.
  4. Click 'Update All'.
  5. Turn off editing and save the information.
  6. 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 linked to rain gage 'RF_G1'. Upstream subcatchments are linked to rain gage 'RF_G2'.
    • Subcatchments 'SPit11A' and 'SPit11A' are being routed to subcatchment 'SPit11C' before entering the SWMM pipe network. All other hydrology subcatchments route directly to a SWMM Node--Junctions.
    For a summary of the attributes associated with the layer, refer to TUFLOW 2023-03-AD Release Notes (Table A.38) and the SWMM5 Reference Manual - Volume 1 (Hydrology).


SWMM Options

SWMM Project--Options defines the SWMM simulation controls, such as hydrology computation timestep. Project--Options are not required in the new GeoPackage database we are creating for this Tutorial. This is because this model will be constructed from multiple SWMM input (INP) files:

  • 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 > Project--Options) will apply. The options relevant to this tutorial that have already been defined in the Module 1 input include:

  • flow_units: set to metric.
  • infiltration method: set to Green Ampt.

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.

  1. In the QGIS Layers Panel, open the TS02_001.tscf group and select (left click) sw01_001 >> Project--Options and toggle on editing.
  2. Right click Project--Options and select 'Open Attribute Table'.
  3. Update the following hydrology timestep options:
    • WET_STEP: 00:01:00
    • DRY_STEP: 00:01:00
  4. Turn off editing to save the edits.


Export SWMM INP File

We will now create a new INP file for the pipe network and SWMM urban hydrology inputs and update sw01_001.inp to reflect the changes made to the hydrology options above.

  1. 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'.
  2. This will open the 'GeoPackage - Write to SWMM inp' processing tool, prepopulated with the filename of the layer's GeoPackage.
    Note: This tool can also be activated from the Processing Toolbox.
  3. Click 'Run'.
  4. Once the tool is finished, update the 'GeoPackage Input File' parameter. Click '...', and navigate to the TUFLOW\model\gis folder. Select sw01_001.gpkg.
  5. Click 'Run'.
  6. Once the tool is finished, click 'Close'.
  7. This tool will save the SWMM inp files in the same folder location and with the same name as the GeoPackage input file. In this case, it will save sw03_001.inp and sw01_001.inp to the TUFLOW\model\swmm folder.


TUFLOW GIS Updates

We will be reverting the TUFLOW model back to a configuration that uses inflows from an external hydrology model (as per Module 1), instead of 2D direct rainfall (Module 2), in the areas not covered by SWMM urban hydrology. Instead of reusing the input from Module 1, we will need to use a new TUFLOW source area inflow layer. This will ensure that we do not double count the flow generated over the area now represented by SWMM.

  1. Click on the ‘Import Empty File’ symbol from the TUFLOW plugin toolbar.
    Tuflow plugin import empty file.png

  2. Select '2d_sa' from the Empty Type list.
  3. In the Run ID box write 'TS03_001'.
  4. Tick the 'Regions' Geometry Type.
  5. 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'.
  6. The 2d_sa_TS03_001_R appears in the QGIS Layers Panel.

    TS3 import empty 2d sa 01a.png

  7. In Windows File Explorer, navigate to the TUFLOW_SWMM_Module_03\Tutorial_Data folder. Drag and drop the Urban_Hydrology.gpkg into QGIS.
  8. When prompted by QGIS, select TUFLOW_Subcatchments. Click 'Add Layers'.
  9. In the QGIS Layers Panel, select (left click) the TUFLOW_Subcatchments layer.
  10. Use the 'Select Features' tool to highlight the four regions included in TUFLOW_Subcatchments.
  11. Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
  12. In the QGIS Layers Panel, select (left click) the 2d_sa_TS03_001_R layer.
  13. Make the 2d_sa_TS03_001_R layer editable by clicking the 'Toggle Editing' symbol Toggle editing icon.png.
  14. Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.
  15. Toggle off editing to save the edits.
  16. Remove Urban_Hydrology.gpkg.
    The polygon entry we have updated refers to a new subcatchment name for the region adjacent to the SWMM subcatchments. The new name is 'FC06.62', instead of 'FC06'. When we update the TUFLOW Control files we will configure the file references so we are sourcing data from a new flow file obtained from an external hydrology model that has been updated with the reduced catchment area, in recognition of SWMM being used for the flow estimate in the proposed urban development area.
    Note: Common hydrology software used in combination with TUFLOW by modelers include: HEC-HMS, RORB, Drains, WBNM, URBS and more.


TUFLOW Boundary Updates

As a result of the changes made to the TUFLOW inflows, new TUFLOW Boundary Condition csv files are also needed. Updated files have been provided in the TUFLOW_SWMM_Module_03\Tutorial_Data folder. These files provide the values and model linkages to the new hydrology inflows, which include the 'FC06.62' entry.

  1. 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.


Simulation Control Files

To avoid the potential risk of overwriting existing control files accidentally, we will start by saving new control files where we will be making subsequent syntax updates during the following steps.

  1. Open TS02_5m_001.tcf in a Text Editor (Notepad++ is recommended). Save the file as TS03_5m_001.tcf in the TUFLOW_SWMM_Module_03\TUFLOW\runs folder.
  2. Using the 'Open File' function in Notepad++:
    • Open TS02_001.tbc, and save the file as TS03_001.tbc in the TUFLOW\model folder.
    • Open TS02_001.tscf, and save the file as TS03_001.tscf in the TUFLOW\model folder.

TUFLOW Control File (TCF)

  1. Edit TS03_5m_001.tcf by making the following reference updates:
    Spatial Database == ..\model\gis\TS03_001.gpkg ! Specify the location of the GeoPackage Spatial Database
    BC Control File == ..\model\TS03_001.tbc ! Reference the TUFLOW Boundary Condition Control File
    BC Database == ..\bc_dbase\bc_dbase_TS03_001.csv ! Reference the Boundary Condition Database
    SWMM Control File == ..\model\TS03_001.tscf ! Reference the SWMM (1D) Control File
  2. 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).
    ! Map Cutoff Depth == 0.05


TUFLOW Boundary Control File (TBC)

  1. Edit TS03_001.tbc.
  2. 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).
    ! Global Rainfall BC == RF_FC04
  3. Add the following additional command:
    Read GIS SA == 2d_sa_TS03_001_R ! Reads in 2D source area - Excluding SWMM areas


TUFLOW SWMM Control File (TSCF)

  1. Edit TS03_001.tscf.
  2. Replace Read SWMM == swmm\sw02_001.inp with the following command:
    Read SWMM == swmm\sw03_001.inp
  3. 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:
    Maximum Inlet Ponded Depth == 0.1 ! Pull ponded water out of the 1D domain as needed
  4. Add the following command:
    Read BC Timeseries == RF_FC04 | RF_FC07 ! TUFLOW BC Database / SWMM Rain Gage Linkage


Running the Simulation

  1. Save a copy of _run_TS02_HPC.bat as _run_TS03_HPC.bat in the TUFLOW_SWMM_Module_03\TUFLOW\runs folder.
  2. Update the batch file to reference the TS03_5m_001.tcf :
    set exe="..\..\..\exe\2023-03-AF\TUFLOW_iSP_w64.exe"
    set run=start "TUFLOW" /wait %exe% -b
    %run% TS03_5m_001.tcf
  3. Save the batch file and double click it in Windows File Explorer to run the simulation.
  4. Did your TUFLOW-SWMM model fail to run successfully? If so, here is a link to a troubleshooting guide: TUFLOW SWMM Troubleshooting.



Check Files

Review the SWMM INP and simulation report file from the TUFLOW_SWMM_Module_03\TUFLOW\results folder to confirm the new hydrology inputs are being processed correctly:

  • View TS03_5m_001_swmm.inp in a text editor to confirm the combining of the two input INP files has occurred correctly. Also use the QGIS Processing tool, GeoPackage - Create from SWMM inp , to view the information in QGIS.
  • View TS03_5m_001_swmm_curves.inp in a text editor to confirm the rainfall time series that has been used by the SWMM hydrology engine matches the input dataset.
  • View TS03_5m_001_swmm.rpt in a text editor to confirm the model computation is healthy in term of mass conservation.

Results Output

Complete the steps outlined in following link to review the simulation results from the TUFLOW SWMM model simulation:

TUFLOW SWMM Tutorial 03 Results

Conclusion

  • EPA SWMM urban hydrology was added to the model (replacing 2D drect rainfall / rain-on-grid).
  • 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.

Other TUFLOW SWMM Tutorials


Up
Go-up.png Return to TUFLOW SWMM Tutorial Introduction Main Page