Difference between revisions of "TUFLOW SWMM Tutorial M03"

From Tuflow
Jump to navigation Jump to search
Line 57: Line 57:
 
<li> Select '''Remove Source Layer from Workspace'''.
 
<li> Select '''Remove Source Layer from Workspace'''.
 
<li> Select '''Increment Layer and Preserve Database'''.
 
<li> Select '''Increment Layer and Preserve Database'''.
 +
<li> Select '''OK'''.
 +
</ol>
 +
'''<<image>>'''<br>
 +
 +
=== 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.
 +
 +
<ol>
 +
<li> Left click '''sw02_001''' in the QGIS Layers panel.
 +
<li> '''Waiting for Rusty's SWMM Increment Selected Layer tool.'''
 +
<li> Set the new Database name to '''sw02_002.gpkg'''
 
<li> Select '''OK'''.
 
<li> Select '''OK'''.
 
</ol>
 
</ol>

Revision as of 14:57, 16 January 2024

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, 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_02\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.

Project Initialization

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 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 Plugin

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

  1. Go to Plugins > TUFLOW > Editing > Configure / Create TUFLOW Project.
  2. Change the folder which contains TUFLOW to the TUFLOW_SWMM_Module_03 folder.
  3. Set the GIS Format to GPKG.
  4. Click 'OK' and save the workspace by selecting Project > Save As.

    <<image>>


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. In File Explorer, 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.

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.

  1. Left click 2d_sa_M01_001_L in the QGIS Layers panel.
  2. Select the TUFLOW Plugin Increment Selected Layer tool.
  3. Set the new Output Database name to TS03_001.gpkg.
  4. Scroll to the pre-filled entry in the "Incremented Layer" list. Set the new layer name to 2d_sa_TS03_001_R. We will edit this layer in a later step of this tutorial.
  5. Select Remove Source Layer from Workspace.
  6. Select Increment Layer and Preserve Database.
  7. Select OK.

<<image>>

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.

  1. Left click sw02_001 in the QGIS Layers panel.
  2. Waiting for Rusty's SWMM Increment Selected Layer tool.
  3. Set the new Database name to sw02_002.gpkg
  4. Select OK.

<<image>>

Save QGIS Project Workspace

Save the QGIS 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.


SWMM Inputs

Create SWMM GeoPackage Spatial Database

We will create a new SWMM GeoPackage database for our pipe network feature entries:

  1. Go to Processing > Toolbox from the top dropdown menu options to open the Processing Toolbox Panel.
  2. Go to TUFLOW > SWMM in the processing tool list and select 'GeoPackage - Create'. 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 the …, and tick on:
      • Hydrology--Raingages, Hydrology--Subcatchments
    • To define the ‘GPKG filename to create’: Click the …, select ‘Save to File’. Navigate to the TUFLOW\model\swmm folder and save the GeoPackage Database as sw03_001.gpkg.
  3. Click 'Run'.
  4. Once to tool has finished, click ‘Close’.
  5. In File Explorer, navigate to the TUFLOW\model\swmm folder and drag and drop sw03_001.gpkg into QGIS.
  6. 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.
  7. 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.

    <<Video>>


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:

  • SWMM_Subcatchments: defining the 1D SWMM urban hydrology subcatchment delineation and associated parameters.

It also contains a TUFLOW input layer

  • TUFLOW_Subcatchments: defining the remaining 2D TUFLOW catchment hydrology subcatchment delineation.

SWMM

To populate the SWMM GeoPackage created in the previous section:

  1. In Windows 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'.
  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. Select the Hydrology--Subcatchments layer in the Layers panel by left clicking on it once.
  7. Make the 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.gpkg from QGIS.

    <<Video>>

SWMM GIS Data Updates

Update SWMM Hydrology--Raingage

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.

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

    Remaining attributes remain blank.
    SWMM entries are case sensitive. If the input above uses upper case, please double check your data entry does too.

  4. Turn off editing and save the information.

For a summary of the attributes associated with Hydrology--Raingage, refer to TUFLOW 2023-03-AD Release Notes (Table A.11) and the SWMM5 Reference Manual - Volume 1 (Hydrology).

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

  1. 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.
  2. Right click Hydrology--Subcatchments and select 'Open Attribute Table'.
  3. Choose Area as the target field.
  4. Type the calculation expression: $area / 10000.
  5. Click, Update All.
  6. Turn off editing and save the information.
  7. 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 TUFLOW 2023-03-AD Release Notes (Table A.38) and the SWMM5 Reference Manual - Volume 1 (Hydrology). 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.
    • 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--Junction (from sw02_001.gpkg/inp)


    <<Video>>

