Section 1 Introduction

TUFLOW has supported 1D/2D dynamic coupling since its initial 2D solver development in 1989. Traditionally, 1D (1 Dimensional) linking and associated modelling has been applied using the ESTRY 1D solver. New in 2023, TUFLOW’s 1D linking and solver options have been expanded to support EPA Storm Water Management Model (SWMM). As such, 1D pipe networks or 1D open channels can now be modeled using either the ESTRY, EPA SWMM, or a combination of the 1D solvers.

EPA SWMM is a widely used software program for simulating urban and non-urban watersheds’ hydrologic and hydraulic behavior. Developed in the early 1970s by the Environmental Protection Agency (EPA), the model has since undergone numerous updates and enhancements to become one of the most used 1D stormwater runoff and water quality analysis tools globally, particularly in North America.

The primary uses of EPA SWMM include designing and evaluating stormwater management practices, planning, and assessing low-impact development techniques, and developing models for floodplain mapping and emergency response planning. The software allows users to simulate a wide range of storm events and analyze the impact of a range of factors, such as land use changes, climate variability, and water quality control measures, on the performance of stormwater management systems.

This document provides background and instructions for using TUFLOW and SWMM together with limited documentation for each individually. Refer to the model documentation and tutorials to learn how to set up and use each separately. Information on getting started with TUFLOW can be found on the TUFLOW Wiki. Information about EPA SWMM can be found here.

1.1 Capabilities

TUFLOW (2D) and SWMM (1D) models can use TUFLOW using rain-on-grid or source flows over the domain with flows captured at inlets to convey discharges into the SWMM 1D network. Otherwise, SWMM 1D sub-catchments can be used to convey the flow to the urban drainage network allowing inlet-limited overflow (sub-catchment discharge not able to enter the storm drain network) or flooding (leaving the drainage network) handled in 2D. When SWMM sub-catchments are used, they utilize the routing, infiltration, and LID (Low Impact Development) functionalities that correspond to them. SWMM 1D networks can also be connected to 2D domains for standalone culverts.

Currently TUFLOW does not connect the AD (advection-diffusion) module or the interflow capability to the SWMM network. If these or other functionalities would be useful to you, please let us know at support@tuflow.com.

1.2 Model Setup

1.2.1 Simulations

When running a TUFLOW / SWMM model, TUFLOW controls the execution of the simulation. SWMM input commands are specified within a SWMM control file (*.scf). The SWMM control file is referenced in the TUFLOW Control File (*.tcf) using the

SWMM Control File == <.scf file>

1.2.2 SWMM Control File (*.scf)

Within the SWMM control file, SWMM input files are read using the command:

Read SWMM == <gislayer>

Multiple input files can be read to support model scenarios. If multiple input files are provided, TUFLOW combines them to form a single SWMM input file, with later entries overwriting or appending to earlier entries.

Other available commands include:

Read GIS SWMM Inlet Usage == <swmm_inlet_usage_filename>

SWMM Iterations == [1]

A description of their usage is outlined in Section 2.

After the input files are merged and settings modified as needed, the final SWMM model will be placed in the TUFLOW output folder and will be executed from there. The report and output files will also be placed inthe TUFLOW output folder.

1.2.3 1D/2D Domain Linking

There are two available methods to define 1D/2D connections between the TUFLOW 2D domain and SWMM 1D network:

  1. Connection using TUFLOW 2D HX or SX boundaries, snapped to SWMM 1D nodes. 1D/2D linkage boundary connections can be specified in the 2D BC (Boundary Condition) Control File within “2d_bc” gis layers, in the same way connections are established between TUFLOW and ESTRY.

    SWMM nodes include junctions and outfalls.

    • SX connections are required if connecting to outfalls and junctions with a storm drain inlet.
    • HX connections are used for junctions without a storm drain inlet such as culverts under an embankment.

  2. Alternatively, Storm drain inlets can be connected to the TUFLOW 2D domain using a “SWMM Inlet Usage” layer, described in the next section.

