Difference between revisions of "XPSWMM Conversion Reconfigure SWMM Pipe Network Data"

From Tuflow
Jump to navigation Jump to search
 
(52 intermediate revisions by 3 users not shown)
Line 1: Line 1:
===Correct SWMM Nodes--Junction/Outfall Model Design===
+
== Correct SWMM Nodes--Junction/Outfall Model Design ==
XPSWMM used a modified version of the EPA SWMM engine. Unlike traditional EPA SWMM networks that require '''Nodes--Junctions''' at the upstream end of culverts and '''Nodes--Outfalls''' at the outlets, XPSWMM uses '''Nodes--Junctions''' in all locations. TUFLOW's implementation of SWMM has retained the traditional EPA SWMM structure. Due to this fundamental difference in approach, some manipulation of the XPSWMM '''Nodes--Junctions''' information is necessary.
+
XPSWMM used a modified version of the EPA SWMM engine. Unlike traditional EPA SWMM networks that require '''Nodes--Junctions''' at the upstream end of culverts and '''Nodes--Outfalls''' at the outlets, XPSWMM uses '''Nodes--Junctions''' in all locations. TUFLOW's implementation of SWMM has retained the traditional EPA SWMM structure. Due to this fundamental difference in approach, some manipulation of the '''Nodes--Junctions''' information is necessary.
  
 
<ol>
 
<ol>
Line 6: Line 6:
 
<li> Go to Processing > Toolbox from the top dropdown menu options to open the Processing Toolbox.
 
<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_Junctions_Downstream_Junctions_to_Outfalls |Junctions - Downstream junctions to outfalls]]</u>'. This opens the dialog shown below.
 
<li> Go to TUFLOW >> SWMM in the processing tool list and select '<u>[[QGIS_SWMM_Junctions_Downstream_Junctions_to_Outfalls |Junctions - Downstream junctions to outfalls]]</u>'. This opens the dialog shown below.
:* Input Junctions: '''Nodes--Junctions''' (this is prepopulated as '''Nodes--Junctions''' is the active dataset).
+
:* Input Junctions: '''Nodes--Junctions''' (this will be prepopulated if '''Nodes--Junctions''' is the active dataset).
 
:* Input Conduits: Click '...' and tick on '''Links--Conduits'''
 
:* Input Conduits: Click '...' and tick on '''Links--Conduits'''
 
:* Modified Junctions Layer: Leave this field blank so the tool writes the data to a temporary file. It will not be used.  
 
:* Modified Junctions Layer: Leave this field blank so the tool writes the data to a temporary file. It will not be used.  
Line 12: Line 12:
 
<ol>
 
<ol>
 
::<li> Click '...', select 'Save to GeoPackage...'.  
 
::<li> Click '...', select 'Save to GeoPackage...'.  
::<li> Navigate to the '''TUFLOW\model\swmm''' folder and select the HDR GeoPackage file created in the <u>[[#Convert_XPSWMM_Model_to_Recommended_TUFLOW_Structure | Convert XPSWMM Model to Recommended TUFLOW Structure]]</u> section. Click 'Save'.
+
::<li> Navigate to the '''TUFLOW\model\swmm''' folder and select the previously created HDR GeoPackage file. Click 'Save'.
 
::<li> A dialog will open. In the 'Layer Name' field, write '''Nodes--Outfalls'''. It is important that this layer is named correctly so it is recognized by the other TUFLOW SWMM processing tools.  
 
::<li> A dialog will open. In the 'Layer Name' field, write '''Nodes--Outfalls'''. It is important that this layer is named correctly so it is recognized by the other TUFLOW SWMM processing tools.  
 
::<li> Click 'OK'.
 
::<li> Click 'OK'.
 
</ol>
 
</ol>
 +
 
<li> Click 'Run'. Once the tool is finished, click 'Close'.  
 
<li> Click 'Run'. Once the tool is finished, click 'Close'.  
 
<li> The temporary junctions layer, '''Modified junctions layer''', and the new outfalls layer, '''Nodes--Outfalls''', will appear in the QGIS Layers panel.  
 
<li> The temporary junctions layer, '''Modified junctions layer''', and the new outfalls layer, '''Nodes--Outfalls''', will appear in the QGIS Layers panel.  
<li> In the QGIS Layers panel, right click '''Modified junctions layer''', and select 'Remove Layer..'.
+
<li> In the QGIS Layers panel, right click '''Modified junctions layer''' and select 'Remove Layer'.
 
<li> In the QGIS Layers panel, select (left click) '''Nodes--Outfalls''' and toggle off editing.
 
<li> In the QGIS Layers panel, select (left click) '''Nodes--Outfalls''' and toggle off editing.
 
<br><br>
 
<br><br>
{{Video|name=Animation_XPtoTUFLOW_1D_model_02a.mp4|width=1350}}
+
{{Video|name=Animation_XPtoTUFLOW_1D_model_03c.mp4|width=1350}}
 
<br>
 
<br>
 
</ol>
 
</ol>
  
To complete the update process, it is necessary to remove the junction nodes from '''Nodes--Junctions''' that coincide with the nodes created in '''Nodes-Outfalls'''. While this can be done manually, the steps below illustrate an automated process using a processing tool.
+
To complete the update process, it is necessary to remove the objects from '''Nodes--Junctions''' that coincide with the points created in '''Nodes--Outfalls'''. While this can be done manually, the steps below illustrate an automated process using a QGIS processing tool.
 
<ol>
 
<ol>
 
<li> In the QGIS Layers panel, select (left click) '''Nodes--Junctions''' and toggle on editing.  
 
<li> In the QGIS Layers panel, select (left click) '''Nodes--Junctions''' and toggle on editing.  
<li> Use the 'Select Features' tool to select all nodes included in the '''Nodes--Junctions''' layer. This will change their color to bright yellow.
+
<li> Use the 'Select Features' tool to select all nodes included in the '''Nodes--Junctions''' layer. When selected, this will change their color to bright yellow.
 
<li> In the Processing Toolbox, go to 'Vector Selection' and select 'Select within distance'. This opens the dialog shown below.
 
<li> In the Processing Toolbox, go to 'Vector Selection' and select 'Select within distance'. This opens the dialog shown below.
 
:* Select features from: '''Nodes--Junctions''' (this is prepopulated as '''Nodes--Junctions''' is the active dataset).
 
:* Select features from: '''Nodes--Junctions''' (this is prepopulated as '''Nodes--Junctions''' is the active dataset).
:* By comparing to the features from: Click the drop down menu and select '''Nodes--Outfalls'''.
+
:* By comparing to the features from: Click the dropdown menu and select '''Nodes--Outfalls'''.
 
:* Where the features are within: '0.1 meters'
 
:* Where the features are within: '0.1 meters'
 
:* Modify current selection by: 'selecting within current selection'
 
:* Modify current selection by: 'selecting within current selection'
 
<li> Click 'Run'. Once the tool is finished, click 'Close'.
 
<li> Click 'Run'. Once the tool is finished, click 'Close'.
 
<li> In the QGIS Layers panel, right click '''Nodes--Junctions''' and select 'Open Attribute Table'.
 
<li> In the QGIS Layers panel, right click '''Nodes--Junctions''' and select 'Open Attribute Table'.
<li> In the attributes table, only some of the junction nodes will be selected. Select 'Delete selected features' to delete these nodes. Close the attribute table.
+
<li> In the attribute table, only some of the junction nodes will be selected. Select 'Delete selected features' to delete these nodes. Close the attribute table.
<li> Toggle the editing off to save the edits.  
+
<li> Toggle editing off to save the edits to '''Nodes--Junctions'''.  
 
<br><br>
 
<br><br>
{{Video|name=Animation_XPtoTUFLOW_1D_model_03a.mp4|width=1350}}
+
{{Video|name=Animation_XPtoTUFLOW_1D_model_04c.mp4|width=1350}}
 
<br>
 
<br>
 
</ol>
 
</ol>
  
=== 1D/2D Pipe Network Pit (Inlet Usage) Connections ===
+
== 1D/2D Pipe Network Pit (Inlet Usage) Connections ==
⁠Inlet usage connections establish the 1D/2D linkages between the ground surface, defined in 2D, and the 1D SWMM pipe network. Physically, these features come in various forms and dimensions; however they are commonly referred to as kerb inlets, with or without associated grates. An example is shown in the image below. <br>
+
⁠Inlet usage connections establish the 1D/2D linkages between the ground surface, defined in 2D, and the 1D SWMM pipe network. Physically, these features come in various forms and dimensions; however, they are commonly referred to as kerb inlets, with or without associated grates. An example is shown in the image below. <br>
 
<br>
 
<br>
 
[[File: XPSWMM_Kerb_Inlet.JPG | 300px ]] <br>
 
[[File: XPSWMM_Kerb_Inlet.JPG | 300px ]] <br>
 
<br>
 
<br>
Transfer of inlet usage connection information from XPSWMM to TUFLOW involves a three step process:
+
The transfer of inlet usage connection information from XPSWMM to TUFLOW involves a three-step process:
 
<ol>
 
<ol>
 
<li> Export data from XPSWMM.
 
<li> Export data from XPSWMM.
Line 56: Line 57:
  
  
==== Export Data from XPSWMM====
+
=== Export Data from XPSWMM ===
 
<ol>
 
<ol>
 
<li> In XPSWMM, select 'Hydraulics Mode' from the toolbar.
 
<li> In XPSWMM, select 'Hydraulics Mode' from the toolbar.
Line 63: Line 64:
 
<br>
 
<br>
 
<li> In the XPSWMM Layers panel, right click '''Nodes''' and select 'Export To GIS File...'. This will open a dialog.  
 
<li> In the XPSWMM Layers panel, right click '''Nodes''' and select 'Export To GIS File...'. This will open a dialog.  
<li> Select the GIS File: Click the '...' and navigate to the '''TUFLOW\model\swmm''' folder. Enter an appropriate filename and set the file type to ESRI (*.shp). For example, '''1D2D_Urban_Node_Export_001.shp'''
+
<li> Select the GIS File: Click the '...' and navigate to the '''TUFLOW\model\swmm''' folder. Enter an appropriate filename and set the file type to MapInfo Interchange File (*.mif). For example, '''1D2D_Urban_Node_Export_001.mif'''.
 
<li> Click 'Node Data and Results' to expand the folder tree. Go to Node Data and Results > Hydraulics Node > HDR Node Data. Double click to select the following items:
 
<li> Click 'Node Data and Results' to expand the folder tree. Go to Node Data and Results > Hydraulics Node > HDR Node Data. Double click to select the following items:
 
:* Node 2D Inflow Capture Flag
 
:* Node 2D Inflow Capture Flag
Line 69: Line 70:
 
:* 2D Inflow Capture Coefficient
 
:* 2D Inflow Capture Coefficient
 
:* 2D Inflow Capture Exponent
 
:* 2D Inflow Capture Exponent
<li> In the right-hand table, the items above, along with 'Node Name', 'Node X' and 'Node Y', should be selected.  
+
<li> In the right-hand table, the items above, along with 'Node Name', 'Node X' and 'Node Y', should be displayed.  
<li> In the 'Custom Name' column, select each entry and shorten the text to less than 10 characters. For example, 'Node 2D Inflow Capture Flag' > 'NodeIn' and 'Ground Elevation (Spill Crest)' > 'Ground'.
+
<li> In the 'Custom Name' column, double click 'Ground Elevation (Spill Crest)' and update the name to '''Ground Elevation'''. This is necessary because the parentheses can cause issues with some GIS software.
 
<li> Click 'Export'. A message will appear reporting how many nodes were exported.  
 
<li> Click 'Export'. A message will appear reporting how many nodes were exported.  
 
<br><br>
 
<br><br>
{{Video|name=Animation_XPtoTUFLOW_1D_model_04b.mp4|width=1350}}
+
{{Video|name=Animation_XPtoTUFLOW_1D_model_05d.mp4|width=1350}}
 
<br>
 
<br>
 
</ol>
 
</ol>
  
==== Convert Exported Data into TUFLOW SWMM Format ====
+
=== Convert Exported Data into TUFLOW SWMM Format ===
 
<ol>
 
<ol>
<li> In Windows File Explorer, navigate to the '''TUFLOW\model\swmm''' folder. Drag and drop the node export .shp file into QGIS.
+
<li> In Windows File Explorer, navigate to the '''TUFLOW\model\swmm''' folder. Drag and drop the node export .mif file (e.g. '''1D2D_Urban_Node_Export_001.mif''') into QGIS.<br>
 +
You may receive a message stating that there is no transform between the CRS of the .mif file and the CRS of the QGIS workspace. Ignore this message and close the pop up. This issue will be resolved in the following steps.  
 
<li> In the QGIS Layers panel, select (left click) the node export layer.
 
<li> In the QGIS Layers panel, select (left click) the node export layer.
<li> In the Processing Toolbox, go to TUFLOW >> SWMM and select '<u>[[QGIS_SWMM_Convert_XPSWMM_GIS_Inlet_Layers_to_SWMM |Convert - XPSWMM GIS inlet layers to SWMM]]</u>'. This opens the dialog shown below.  
+
<li> In the Processing Toolbox, go to TUFLOW >> SWMM and select '<u>[[QGIS_SWMM_Convert_XPSWMM_GIS_Inlet_Layers_to_SWMM |Convert - XPSWMM GIS inlet layers to SWMM]]</u>'. Enter the following information into the dialog.  
 
:* GIS layer with inlet information: This is prepopulated as the node export layer is the active dataset.
 
:* GIS layer with inlet information: This is prepopulated as the node export layer is the active dataset.
:* Inlet name field: 'Node Name'
+
:* Inlet name field: 'NodeName'
:* Inlet elevation field: 'Ground'
+
:* Inlet elevation field: 'GroundElevation'
:* Inlet 2d capture flag field: 'NodeIn'
+
:* Inlet 2d capture flag field: 'Node2DInflowCaptureFlag'
:* Inlet discharge equation coefficient field: 'Coeff'
+
:* Inlet discharge equation coefficient field: '2DInflowCaptureCoefficient'
:* Inlet discharge exponent field: 'Exponent'
+
:* Inlet discharge exponent field: '2DInflowCaptureExponent'
:* Inlet connection width: This defines the number of 2D cells associated with the 1D/2D connections. Typically, this should match the 2D cell size of the model.  
+
:* Inlet connection width: This defines the length used to assign the number of 2D cells associated with the 1D/2D connections. A value of '''4m''' will be used in this example. This will select a single 2D cell for the connection.
:* CRS: Select the models' Coordinate Reference System (CRS).
+
:* CRS: Select the models' Coordinate Reference System (CRS). For the demonstration model, the CRS is 'EPSG:32760 - WGS 84 / UTM zone 60S'.
 
:* SWMM inp file (for inlet definition and curves):  
 
:* SWMM inp file (for inlet definition and curves):  
 
<ol>
 
<ol>
 
::<li> Click '...', and select 'Save to File...'.
 
::<li> Click '...', and select 'Save to File...'.
::<li> Navigate to the '''TUFLOW\model\swmm''' folder. Choose an appropriate .inp file name. For example, '''swmm_inlet_curves_XP_001.inp'''. This tool will also create a .gpkg file with the same data and name; saved in the same file location, i.e. '''swmm_inlet_curves_XP_001.gpkg'''.  
+
::<li> Navigate to the '''TUFLOW\model\swmm''' folder. Choose an appropriate .inp file name. For example, '''swmm_inlet_curves_XP_001.inp'''. This tool will also create a .gpkg file with the same data and name; saved in the same file location (e.g. '''swmm_inlet_curves_XP_001.gpkg''').  
 
::<li> Click 'Save'.
 
::<li> Click 'Save'.
 
</ol>
 
</ol>
:* GeoPackage file for inlet usage:  
+
:* GeoPackage file for inlet usage:
 
<ol>
 
<ol>
 
::<li> Click '...', and select 'Save to File...'.
 
::<li> Click '...', and select 'Save to File...'.
Line 102: Line 104:
 
::<li> Click 'Save'.
 
::<li> Click 'Save'.
 
</ol>
 
</ol>
 +
 
<li> Click 'Run'. Once the tool is finished, click 'Close'.
 
<li> Click 'Run'. Once the tool is finished, click 'Close'.
<li> Remove the node export layer from the QGIS workspace.  
+
<li> In the QGIS Layers panel, right click node export layer and select 'Remove Layer'.  
<li> In Windows File Explorer, navigate to the '''TUFLOW\model\swmm''' folder. Drag and drop the two new GeoPackage databases (i.e. '''swmm_iu_XP_001.gpkg''' and '''swmm_inlet_curves_XP_001.gpkg''') into QGIS (hold Ctrl to select multiple). Inspect the attributes associated with the objects in both GeoPackages.  
+
<li> In Windows File Explorer, navigate to the '''TUFLOW\model\swmm''' folder. Drag and drop the two new GeoPackage databases (e.g. '''swmm_iu_XP_001.gpkg''' and '''swmm_inlet_curves_XP_001.gpkg''') into QGIS (hold Ctrl to select multiple). Inspect the attributes associated with the objects in both GeoPackages.  
 
<br><br>
 
<br><br>
{{Video|name=Animation_XPtoTUFLOW_1D_model_05b.mp4|width=1350}}
+
{{Video|name=Animation_XPtoTUFLOW_1D_model_06d.mp4|width=1350}}
 
<br>
 
<br>
 
</ol>
 
</ol>
  
====Edit TUFLOW SWMM Data====
+
=== Edit TUFLOW SWMM Data ===
Unfortunately, the snapping tolerance set by XPSWMM for its Node GIS Data Export function is larger than the underlying model information it is associated with. This can cause a slight offset in the data. To rectify this issue, we will use a processing tool designed to assist in this task.  
+
Unfortunately, the snapping tolerance set by XPSWMM for its Node GIS Data Export function is larger than the underlying EPA SWMM model information it is associated with. This can cause a slight offset in the data. To rectify this issue, we will use a processing tool designed to assist in this task.  
 
<ol>
 
<ol>
<li> In the QGIS Layers panel, select (left click) the inlet usage layer (i.e. '''swmm_iu_XP_001''') and toggle on editing.  
+
<li> In the QGIS Layers panel, select (left click) the inlet usage layer (e.g. '''swmm_iu_XP_001''') 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> 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 'Vector geometry' in the processing tool list and select 'Snap geometries to layer'. This opens the dialog shown below.  
 
<li> Go to 'Vector geometry' in the processing tool list and select 'Snap geometries to layer'. This opens the dialog shown below.  
 
:* Reference Layer: '''Nodes--Junctions'''. This is the layer we want the inlet usage layer to snap to.  
 
:* Reference Layer: '''Nodes--Junctions'''. This is the layer we want the inlet usage layer to snap to.  
 
:* Tolerance: '0.1 meters'
 
:* Tolerance: '0.1 meters'
:* Behavior: 'Prefer aligning nodes, insert extra vertices where required'
+
:* Behavior: 'Prefer aligning nodes, don't insert new vertices'
 
<li> Click 'Modify All Features'. Once the tool is finished, click 'Close'.
 
<li> Click 'Modify All Features'. Once the tool is finished, click 'Close'.
<li> Toggle off the editing for the inlet usage layer (i.e.'''swmm_iu_XP_001''') to save the edits.
+
<li> Toggle off the editing for the inlet usage layer (e.g.'''swmm_iu_XP_001''') to save the edits.
 
<br><br>
 
<br><br>
{{Video|name=Animation_XPtoTUFLOW_1D_model_06b.mp4|width=1350}}
+
{{Video|name=Animation_XPtoTUFLOW_1D_model_07d.mp4|width=1350}}
 
<br>
 
<br>
 
</ol>
 
</ol>
  
===Edit 1D/2D Culvert Connections===
+
== Edit 1D/2D Culvert Connections ==
 
In addition to the pipe network inlet usage 1D/2D connections, we also need to connect the 1D culvert inlet/outlets to the 2D. These features are typically associated with culverts located under raised roads or rail embankments, outlets from pipe networks into creeks, streams, or rivers, or open pipe network inlets and outlets linked to major stormwater drainage infrastructure, which often involves the modification of historically above-ground streamflows to an underground stormwater network. An example is shown in the image below.<br>
 
In addition to the pipe network inlet usage 1D/2D connections, we also need to connect the 1D culvert inlet/outlets to the 2D. These features are typically associated with culverts located under raised roads or rail embankments, outlets from pipe networks into creeks, streams, or rivers, or open pipe network inlets and outlets linked to major stormwater drainage infrastructure, which often involves the modification of historically above-ground streamflows to an underground stormwater network. An example is shown in the image below.<br>
 
<br>
 
<br>
 
[[File: XPSWMM_Culvert_Inlet.JPG | 500px]]<br>
 
[[File: XPSWMM_Culvert_Inlet.JPG | 500px]]<br>
 
<br>
 
<br>
In order to connect a 1D SWMM culvert to TUFLOW 2D, TUFLOW SWMM necessitates 1D/2D HX connection lines at the upstream (inlet) end of the culvert and 1D/2D SX connection lines at the downstream (outlet) end. This model schematization differs from that of the TUFLOW ESTRY and XPSWMM, which require 1D/2D SX connections both upstream and downstream, but aligns with the traditional requirements of EPA SWMM.
+
In order to connect a 1D SWMM culvert to TUFLOW 2D, TUFLOW SWMM necessitates 1D/2D HX connection lines at the upstream (inlet) end of the culvert and 1D/2D SX connection lines at the downstream (outlet) end. This model schematization matches the traditional requirements of EPA SWMM, though differs from that of XPSWMM, which require 1D/2D SX connections both upstream and downstream.
 
<br>
 
<br>
 
[[File: 1D2D_Connections_Diagram.png | 300px]]
 
[[File: 1D2D_Connections_Diagram.png | 300px]]
 
<br>
 
<br>
  
In the <u>[[#Convert_XPSWMM_Model_to_Recommended_TUFLOW_Structure | Convert XPSWMM Model to Recommended TUFLOW Structure]]</u> section, the XPSWMM 1D/2D connections were converted into TUFLOW format. However, since we have included and edited the SWMM data (HDR, inlet curves, and inlet usage GeoPackages), this connections layer needs to be updated. We need to change the upstream SX connections to HX connections, create new upstream CN lines, and ensure that the connections are snapped to the pipe network.
+
In the <u>[[XPSWMM_Conversion_TUFLOW_Structure_Archive |Convert XPSWMM Model to Recommended TUFLOW Structure]]</u> section, the XPSWMM 1D/2D connections were converted into TUFLOW format. However, since we have included and edited the SWMM data (HDR, inlet curves, and inlet usage GeoPackages), this connections layer needs to be updated. We need to change the upstream SX connections to HX connections, create new upstream CN lines, and ensure that the connections are snapped to the pipe network.
 
<ol>  
 
<ol>  
<li> In the QGIS Layers panel, within the TBC group, select (left click) the 2d_bc lines layer (i.e. '''1D2D_Urban_001_2d_bc_L''') and toggle on editing. This layer contains the converted XPSWMM 1D/2D connections.
+
<li> In the QGIS Layers panel, within the TBC group, select (left click) the 2d_bc lines layer (e.g. '''1D2D_Urban_001_2d_bc_L''') and toggle on editing. This layer contains the converted XPSWMM 1D/2D connections.
 
<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> 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 'Vector geometry' in the processing tool list and select 'Snap geometries to layer'. This opens the dialog shown below.  
+
<li> Go to 'Vector geometry' in the processing tool list and select 'Snap geometries to layer'. Enter the inputs below in the dialog box.  
:* Reference Layer: '''Links--Conduits'''. This is the layer we want the 2d_bc connections layer to snap to.  
+
:* Reference Layer: '''Links--Conduits'''. This is the layer we want the 2d_bc connections layer to snap to.
 
:* Tolerance: '0.1 meters'
 
:* Tolerance: '0.1 meters'
 
:* Behavior: 'Snap end points to end points only'
 
:* Behavior: 'Snap end points to end points only'
 +
 
<li> Click 'Modify All Features'. Once the tool is finished, click 'Close'.
 
<li> Click 'Modify All Features'. Once the tool is finished, click 'Close'.
 
<li> This tool has ensured that the 2d_bc connections layer is snapped to the pipe network.  
 
<li> This tool has ensured that the 2d_bc connections layer is snapped to the pipe network.  
 
<br><br>
 
<br><br>
{{Video|name=|width=1350}}
+
{{Video|name=Animation_XPtoTUFLOW_1D_model_08b.mp4|width=1350}}
 
<br>
 
<br>
 
<li> In the top dropdown menu options, select View > Toolbars. Tick on 'Snapping Toolbar'.  
 
<li> In the top dropdown menu options, select View > Toolbars. Tick on 'Snapping Toolbar'.  
Line 154: Line 158:
 
[[File: snapping_toolbar_dropdown_menu.png | 500px]]
 
[[File: snapping_toolbar_dropdown_menu.png | 500px]]
 
<br><br>
 
<br><br>
<li> Select the 'Edit Advanced Configuration' [[File: Advanced_config_icon.png | 30px]] and tick on the 2d_bc connections layer and the '''Links--Conduits''' layer.
+
<li> Select the 'Edit Advanced Configuration' [[File: Advanced_config_icon.png | 30px]] and tick on the '''2d_bc_L''' connections layer and the '''Links--Conduits''' layer.
<li> From the 'Digitizing Toolbar', use the 'Add Line Feature' tool to create a CN line to each upstream connection.
+
<li> From the 'Digitizing Toolbar', use the 'Add Line Feature' tool to add a CN line to each upstream Conduit connection.
<li> Use the 'Identify Features' [[File: identify_features_icon.png | 30px]] tool to select an upstream 'SX' connection. A dialog will open.
+
* Draw the extra line between the upstream end of the Conduit and the end of the 1D/2D boundary line.
 +
* Set the line 'Type' field to 'CN'.
 +
* Leave the other attributes null and click OK.
 +
<li> In the QGIS Layers panel, tick the drop down arrow next to the 2d_bc connections layer. This will display the colors associated with the different connection types.  
 +
<li> Use the 'Identify Features' [[File: identify_features_icon.png | 30px]] tool to select an upstream 'SX' connection. A dialog will open.<br>
 
<li> Change the 'Type' field to 'HX'.  
 
<li> Change the 'Type' field to 'HX'.  
 +
<br><br>
 +
{{Video|name=Animation_XPtoTUFLOW_1D_model_09b.mp4|width=1350}}
 +
<br>
 
<li> Repeat this for each upstream 'SX' connection.  
 
<li> Repeat this for each upstream 'SX' connection.  
 
<li> Toggle off editing for the 2d_bc connections layer to save the edits.
 
<li> Toggle off editing for the 2d_bc connections layer to save the edits.
 +
<li> Click the 'Apply TUFLOW Styles to Current Layer' button for a defined symbology to be applied to the HX lines (they may have gone translucent when you clicked Save).
 
<br><br>
 
<br><br>
{{Video|name=|width=1350}}
+
{{Video|name=Animation_XPtoTUFLOW_1D_model_10b.mp4|width=1350}}
 
<br>
 
<br>
 
</ol>
 
</ol>
  
 +
 +
{{Tips Navigation
 +
|uplink=[[XPSWMM_Conversion_Export_SWMM_Hydrology | Continue to Next Step: "Export SWMM Hydrology"]]
 +
}}
 
{{Tips Navigation
 
{{Tips Navigation
|uplink=[[XPSWMM_to_TUFLOW-SWMM#One Dimensional_(1D)_SWMM_Model_Elements| Back to XPSWMM to TUFLOW Conversion Page]]
+
|uplink=[[XPSWMM_to_TUFLOW-SWMM#One Dimensional_(1D)_SWMM_Model_Elements| Back to Main XPSWMM to TUFLOW Conversion Page]]
 
}}
 
}}

Latest revision as of 09:56, 20 August 2024

Correct SWMM Nodes--Junction/Outfall Model Design

XPSWMM used a modified version of the EPA SWMM engine. Unlike traditional EPA SWMM networks that require Nodes--Junctions at the upstream end of culverts and Nodes--Outfalls at the outlets, XPSWMM uses Nodes--Junctions in all locations. TUFLOW's implementation of SWMM has retained the traditional EPA SWMM structure. Due to this fundamental difference in approach, some manipulation of the Nodes--Junctions information is necessary.

  1. In the QGIS Layers panel, select (left click) Nodes--Junctions to make it the active dataset.
  2. Go to Processing > Toolbox from the top dropdown menu options to open the Processing Toolbox.
  3. Go to TUFLOW >> SWMM in the processing tool list and select 'Junctions - Downstream junctions to outfalls'. This opens the dialog shown below.
    • Input Junctions: Nodes--Junctions (this will be prepopulated if Nodes--Junctions is the active dataset).
    • Input Conduits: Click '...' and tick on Links--Conduits
    • Modified Junctions Layer: Leave this field blank so the tool writes the data to a temporary file. It will not be used.
    • Modified Outfalls Layer:
    1. Click '...', select 'Save to GeoPackage...'.
    2. Navigate to the TUFLOW\model\swmm folder and select the previously created HDR GeoPackage file. Click 'Save'.
    3. A dialog will open. In the 'Layer Name' field, write Nodes--Outfalls. It is important that this layer is named correctly so it is recognized by the other TUFLOW SWMM processing tools.
    4. Click 'OK'.
  4. Click 'Run'. Once the tool is finished, click 'Close'.
  5. The temporary junctions layer, Modified junctions layer, and the new outfalls layer, Nodes--Outfalls, will appear in the QGIS Layers panel.
  6. In the QGIS Layers panel, right click Modified junctions layer and select 'Remove Layer'.
  7. In the QGIS Layers panel, select (left click) Nodes--Outfalls and toggle off editing.


To complete the update process, it is necessary to remove the objects from Nodes--Junctions that coincide with the points created in Nodes--Outfalls. While this can be done manually, the steps below illustrate an automated process using a QGIS processing tool.

  1. In the QGIS Layers panel, select (left click) Nodes--Junctions and toggle on editing.
  2. Use the 'Select Features' tool to select all nodes included in the Nodes--Junctions layer. When selected, this will change their color to bright yellow.
  3. In the Processing Toolbox, go to 'Vector Selection' and select 'Select within distance'. This opens the dialog shown below.
    • Select features from: Nodes--Junctions (this is prepopulated as Nodes--Junctions is the active dataset).
    • By comparing to the features from: Click the dropdown menu and select Nodes--Outfalls.
    • Where the features are within: '0.1 meters'
    • Modify current selection by: 'selecting within current selection'
  4. Click 'Run'. Once the tool is finished, click 'Close'.
  5. In the QGIS Layers panel, right click Nodes--Junctions and select 'Open Attribute Table'.
  6. In the attribute table, only some of the junction nodes will be selected. Select 'Delete selected features' to delete these nodes. Close the attribute table.
  7. Toggle editing off to save the edits to Nodes--Junctions.


1D/2D Pipe Network Pit (Inlet Usage) Connections

⁠Inlet usage connections establish the 1D/2D linkages between the ground surface, defined in 2D, and the 1D SWMM pipe network. Physically, these features come in various forms and dimensions; however, they are commonly referred to as kerb inlets, with or without associated grates. An example is shown in the image below.

XPSWMM Kerb Inlet.JPG

The transfer of inlet usage connection information from XPSWMM to TUFLOW involves a three-step process:

  1. Export data from XPSWMM.
  2. Convert the exported data into a TUFLOW SWMM compatible format.
  3. Make minor edits to correct for snapping deficiencies in the XPSWMM export tools.


Export Data from XPSWMM

  1. In XPSWMM, select 'Hydraulics Mode' from the toolbar.

    XPSWMM to TUFLOW toolbar hydraulics mode 01a.png
  2. In the XPSWMM Layers panel, right click Nodes and select 'Export To GIS File...'. This will open a dialog.
  3. Select the GIS File: Click the '...' and navigate to the TUFLOW\model\swmm folder. Enter an appropriate filename and set the file type to MapInfo Interchange File (*.mif). For example, 1D2D_Urban_Node_Export_001.mif.
  4. Click 'Node Data and Results' to expand the folder tree. Go to Node Data and Results > Hydraulics Node > HDR Node Data. Double click to select the following items:
    • Node 2D Inflow Capture Flag
    • Ground Elevation (Spill Crest)
    • 2D Inflow Capture Coefficient
    • 2D Inflow Capture Exponent
  5. In the right-hand table, the items above, along with 'Node Name', 'Node X' and 'Node Y', should be displayed.
  6. In the 'Custom Name' column, double click 'Ground Elevation (Spill Crest)' and update the name to Ground Elevation. This is necessary because the parentheses can cause issues with some GIS software.
  7. Click 'Export'. A message will appear reporting how many nodes were exported.


Convert Exported Data into TUFLOW SWMM Format

  1. In Windows File Explorer, navigate to the TUFLOW\model\swmm folder. Drag and drop the node export .mif file (e.g. 1D2D_Urban_Node_Export_001.mif) into QGIS.
    You may receive a message stating that there is no transform between the CRS of the .mif file and the CRS of the QGIS workspace. Ignore this message and close the pop up. This issue will be resolved in the following steps.
  2. In the QGIS Layers panel, select (left click) the node export layer.
  3. In the Processing Toolbox, go to TUFLOW >> SWMM and select 'Convert - XPSWMM GIS inlet layers to SWMM'. Enter the following information into the dialog.
    • GIS layer with inlet information: This is prepopulated as the node export layer is the active dataset.
    • Inlet name field: 'NodeName'
    • Inlet elevation field: 'GroundElevation'
    • Inlet 2d capture flag field: 'Node2DInflowCaptureFlag'
    • Inlet discharge equation coefficient field: '2DInflowCaptureCoefficient'
    • Inlet discharge exponent field: '2DInflowCaptureExponent'
    • Inlet connection width: This defines the length used to assign the number of 2D cells associated with the 1D/2D connections. A value of 4m will be used in this example. This will select a single 2D cell for the connection.
    • CRS: Select the models' Coordinate Reference System (CRS). For the demonstration model, the CRS is 'EPSG:32760 - WGS 84 / UTM zone 60S'.
    • SWMM inp file (for inlet definition and curves):
    1. Click '...', and select 'Save to File...'.
    2. Navigate to the TUFLOW\model\swmm folder. Choose an appropriate .inp file name. For example, swmm_inlet_curves_XP_001.inp. This tool will also create a .gpkg file with the same data and name; saved in the same file location (e.g. swmm_inlet_curves_XP_001.gpkg).
    3. Click 'Save'.
    • GeoPackage file for inlet usage:
    1. Click '...', and select 'Save to File...'.
    2. Navigate to the TUFLOW\model\swmm folder. Choose an appropriate .gpkg file name. For example, swmm_iu_XP_001.gpkg.
    3. Click 'Save'.
  4. Click 'Run'. Once the tool is finished, click 'Close'.
  5. In the QGIS Layers panel, right click node export layer and select 'Remove Layer'.
  6. In Windows File Explorer, navigate to the TUFLOW\model\swmm folder. Drag and drop the two new GeoPackage databases (e.g. swmm_iu_XP_001.gpkg and swmm_inlet_curves_XP_001.gpkg) into QGIS (hold Ctrl to select multiple). Inspect the attributes associated with the objects in both GeoPackages.


Edit TUFLOW SWMM Data

Unfortunately, the snapping tolerance set by XPSWMM for its Node GIS Data Export function is larger than the underlying EPA SWMM model information it is associated with. This can cause a slight offset in the data. To rectify this issue, we will use a processing tool designed to assist in this task.

  1. In the QGIS Layers panel, select (left click) the inlet usage layer (e.g. swmm_iu_XP_001) and toggle on editing.
  2. In the Processing Toolbox, select the 'Edit Features In-Place' tool Edit features in place icon.png. This allows the editing of an existing layer, instead of the creation of a new layer.
  3. Go to 'Vector geometry' in the processing tool list and select 'Snap geometries to layer'. This opens the dialog shown below.
    • Reference Layer: Nodes--Junctions. This is the layer we want the inlet usage layer to snap to.
    • Tolerance: '0.1 meters'
    • Behavior: 'Prefer aligning nodes, don't insert new vertices'
  4. Click 'Modify All Features'. Once the tool is finished, click 'Close'.
  5. Toggle off the editing for the inlet usage layer (e.g.swmm_iu_XP_001) to save the edits.


Edit 1D/2D Culvert Connections

In addition to the pipe network inlet usage 1D/2D connections, we also need to connect the 1D culvert inlet/outlets to the 2D. These features are typically associated with culverts located under raised roads or rail embankments, outlets from pipe networks into creeks, streams, or rivers, or open pipe network inlets and outlets linked to major stormwater drainage infrastructure, which often involves the modification of historically above-ground streamflows to an underground stormwater network. An example is shown in the image below.

XPSWMM Culvert Inlet.JPG

In order to connect a 1D SWMM culvert to TUFLOW 2D, TUFLOW SWMM necessitates 1D/2D HX connection lines at the upstream (inlet) end of the culvert and 1D/2D SX connection lines at the downstream (outlet) end. This model schematization matches the traditional requirements of EPA SWMM, though differs from that of XPSWMM, which require 1D/2D SX connections both upstream and downstream.
1D2D Connections Diagram.png

In the Convert XPSWMM Model to Recommended TUFLOW Structure section, the XPSWMM 1D/2D connections were converted into TUFLOW format. However, since we have included and edited the SWMM data (HDR, inlet curves, and inlet usage GeoPackages), this connections layer needs to be updated. We need to change the upstream SX connections to HX connections, create new upstream CN lines, and ensure that the connections are snapped to the pipe network.

  1. In the QGIS Layers panel, within the TBC group, select (left click) the 2d_bc lines layer (e.g. 1D2D_Urban_001_2d_bc_L) and toggle on editing. This layer contains the converted XPSWMM 1D/2D connections.
  2. In the Processing Toolbox, select the 'Edit Features In-Place' tool Edit features in place icon.png. This allows the editing of an existing layer, instead of the creation of a new layer.
  3. Go to 'Vector geometry' in the processing tool list and select 'Snap geometries to layer'. Enter the inputs below in the dialog box.
    • Reference Layer: Links--Conduits. This is the layer we want the 2d_bc connections layer to snap to.
    • Tolerance: '0.1 meters'
    • Behavior: 'Snap end points to end points only'
  4. Click 'Modify All Features'. Once the tool is finished, click 'Close'.
  5. This tool has ensured that the 2d_bc connections layer is snapped to the pipe network.


  6. In the top dropdown menu options, select View > Toolbars. Tick on 'Snapping Toolbar'.
  7. Select the 'Enable Snapping' Snapping icon.png and 'All Layers > Advanced Configuration', an eye icon appears.

    Snapping toolbar dropdown menu.png

  8. Select the 'Edit Advanced Configuration' Advanced config icon.png and tick on the 2d_bc_L connections layer and the Links--Conduits layer.
  9. From the 'Digitizing Toolbar', use the 'Add Line Feature' tool to add a CN line to each upstream Conduit connection.
    • Draw the extra line between the upstream end of the Conduit and the end of the 1D/2D boundary line.
    • Set the line 'Type' field to 'CN'.
    • Leave the other attributes null and click OK.
  10. In the QGIS Layers panel, tick the drop down arrow next to the 2d_bc connections layer. This will display the colors associated with the different connection types.
  11. Use the 'Identify Features' Identify features icon.png tool to select an upstream 'SX' connection. A dialog will open.
  12. Change the 'Type' field to 'HX'.


  13. Repeat this for each upstream 'SX' connection.
  14. Toggle off editing for the 2d_bc connections layer to save the edits.
  15. Click the 'Apply TUFLOW Styles to Current Layer' button for a defined symbology to be applied to the HX lines (they may have gone translucent when you clicked Save).



Up
Go-up.png Continue to Next Step: "Export SWMM Hydrology"
Up
Go-up.png Back to Main XPSWMM to TUFLOW Conversion Page