SWMM Project--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:

  • The SWMM INP file created during Module 1 (road culverts).
  • The SWMM INP file careted for Module 2 (underground pipe network inputs).
  • This Module's SWMM INP (SWMM urban 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 Project--Options will apply. 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.
  • wetstep hydrology timestep: set to 1 minute.
  • 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 SWMM Geopackage Creation step. If the SWMM input file reference is specified lower in the TCSF control file the information contained in this files SWMM Geopackage would supersede any information previously defined by the Module 1 file .

Update SWMM Nodes--Junctions

<<chat to rusty>>

Export SWMM INP File

We will now create a new INP file for the SWMM urban hydrology inputs. To do this, we need to convert sw03_001.gpkg into a SWMM INP file.

  1. In the Processing Toolbox, go to TUFLOW > SWMM and select 'GeoPackage - Write to SWMM inp'. This opens the dialog shown below.
    • GeoPackage Input File: Navigate to the TUFLOW\model\swmm folder and select sw03_001.gpkg.
  2. 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.
  3. Click 'Run'.
  4. Once the tool is finished, click 'Close'.

    <<Video>>

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. When we prepared the new TUFLOW Geopackage file we updated the name associated with the GIS Layer that is used to apply internal flow inputs to a TUFLOW model. We will now update one of the subcatchments within the layer to ensure we are not double counting the flow generated over the area now represented by SWMM.

  1. In the QGIS Layers panel, right click on the 2d_sa_TS03_001_R layer and select 'Zoom to Layer'.
  2. Select the 2d_sa_TS03_001_R layer in the Layers panel by left clicking on it once.
  3. Make the 2d_sa_TS03_001_R layer editable by clicking the 'Toggle Editing' symbol Toggle editing icon.png.
  4. Select the polygon that overlaps with the SWMM uban hydrology area. It should have an attribute name of FC06. Delete the polygon.
  5. 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'.
  6. Select the TUFLOW_Subcatchments layer in the Layers panel by left clicking on it once.
  7. Use the 'Select Features' tool to highlight the single region included in TUFLOW_Subcatchments.
  8. Select 'Edit' from the top QGIS tab and 'Copy Features' from the drop down menu.
  9. Select the 2d_sa_TS03_001_R layer in the Layers panel by left clicking on it once.
  10. Select 'Edit' from the top QGIS tab and click 'Paste Features' from the drop down menu.
  11. Toggle the editing off for 2d_sa_TS03_001_R to save the edits.
  12. Remove Urban_Hydrology.gpkg from QGIS.

The polygon entry we have updated refers to a different name, FC06.62. 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 in recognition of SWMM being used for the flow estimate in the proposed urban development area.

Common hydrology software used by TUFLOW modelers include: HEC-HMS, RORB, Drains, WBNM, URBS and more.

<<Video>>

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.

<<video>>

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.

    <<video>>

TUFLOW Control File (TCF)

  1. Open TS03_001.tcf.
  2. Make 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

  3. Comment out the Map Cuttoff Depth command using a !. It is only necessary for 2D direct rainfall (rain on grid) modelling (SWMM Tutorial 2).
    !Map Cutoff Depth == 0.05

    <<video>>

TUFLOW Boundary Control File (TBC)

  1. Open TS03_001.tbc.
  2. Comment out the Global Rainfall BC command using a !. It is only necessary for 2D direct rainfall (rain on grid) modelling (SWMM Tutorial 2)
    !Global Rainfall BC == RF_FC04
  3. Add the following command: Read GIS SA == 2d_sa_TS03_001_R  ! Reads in 2D source area

    <<video>>

TUFLOW SWMM Control File (TSCF)

  1. Open TS03_001.tscf.
  2. Add the following command:
    Read SWMM == swmm\sw03_001.inp ! 1D SWMM Urban Hydrology

    <<video>>

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-AD\TUFLOW_iSP_w64.exe"
    set run=start "TUFLOW" /wait %exe% -b
    %run% TS03_5m_001.tcf
  3. Double click the batch file in Windows Explorer to run the simulation.

    <<video>>


Check Files and Results Output