1.2.3.1 Inlet Handling

1D inlet configurations, including geometry, are defined in SWMM project (inp) files. The locations of individual inlets and location-specific attributes may be defined in the SWMM project file or in a separate Geographical Information System (GIS) layer. In a pure SWMM model, inlets require the following tables (some are not required if inlet usage is defined separately):

  • Streets: SWMM uses the street cross-section information in this table to help compute storm drain inlet discharges, particularly for on-grade inlets.
  • Conduits (Streets): This table is used to define streets for overland runoff and the slope is used in the storm drain inlet discharges. This table is not used directly when running a TUFLOW-SWMM model because the overland flows are calculated within TUFLOW. However, some of the information is extracted.
  • Inlets: This table defines inlet configurations that describe how to determine inlet discharges. Inlets can be defined based on type and shape such as grates, curbs, and combination, or through curves that describe the relationship between depth and inlet discharge or approach flow and inlet discharge. This table defines these parameters. The same inlet configuration can be used in multiple places within the model.
  • Inlet Usage: This identifies the placement of inlets including the street conduit, inlet (configuration), the node receiving the flow, and local parameters including blockage, size of local gutter depressions, and on-grade, on-sag placement, or automatic placement.

For a TUFLOW-SWMM model, inlets can be defined, either:

  1. Completely using the SWMM input (inp) file format. In this form, all table items listed above (Streets, Conduits, Inlets, and Inlet Usage) are required. In addition, a “2d_bc” layer is required to connect the inlets to the 2D domain.
  2. A mix between the SWMM input file format and a “swmm_inlet_usage” GIS layer. Table 1.1 lists the attributes associated with this GIS layer. In this form, the data entry requirement is reduced. SWMM “Inlet Usage” tables are not used, and streets are not required in the “conduits” table (the conduits table will still define the pipe network). Also, automatic inlet connections between the 1D network and 2D domain can be implemented via the “Conn1D_2D” attribute field (instead of manual specification of SX connection cells within a “2d_bc” GIS layer). The Streets and Inlet tables must still be defined in the SWMM input (inp) file.

Whether inlet usage is defined in SWMM or in a separate GIS layer, the inlet discharges are computed within TUFLOW using modified EPA SWMM 5.2 code before being passed to the SWMM engine for the 1D solution computations. This approach has been selected due to its ability to leverage TUFLOW 2D model results, such as velocities.

Table 1.1: SWMM inlet usage (swmm_inlet_usage) Attribute Descriptions
No.  Default GIS Attribute Name Description Type
1 Inlet The name of the inlet defined in the SWMM inp file “INLETS” section Char (100)
2 StreetXSEC The name of the street cross-section that must be included in the SWMM SWMM inp file “Streets” section. Char (100)
3 Elevation The elevation of the inlet. If a value of –99999 is entered, the elevation will be based on the 2D cell’s elevation.   Float
4 SlopePct_Long The longitudinal slope of the street near the inlet. Float
5 Number The number of inlets in series at the location (generally 1) Integer
6 CloggedPct The percentage that the inlet is blocked (defaults to 0.0). Float
7 Qmax The maximum discharge through the inlet (default is 0 which does not enforce a maximum). Float
8 aLocal The depth of a local depression at the inlet (default 0.0) Float
9 wLocal The width of a local depression at the inlet (default 0.0) Float
10 Placement Specifies whether the inlet should be treated as at a sag or on a grade. Options are ON_GRADE, ON_SAG, or AUTOMATIC. AUTOMATIC is the default and will switch between ON_GRADE and ON_SAG depending upon the flow conditions at the inlet. Char(10)
11 Conn1D_2D

Used to specify a “SX” connection and any additional flags such as “SXZ” or “SXG” that automatically creates a 2D SX cell and connection at the 2D cell within which the SWMM node occurs. This negates the need to create SX objects in a 2d_bc layer.

