XPSWMM Conversion Reconfigure SWMM Pipe Network Data Development

From Tuflow
Jump to navigation Jump to search

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


Convert Junction Nodes at HX Boundaries to Storage Nodes

As TUFLOW HX cells do not have storage associated with them, this storage needs to be represented in the 1D domain. This can be achieved by using storage nodes at these locations. Storage nodes also improve model stability.
To convert the junction nodes at HX boundaries to storage nodes:

  1. In the Processing Toolbox, go to TUFLOW >> SWMM and select 'Junctions - Convert HX nodes to storage' (ensure the 'Edit Features In-Place' tool is not selected). This opens the dialog shown below:
    • Input Junction layer: Select the Nodes--Junctions layer from the HDR GeoPackage (e.g. 1D2D_Urban_hdr_001 >> Nodes--Junctions).
    • Input BC Connection Layers: Select the 2d_bc connections layer (e.g. 1D2D_Urban_001.tbc >> 1D2D_Urban_001_2d_bc_L).
    • Storage Shape: Pyramidal
    • Length: This value should be set to the typical number of HX connected cells multiplied by the cell size (10 in the example dataset).
    • Width: This value should be set to the cell size (5 in the example dataset).
    • Inverse slope (run/rise): Inverse slope of the output storage nodes. For pyramidal storage nodes, this value should be set to 0.0 (0.0 in the example dataset).
    • Output Junctions Layer: Leave as default.
    • Output Storage Layer: Leave as default.
  2. Click 'Run'. Once the tool is finished, click 'Close'.
  3. Two new layers, Output Storage Layer and Output Junctions Layer, will appear in the QGIS Layers Panel.


Video

To include the Output Storage Layer in the HDR GeoPackage:

  1. In the QGIS Layers Panel, right click on the Output Storage Layer and select 'Export >> Save Features As...'. This opens the dialog shown below:
    • Format: Prepopulated as 'GeoPackage'.
    • File name: Click '...' and navigate to the TUFLOW\model\swmm folder and select the HDR GeoPackage (e.g. 1D2D_Urban_HDR_001.gpkg).
    • Layer Name: Nodes--Storage
    • CRS: Select the models' Coordinate Reference System (CRS). For the demonstration model, the CRS is 'EPSG:32760 - WGS 84 / UTM zone 60S'.
  2. Leave all other parameters as the default and ensure that Add saved file to map (at the bottom of the dialog) is ticked on.
  3. Click 'OK'.
  4. In the QGIS Layers Panel, move the Nodes--Storage layer into the HDR GeoPackage group.


Video

We need to remove the objects from Nodes--Junctions that coincide with the new new storage nodes. This can be done manually or with the 'Vector Selection > Select within distance' processing tool (used above). The following steps will outline the process of using the 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--Storage.
    • 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.
  8. Remove Output Storage Layer and Output Junctions Layer from the QGIS Layers Panel.


Video

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