Flags:

  • “L” – sets the ZU and ZV elevations to be the same as the ZC value only if they are lower. This can improve instabilities where the ZU and ZV values are significantly lower in elevation and can cause a sudden increase in transfer of water to/from the cell when the cell wets.
  • “Z” – Adjust the ZC elevation at each cell at/along/within the 2D SX object to below the 1D node bed elevation where ZC is higher. The ZC elevation is set to the Cell Wet/Dry Depth below the 1D node bed. An error occurs if the minimum ZC elevation plus the Cell Wet/Dry Depth at/along a SX object is not below the connected 1D node bed. Also see SX ZC Check permits the user to define a maximum change in ZC elevation. It is not recommended to use the Z flag without first checking that the reason for the discrepancy in elevations between 1D and 2D domains is appropriate
By default, if more than one 2D cell is automatically connected, nodes are assumed to be connected using the Sag (S) approach. To override the default approach, specify “SXG” for an on-grade connection.
Char (10)
12 Conn_Width

If “SX” is specified for Conn1D_2D, this field controls the number of 2D cells connected as follows. Note this approach is slightly different than is used by TUFLOW-ESTRY models.

  • A positive value indicates the flow width that should be used to compute the number of 2D cells to connect to. TUFLOW will choose the nearest cells that are collectively as wide or wider than the specified flow width.
  • If negative, the number of cells selected is the absolute value of the number specified. For example, a value of –1 would connect the inlet to a single 2D cell.
Float

1.2.4 ESTRY/SWMM Linking

SWMM can be linked to TUFLOW 2D (HPC) as well as ESTRY 1D Networks. The approach is described in Section 8.3 of the 2018 TUFLOW Manual where SWMM is considered an “External 1D Domain.” For SWMM linking, X1DQ connections must be used at SWMM junctions and X1DH connections are used at SWMM outfalls.

1.2.5 SWMM Settings

Some SWMM option settings are automatically set by TUFLOW:

  • END_DATE/END_TIME: Set based upon the SWMM START_DATE/START_TIME and the TUFLOW simulation duration.
  • FLOW_UNITS: the flow units are set to match the TUFLOW simulation, either to CFS for US Customary units or CMS for metric units.
  • FLOW_ROUTING: Flow routing is set to DYNWAVE.
  • ALLOW_PONDING: Allow ponding is set to YES. Ponding can be prevented by setting a high value for “YSur” or by setting the junction attribute Apond to 0.0. Only junctions with HX or SX boundaries should have Apond set to 0.0, which will create flooding in the 2D domain when the junction is surcharged.
  • END_DATE/END_TIME: These are set based on the TUFLOW end time and the SWMM start time (simulation duration + start date/time = specified end date/time).
  • VARIABLE_STEP: This is turned off (0). TUFLOW will control the timestep based on the HPC (Heavily Parallelised Compute) timestep and the SWMM Iterations command.

The treatment of ponding by SWMM is particularly important. TUFLOW requires ponding, so junctions can pond if the ponding area (Apond) is greater than 0.0. SWMM tracks the volumes stored as ponded water and will reintroduce the water back into the network when there is capacity available. Ponded water at a node connected to an HX boundary or a depth vs discharge inlet will transfer flow to the 2D domain if the ponded water level exceeds the 2d cell water levels.

If the ponding area is 0.0, water will not pond at a node, but the water can surcharge (flood) if the water level in a node exceeds Ymax + Ysur (maximum depth + surcharge water depth). Flooded water is lost through “flooding” and no longer tracked within SWMM. Unless the flooded water for a junction is outside of the 2D domain and not of interest, nodes that may exhibit flooding should be connected to the 2D domain with or without an inlet.

Recommended attribute settings for junction nodes are:

  • Junction nodes without inlets (2d_bc HX boundary)
    • Set the SWMM Ymax value to the highest soffit of the connected culvert (SWMM will default to this value if Ymax is set to 0). Set Apond to approximately the area of the connected cells. Water will flow into the 2D domain if the water surface elevation in the pipe exceeds the water surface elevation in the 2D domain.
  • Junctions with Inlets (2d_bc SX boundary)
    • Custom inlet with depth vs discharge rating curve: Set the SWMM Ymax value to the inlet elevation and Apond to approximately the area of the connected cells (often a single cell).
    • All other inlets – Set SWMM Ymax value to the inlet elevation and Apond to 0.0. SWMM will report “flooding” at the node, transferring flow to the 2D domain.
  • Junctions without 2d_bc HX or SX boundaries
    • Since these junctions do not have connections to the 2D domain, any water lost to “flooding” will be lost from the model. A junction can be prevented from “flooding” by setting the SWMM junction surcharge elevation (Ysur) to a value well above the expected water surface elevation to prevent this from occurring.
  • The recommendations above assume that the SWMM 1D network is within the extents of an active 2D domain. Portions of the SWMM network may extend beyond these boundaries. In these situations, use the SWMM documentation to determine the most appropriate parameter specification.

1.3 SWMM GIS Tools

A suite of Python tools has been developed to support TUFLOW/SWMM modelling. These tools are available to run as processing scripts in QGIS, via the TUFLOW Plugin. For instructions how to install the Plugin, please refer to the TUFLOW Wiki.

These tools use a GeoPackage format for working with the data in GIS using a schema that has been developed to store the data held within an SWMM input file. The GeoPackage representation is mostly a simple conversion of the table oriented SWMM input file (inp). Some GeoPackage tables are modified versions of the SWMM input file. Some of the GeoPackage tables have spatial components (points, lines, and polygons) and others are tables of data with no geometry attributes.

Generally, modified tables are a “wide” form of the tables to represent distinct categories of options without using the same column for multiple input parameters. For example, the “XSECTIONS” table has a variety of inputs depending upon whether the shape is from a list of shapes, a custom shape (a closed shape with a Height vs Width table), irregular shape (cross-section-based open channel), or a street cross-section. In the SWMM input file, attributes from multiple types use the same columns while the GeoPackage representation creates a column for each input field. There are separate columns for specified shapes and irregular culvert curves. Depending upon the option selected, many of the fields will not be used.

To make things simpler, the subcatchment and subarea SWMM table columns are combined into the subcatchment table. The subarea columns use the prefix “subarea_” and are written to a separate table when exported to SWMM inp.

1.3.1 GIS Tools

Most of the SWMM functionality currently in the TUFLOW plugin are processing tools accessed from the processing tools panel. The 1D integrity tools are also supported.

The Geo-Processing tools include a description of the tool, inputs, and outputs when accessed in QGIS. The list of available Geo-Processing Algorithms includes:

  • Convert ESTRY layers to SWMM: This tool converts individual ESTRY input layers into SWMM format. Supported layers include 1D network layers (lines or points), 1D node layers, 1D pit layers, and 1D table link layers (cross-sections). Pit inlet database/depth discharge database can be specified for use. Options and reporting tables can optionally be created to make a more complete SWMM input file.
  • GeoPackage - Add Sections: This tool adds tables (spatial or otherwise) representing SWMM sections to a new or existing GeoPackage.
  • GeoPackage - Create from SWMM inp: This tool converts a SWMM input file to a GeoPackage representation. Even if not necessary, this conversion is often useful because it provides a format supporting GIS objects for visualization and editing. For example, it provides a GIS object that 2d_bc HX and SX boundaries can be snapped to.
  • GeoPackage - Write to SWMM inp: This tool converts a GeoPackage to a SWMM input file. This step is required to use the model with TUFLOW because TUFLOW does not directly read the GeoPackage format.
  • Integrity - Assign snapped nodes to conduits: SWMM links (conduits, pumps, weirs, etc) include the name of starting and ending nodes in the table ignoring location. This tool will assign the table nodes the names of the nodes snapped to the endpoints.
  • Integrity - Make node names unique: SWMM requires unique names for nodes (junctions and outfalls). If multiple nodes are encountered with the same name, this tool will add an incremental number (node_2, node_3, node_4, etc.) to force unique names.

Most of the 1D integrity tools now work with SWMM networks. Refer to the documentation for the tools to understand their use: 1D Integrity Tools. Add the “Links–Conduits” to the “1D Network Line Layers” and “Nodes–Junctions” and “Nodes–Outfalls” to the “1D Point Layers” sections of the panel. The other Links types are not currently supported but will be added. The “Auto Snap” option in the Snapping tool is not currently supported for SWMM networks.

1.4 SWMM Outputs

Model outputs are written by both SWMM and TUFLOW, which can be used to visualize model results. SWMM writes a report file (rpt) and an output file (out) in the TUFLOW results folder with the simulation prefix followed by “_swmm.” The report file can be viewed with a text editor and the output file can be viewed in EPA SWMM or 3rd party tools that support this format such as PySWMM.

Currently, TUFLOW will also write a file ending “_swmm_ugrid.nc,” which is a UGRID file written in a NetCDF format that contains the 1D results. The UGRID file can be viewed in QGIS. The results (depth, flow, water level, etc.) can be colored for specific timesteps using the “Layer Styling” options. The temporal controller or TUFLOW viewer can switch between timesteps. Time series and profile plots can be generated using the Crayfish Plugin.

During the beta period, we are investigating a new time-series format based on GeoPackages. It is anticipated that this format will replace the UGRID format before the full release of the TUFLOW with SWMM.

1.5 SWMM Inclusion in TUFLOW

1.5.1 SWMM Library Version

TUFLOW runs SWMM as a library passing data between SWMM and the 2D domains. The SWMM version used for the hydraulic calculation was created by Open Water Analytics (McDonnell et al. 2021), which is a modified version of the EPA SWMM code.

1.5.2 Embedded SWMM Code in TUFLOW

TUFLOW has modified EPA SWMM code (not from Open Water Analytics) embedded primarily to compute pit (inlet) discharges. The code was modified for easy inclusion and to allow the discharges to be calculated outside of the SWMM library based on 2D model results. Some minor changes were made to the embedded code which are described in this section.

Changes were made to how inlets are handled to better correspond to how “rating curve” based pits are treated in ESTRY and provide better handling when the water level is above the inlet invert. Pit rating curves use a depth vs discharge relationship to determine the volume of flow that passes from the 2D domain into the 1D domain. If the pipe water level is above the inlet invert, but the 2D water level is higher the discharge will be based on the 2D water level minus the 1D water level in the pipe. If the 1D pipe water level is higher, a surcharging discharge is computed using the same curve based on the 1D pipe water level minus the 2D water level. This matches the ESTRY implementation and ensures a smooth transition between inflow and surcharging.

The discharge for on-grade grate inlets was modified to use a velocity passed from the 2D domain rather than calculating a velocity based on the street cross-section and slope at the inlet.

The methodology for assigning On-Grade or On-Sag handling of pits (inlets) was modified in the embedded code. In SWMM pit (inlet) placement of “AUTOMATIC” determines whether a pit should be On-Sag or On-Grade based upon the topography of the street layout. However, in a combined TUFLOW and SWMM model streets may not be fully described because only the cross-section information at inlets is required because 2D flows are modeled in TUFLOW. When running SWMM inside of TUFLOW, whether to treat an automatic placement as On-Sag or On-Grade is determined dynamically based on the inflows to the connected 2D cells. The 2D model provides approach discharge (along the street) and total discharge for the connected cells. If the approach discharge is over 85% of the total discharge, the pit is modeled as an On-Grade inlet. Otherwise, it is modeled as On-Sag. This approach is currently being tested and may not appropriately assign On-Grade and On-Sag inlets. It is recommended that users assign On-Grade or On-Sag to each of their inlets until the automatic approach has been proven.

References

McDonnell, Bryant, Jia Xin Wu, Katherine Ratliff, Abhiram Mullapudi, and Michael Tryby. 2021. “Open Water Analytics Stormwater Management Model.” Zenodo. https://doi.org/10.5281/zenodo.5484299.