Section 4 1D Solver - SWMM

This chapter of the release notes is written in USA English for the predominantly USA centered SWMM user base.

4.1 Overview

TUFLOW has supported 1D/2D dynamic coupling since its initial 2D solver development in 1989. Traditionally, 1D (1 Dimensional) linking and associated modeling has been applied using the ESTRY 1D solver. New in the 2023-03-AD release, TUFLOW’s 1D linking and solver options have been expanded to support the 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 two 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 and linking TUFLOW and SWMM together. Refer to the TUFLOW and SWMM user documentation and tutorials to learn how to set up the TUFLOW and SWMM domains. Information on getting started with TUFLOW can be found on the TUFLOW Wiki. Information about EPA SWMM can be found on the EPA SWMM website.

4.1.1 Capabilities

Combined TUFLOW (2D) and SWMM (1D) models have a variety of applications and capabilities, including:

  • SWMM 1D inflows from external boundary conditions, rainfall routed through subcatchments, or through 2D links
  • Subcatchment routing including infiltration, groundwater levels, evaporation, and snow melt
  • Low-impact developments (LIDs) for modeling green infrastructure
  • 1D/2D Links through direct connections (HX/SX) or through stormwater inlets (ESTRY pits)
  • Inlets can be a variety of shapes and supports on-sag or on-grade connections
  • Inlets can surcharge into the 2D domain if the 1D pressure head exceeds the 2D water level
  • Scenario support through the ability to combine multiple SWMM project files (inp) is a powerful way to explore multiple setup options without duplicating information
  • All TUFLOW functions including:
    • Quadtree grid refinement
    • Subgrid sampling
    • Rain on grid or source flows
    • Infiltration
    • Interflow (shallow groundwater)

The TUFLOW QGIS plugin has been expanded to assist with setting up SWMM models, linking TUFLOW-SWMM models, and viewing SWMM outputs. It includes the following features:

  • Creation of SWMM GeoPackage GIS files that include all the data needed for a SWMM model
  • Conversion of SWMM input files (inp) to and from SWMM GeoPackage files
  • Adding tables to SWMM GeoPackage files
  • Semi-automatic creation of TUFLOW-SWMM linkage
  • Setting of SWMM Junction parameters based on junction usage and location
  • Setting SWMM conduit losses dependent on location in the network and whether connected to inlets
  • Convert XPSWMM 1D/2D links to TUFLOW SWMM links
  • Convert ESTRY layers to SWMM
  • Supports 1D pipe and other integrity tools for SWMM GIS Layers
  • GIS viewing of time-series results including
    • Plan view symbology based on results at the current time
    • Time-series plots through the TUFLOW viewer
    • Both options can be used for animations

Currently, TUFLOW does not connect the AD (advection-diffusion) module or the interflow capability to the SWMM network. These are scheduled for a future release, however, if they or other features would be useful to you, please let us know via support@tuflow.com.

4.1.2 Model Setup

4.1.2.1 SWMM Model

The SWMM portion of the TUFLOW-SWMM model is read from one or more SWMM project files (inp). These files can be setup within the EPA SWMM GUI, using the GIS tools described in Section 4.1.3, or other tools.

The EPA SWMM Website provides documentation on model theory and setup.

This manual does not attempt to duplicate all of the information available in other sources for SWMM models but does provide documentation on the GeoPackage format used in the TUFLOW QGIS plugin in Section 4.3.

4.1.2.2 Simulations

When running a TUFLOW / SWMM model, TUFLOW controls the execution of the simulation. SWMM input commands are specified within a SWMM control file (*.tscf) documented in Section 4.2. The SWMM control file is referenced in the TUFLOW Control File (*.tcf) using the “SWMM Control File” command documented in Section 4.2.1.

The SWMM Control File can reference multiple SWMM input files (inp) potentially varying by scenario. These input files are merged giving preferences to later files allowing for overriding existing features (eg. to upgrade a section of pipe network). After the input files are merged, 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 in the TUFLOW output folder.

4.1.2.3 1D/2D Domain Linking

Connections between 1D and 2D models use SX and HX connections generally defined in 2d_bc layers but sometimes created in other ways. For HX connections, the 2D domain provides a discharge to the 1D domain and receives a water level. SX connections are the reverse. The 2D domain provides a water level and receives a discharge. Whether an HX or SX boundary is used depends on the configuration as described below.

There are three categories of connections between 1D and 2D models;

  1. Storm-drain inlets: These are connections that use storm drain inlet information to determine the discharge that should flow from the 2D overland flooding into the storm drain system. These connections use an SX connection. These connections require inlet definition in the SWMM inp file and an inlet usage layer as described in Section 4.1.2.4. The inlet usage layer has an automatic SX connection option or they can be connected using SX point, lines, or regions.
  2. Direct connections: This type of connection would be used for embankments through a culvert or similar where a storm drain inlet is not used. HX connections are used at junctions (upstream side) and SX connections are used at outfalls (downstream).
  3. Subcatchment outlets: Subcatchment runoff can be setup to flow into the 2D domain using a standalone junction that receives the flow connected to SX connections (points, lines, or regions).

4.1.2.4 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, combination thereof, 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 4.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 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 and water levels. If the pressure head in the 1D domain exceeds the 2D water level, the 1D domain will surcharge into the 2D domain.

Table 4.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

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

4.1.2.6 SWMM Settings

4.1.2.6.1 SWMM Options Table

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.
4.1.2.6.2 SWMM Junction Options

The junction settings for Ymax (maximum depth), Ysur (surge depth), and Apond (area of ponding) are critical to get accurate and stable results. These values relate to how SWMM handles water that overflows a node.

In SWMM, ponding can be on or off but TUFLOW forces ponding to be on when running a TUFLOW-SWMM model. 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. When ponding is on ysur (surge depth) is ignored (any water above Ymax ponds).

If the ponding area (apond) is 0.0, water will not pond at a node, but the water can overflow (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. If the node is connected to a 2D domain, the flow is immediately transferred into the connected 2D cells.

If ponding is off at a node, there is no limit to how much flow may overflow from a node for a timestep. This can lead to unrealistic overflow discharges. However, this functionality may be preferred for subcatchment outlets so that the full discharge can immediately overflow into the 2D without being throttled by the inlet.

If a node can pond (Apond > 0) and is connected to the 2D domain using an inlet or HX connection, TUFLOW will compute the discharge that should be transferred between the 1D and 2D domain. If the water level in the 2D domain is higher than the 1D (potentially ponded) water level, then flow will be from the 2D domain into the 1D. The discharge rate will depend upon the difference in water levels and whether it is connected through an inlet or HX boundary.

If the pressure head in the 1D domain exceeds the 2D water level, the 1D domain will overflow (surcharge) into the 2D domain. The approach used to compute the surcharge discharge depends on the inlet setup and whether or not the node ponds.

If the node allows ponding (ponding > 0) - The discharge becomes the surcharging discharge based on the depth vs flow curve for custom inlets or from the orifice equation for other inlet types plus any additional discharge from the use of the Maximum Inlet Ponded Depth command described in Section 4.2.2. - The coefficient used for inlet surcharging can be specified with the Inlet Surcharge Orifice Coefficient command described in Section 4.2.2. - The discharge for custom curves is applied directly in reverse. A 1D water level 0.3 meters above the 2D water level will produce the same discharge as a 2D water level 0.3 meters above the 1D water level (or ground elevation). 2. If the node does not allow ponding (ponding = 0) - Any volume that exceeds the maximum nodal water level (YMax) plus any surcharge depth (YSur) is reported as flooding by SWMM which no longer tracks it. Therefore, the water is passed directly from the SWMM engine to the TUFLOW 2D cells. This approach is not recommended because it prevents the network from utilizing the full pressure head in its flow calculations for the network.

Recommendations based on the above: If ponding is used, a Ymax value of 0.0 is generally sufficient for all cases. Ymax will be set to the highest adjacent obvert. Ponding will occur at that elevation and discharges to/from the 2D will compare the ponded elevation with the 2D water levels. For nodes with inlets, allowing ponding is often preferable but using a Ymax set to the invert elevation with no ponding (Apond = 0.0) is also valid. This may be the preferred approach for subcatchment outlets to prevent overflow throttling by the inlet.

These values can be set using the “Junctions - Set attributes” tool described in Section 4.1.3.1.

  • Junction nodes receiving subcatchment flows. Use ponding determined by other settings or force no ponding as below.
    • Ysur = 0.0
    • Apond = 0.0
  • Junction nodes connected to the 2D at an inlet.
    • Ysur = 0.0
    • Apond = < Approximate manhole area or larger to aid stability >
  • Junction nodes connected to 2D using HX boundaries.
    • Ysur = 0.0
    • Apond = < Approximate area of connected 2D cells >
  • Junction nodes not connected to 2D (need to prevent flooding which would be lost)
    • Option #1
      • Ysur = 0.0
      • Apond = < Positive number >
    • Option #2
      • Ysur = < higher depth than anticipated (including pressure head )>
      • Apond = 0.0

4.1.2.7 Using TUFLOW BC Database in SWMM

It is possible to use curves from the TUFLOW Boundary Condition Database for SWMM input curves using the command “Read BC ” command. This is a powerful feature making it much easier to model a variety of boundary condition events or scenarios. The curve_type should be timeseries for time data such as rainfall or discharge through time or be one of the types supported in the “Curves” section of the SWMM inp file.

The curve data will be added to the inp file TUFLOW writes to use for the simulation. The curve name must be specified (matching the BC Database identifier) where the curve is referenced such as in rainfall or inflow inputs.

4.1.3 SWMM GIS Tools

A suite of Python tools has been developed to support TUFLOW/SWMM modeling. 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 the SWMM inp file.

4.1.3.1 GIS Tools

The SWMM functionality currently in the TUFLOW QGIS plugin include processing tools accessed from the “Processing Toolbox Panel.” The 1D integrity tools work with SWMM networks in addition to ESTRY.

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:

  • BC - Create channel endpoint 1D/2D connections: This tool creates a “2d_bc” layer with 1D/2D connections specified for the upstream and downstream side of SWMM channels. This tool can operate on selected or all of the channels within an input layer. HX connections will be created at junctions and SX connections at outfalls. The connections should be reviewed and modified if necessary.
  • Conduits - Assign losses: This tool assign entrance and exit losses to SWMM junctions based on whether a junction receives subcatchment flows, whether it is connected to an inlet, and its location in the network. This tool can be used to edit layers “in-place.”
  • Conduits - Assign node fields: This tool will identify nodes snapped to the ends of conduits and fill in the appropriate “From node” and “To node” fields. This is required for SWMM to associate the conduits with the nodes. This tool can be used to edit layers “in-place.”
  • 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). The 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.
  • Convert - XPSWMM GIS inlet layers to SWMM: This tool will convert GIS layers exported from XPSWMM with the required attributes to SWMM inlet data and a GeoPackage layer for inlet usage.
  • GeoPackage - Add Sections: This tool adds tables (spatial or otherwise) representing SWMM sections to an existing GeoPackage.
  • GeoPackage - Create: This tool creates a SWMM GeoPackage file with the selected SWMM sections.
  • 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 yet directly read the GeoPackage format.
  • 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.
  • Junctions - Downstream junctions to outfalls This tool converts SWMM junctions at the downstream end of conduits to outfalls as required by SWMM. This can be especially helpful for models exported for XPSWMM or converted from GIS data which do not distinguish between junctions and outfalls.
  • Junctions - Set attributes This tool sets the SWMM junction attributes “Ymax” and “Ysur” based on whether they receive subcatchment flows, if they are connected to the 2D domain, and if the connection uses a stormwater drain inlet.
  • Outfalls - Fix multiple connected links: SWMM requires that outfalls be connected to a single 1D channel. This tool will create a small extension (rectangular open channel) to outlets connected to multiple channels, creates a new outlet at the new downstream location, and changes the previous outfall to a junction.

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 yet currently supported. The “Auto Snap” option in the Snapping tool is not yet currently supported for SWMM networks.

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

TUFLOW-SWMM models also output a GeoPackage time-series output file. The file will be written with the other result files and ends with “_ts.gpkg.” This file can be read into the QGIS TUFLOW Viewer using the “Load Results - Time series” from the File menu of the QGIS viewer. When this file is loaded, point and polyline layers will be loaded representing the node and channel results. The layer symbology can be modified to represent model results for the current QGIS time. Profiles can be also be generated for the 1D network. Animations can be created from these results (in combination with 2D results if desired). These layers can also be used to select channels or nodes to display time series results in the TUFLOW viewer and can be combined with ESTRY or PO outputs. More information about the QGIS TUFLOW Viewer can be found on the TUFLOW Wiki.

4.1.5 SWMM Inclusion in TUFLOW

4.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 calculations was created by Open Water Analytics (McDonnell et al., 2021), which is a modified version of the EPA SWMM code.

4.1.5.2 Embedded SWMM Code in TUFLOW

TUFLOW has modified EPA SWMM code (not from Open Water Analytics) primarily to embed compute pit (inlet) discharges to include additional TUFLOW functionality for linking 1D and 2D domains. 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 that 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 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 the 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 is subject to change. For production models it is recommended that users assign On-Grade or On-Sag to each of their inlets until the automatic approach has been established.

4.2 SWMM-TUFLOW Commands

This section is a reference for the commands available in a TUFLOW-SWMM model.

4.2.1 TUFLOW Control File Commands (TCF)

SWMM Control File == <swmm_control_filename.tscf>

This command identifies the SWMM control file, which contains the relevant commands needed to manage the SWMM simulation.

4.2.2 TUFLOW SWMM Control File Commands (TSCF)

This section describes SWMM related commands that are used in the TUFLOW SWMM Control File (TSCF). Commands for scenario and event management are not included but are supported, such as “If Scenario,” “If Event,” “Else,” or “End If.” Such commands are described in the TUFLOW manual.

Check INP Save Date == [ {ERROR} | WARNING | OFF ]

When working within TUFLOW inp files are often generated by the QGIS plugin from GeoPackage files. This command controls settings to alert the user if the GeoPackage has been updated but the inp has not.

Checks that the save date of the .inp file is later than the save date of the associated .gpkg file. The two files must be located in the same folder. This command is very useful for detecting the possibility that one or more layers in TUFLOW-SWMM GeoPackage file has been modified but has not been exported prior to running the simulation.

For the ERROR option (the default), the simulation terminates and an error message is given. For the WARNING option, a warning is written to the screen and log file, but the simulation proceeds without pausing. It remains the responsibility of the user to check for any warnings. The OFF option disables all checks and no warnings are given.

Inlet Surcharge Orifice Coefficient == [0.16]

Specifies the coefficient for the orifice equation that is used when an inlet overflows (pressure head is higher than 2D WSE).

Maximum Inlet Ponded Depth == [999]

Prevents unrealistic ponding elevations when using SWMM hydrology to convey subcatchment flows directly to pipe network nodes connected to the 2D domain. Without this command flows from the 1D to the 2D domain are determined based on the orifice equation. However, because of the unrealistic nature of adding the flows directly to the pipe network this can lead to unreasonable water levels in ponded SWMM nodes. When the 1D domain water level at the node inlet is above the specified value, the ponded volume above this level will be transfered to the 2D domain in the next SWMM timestep.

Output Folder == <Folder>

Redirects the SWMM combined inp file and all SWMM output data to another folder. Typically used to write output to your local drive instead of filling up a network drive, or to keep results separate to the input data. A URL path can be used (e.g. \bmtserv), which is useful for running simulations on other computers, but having the output directed to your local drive or other location (your drive will need to be shared). The default location for 1D output is that specified using Output Folder in the .tcf file for 2D/1D models.

Read SWMM == <swmm_inp_filename>

This command adds the SWMM input file to the SWMM simulation. Multiple SWMM input files can be specified which will be combined into a single 1D SWMM simulation.

Read GIS SWMM Inlet Usage == <swmm_inlet_usage_filename>

This command reads a SWMM inlet usage filename to identify locations and attributes of inlets (pits) that connect the 2D TUFLOW and 1D SWMM models.

SWMM Iterations == [1]

Controls the number of iterations that are run for each 2D timestep. Increasing the number decreases the timestep used by SWMM potentially improving model stability but increasing run time.

4.3 SWMM Input Files

A summary of the available input layers is contained within Table 4.2 and a detailed description provided for each in Appendix A. This information has been taken from the SWMM 5 API Guide (EPA, 2023), with modifications. If a GeoPackage is created from an inp file created by EPA SWMM, the following tables may be retained and exported to future inp files but do not affect model simulations and are not documented here:

  • Backdrop
  • Labels
  • Symbols
  • Tags
  • Map

Input layers are read into the SWMM Control File with the Read SWMM == command.

Table 4.2: SWMM Input layers
Category Input Description Geometry Table
BC Inflows Specifies external hydrographs and pollutographs that enter the drainage system at specific nodes. Point Table A.1
Curves Curves Describes a relationship between two variables in tabular format. No Geometry Table A.2
Curves Timeseries Describes how a quantity varies over time. No Geometry Table A.3
Groundwater Aquifers Supplies parameters for each unconfined groundwater aquifer in the study area. Aquifers consist of two zones – a lower saturated zone and an upper unsaturated zone with a moving boundary between the two. No Geometry Table A.4
Groundwater Groundwater Supplies parameters that determine the rate of groundwater flow between the aquifer underneath a subcatchment and a node of the conveyance system. Region Table A.5
Groundwater GWF Defines custom groundwater flow equations for specific subcatchments. Region Table A.6
Hydrology Adjustments Specifies optional monthly adjustments to be made to temperature, evaporation rate, rainfall intensity and hydraulic conductivity in each time period of a simulation. No Geometry Table A.7
Hydrology Evaporation Specifies how daily potential evaporation rates vary with time for the study area. No Geometry Table A.8
Hydrology Hydrographs Specifies the shapes of the triangular unit hydrographs that determine the amount of rainfall-dependent infiltration/inflow (RDII) entering the drainage system. No Geometry Table A.9
Hydrology Patterns Specifies time patterns of dry weather flow or quality in the form of adjustment factors applied as multipliers to baseline values. No Geometry Table A.10
Hydrology Raingages Identifies each rain gage that provides rainfall data for the study area. No Geometry Table A.11
Hydrology RDII Specifies the parameters that describe rainfall-dependent infiltration/inflow (RDII) entering the drainage system at specific nodes. Point Table A.12
Hydrology Snowpacks Specifies parameters that govern how snowfall accumulates and melts on the plowable, impervious and pervious surfaces of subcatchments. No Geometry Table A.13
Hydrology Temperature Specifies daily air temperatures, monthly wind speed, and various snowmelt parameters for the study area. Required only when snowmelt is being modeled or when evaporation rates are computed from daily temperatures or are read from an external climate file. No Geometry Table A.14
Inlets Inlet Usage Assigns inlet structures to specific street and open channel conduits. Point Table A.15
Inlets Inlets Defines inlet structure designs used to capture street and channel flow that are sent to below ground sewers. No Geometry Table A.16
LID Lid_controls Defines scale-independent LID controls that can be deployed within subcatchments. No Geometry Table A.17
LID Lid_usage Deploys LID controls within specific subcatchment areas. Region Table A.18
Links Conduits Identifies each conduit link of the drainage system. Conduits are pipes or channels that convey water from one node to another. Line Table A.19
Links Controls Determines how pumps and regulators will be adjusted based on simulation time or conditions at specific nodes and links. No Geometry Table A.20
Links Losses Specifies minor head loss coefficients, flap gates, and seepage rates for conduits. Line Contained within Table A.19
Links Orifices Identifies each orifice link of the drainage system. An orifice link serves to limit the flow exiting a node and is often used to model flow diversions and storage node outlets. Line Table A.21
Links Outlets Identifies each outlet flow control device of the drainage system. These are devices used to model outflows from storage units or flow diversions that have a user-defined relationship between flow rate and water depth. Line Table A.22
Links Pumps Identifies each pump link of the drainage system. Line Table A.23
Links Streets Describes the cross-section geometry of conduits that represent streets. No Geometry Table A.24
Links Transects Describes the cross-section geometry of natural channels or conduits with irregular shapes following the HEC-2 data format. No Geometry Table A.25 and Table A.26
Links Weirs Identifies each weir link of the drainage system. Weirs are used to model flow diversions and storage node outlets. Line Table A.27
Links Xsections Provides cross-section geometric data for conduit and regulator links of the drainage system. Line Contained within Table A.19, Table A.21 and Table A.27.
Nodes Dividers Identifies each flow divider node of the drainage system. Flow dividers are junctions with exactly two outflow conduits where the total outflow is divided between the two in a prescribed manner. Point Table A.28
Nodes DWF Specifies dry weather flow and its quality entering the drainage system at specific nodes. No Geometry Table A.29
Nodes Junctions Identifies each junction node of the drainage system. Junctions are points in space where channels and pipes connect together. For sewer systems they can be either connection fittings or manholes. Point Table A.30
Nodes Outfalls Identifies each outfall node (i.e., final downstream boundary) of the drainage system and the corresponding water stage elevation. Only one link can be incident on an outfall node. Point Table A.31
Nodes Storage Identifies each storage node of the drainage system. Storage nodes can have any shape as specified by a surface area versus water depth relation. Point Table A.32
Project Files Identifies optional interface files used or saved by a run. No Geometry Table A.33
Project Options Provides values for various analysis options. No Geometry Table A.34
Project Report Describes the contents of the report file that SWMM produces. No Geometry Table A.35
Project Title Attaches a descriptive title to the project being analyzed. No Geometry Table A.36
Hydrology Infiltration Supplies infiltration parameters for each subcatchment. Rainfall lost to infiltration only occurs over the pervious subarea of a subcatchment. Region Contained within Table A.37
Hydrology Subareas Supplies information about pervious and impervious areas for each subcatchment. Each subcatchment can consist of a pervious subarea, an impervious subarea with depression storage, and an impervious subarea without depression storage. Region Contained within Table A.37
Hydrology Subcatchments Identifies each subcatchment within the study area. Subcatchments are land area units that generate runoff from rainfall. Region Table A.37
WQ Buildup Specifies the rate that pollutants build up over different land uses between rain events. No Geometry Table A.38
WQ Coverages Specifies the percentage of a subcatchment’s area that is covered by each category of land use. Region Table A.39
WQ Landuses Identifies the various categories of land uses within the drainage area. Each subcatchment area can be assigned a different mix of land uses. Each land use can be subjected to a different street sweeping schedule. Land uses are only used in conjunction with pollutant buildup and wash off. No Geometry Table A.40
WQ Loadings Specifies the pollutant buildup that exists on each subcatchment at the start of a simulation. Region Table A.41
WQ Pollutants Identifies the pollutants being analyzed. No Geometry Table A.42
WQ Treatment Specifies the degree of treatment received by pollutants at specific nodes of the drainage system. Point Table A.43
WQ Washoff Specifies the rate at which pollutants are washed off from different land uses during rain events. No Geometry Table A.44

4.4 2023-03-AF Minor Enhancements and Bug Fixes

4.4.1 Bug Fix - Eliminate Crash when Writing SWMM Inlet Check File with Shapefiles

Build 2023-03-AF fixes a crash that can occur when writing check files in shapefile format if the model includes SWMM inlets.

4.4.2 Bug Fix for Default Selection of 2D Cell Selection Strategy Based on Inlet Placement

Build 2023-03-AF correctly defaults the approach for selecting additional 2D cells with the connection width attribute based on the inlet usage placement approach. Previously, this was not always defaulting the correct method.

4.4.3 Bug Fix - Elevations for Cells Connected to SWMM Inlets

Build 2023-03-AF fixes an issue where connected 2D cells were lowered to the SWMM pipe invert instead of the connected inlet elevation.

4.4.4 Bug Fix - Incorrect Number of Linked Cells

Build 2023-03-AF fixes an issue when using a negative connection width for a SWMM inlet usage. The negative number should represent the total number of 2D cells to connect to the inlet. This was misinterpreted and representing one more than it should have. A related issue was fixed that only affected Quadtree models. For some situations, HPC models with positive width values linked to one more cell than intended.

4.4.5 Bug Fix - Non-standard Filenames for SWMM Results

Build 2023-03-AF fixes an issue where TUFLOW filenames using non-standard characters such as “-” that end up in GeoPackage tables gave an SQL error. Using non-standard characters is now supported in the 2023-03-AF build.

4.4.6 Bug Fix for Error Reporting

Build 2023-03-AF fixes a somewhat ironic issue where TUFLOW would crash while trying to retrieve and display an error message from SWMM. This memory error happened for some models and not others.

4.4.7 Prevent SWMM Nodes Connecting to both 2D (HX) and ESTRY

Build 2023-03-AF gives an error message and exits if a model has a node that is connected to both the 2D model and an ESTRY node. This configuration is invalid. The solution is generally to split the ESTRY 1D network and have part connected only to the 2D and the other part connected to SWMM.

4.4.8 Bug Fix - Mass Reporting Issue with ESTRY-SWMM Connected Models

Build 2023-03-AF fixes an issue where an ESTRY-SWMM connected model was not correctly calculating mass errors and reported a much higher error than was occurring in the model.

4.4.9 Bug Fix - SWMM GPKG Timeseries Output using Elevation Offsets

Build 2023-03-AF fixes an issue where the wrong elevations were written to the SWMM GeoPackage time-series files when the option “LINK_OFFSETS” is set to “ELEVATION.”

4.4.10 Bug Fix - FORTRAN Crash for Models using both SWMM and ESTRY

Build 2023-03-AF fixes a crash that sometimes occurred for models that contain both ESTRY and SWMM 1D components.

References

EPA. (2023). SWMM 5 API Guide. https://epa.gov/system/files/other-files/2023-08/Swmm5.2.4-ApiGuide.zip
McDonnell, B., Wu, J. X., Ratliff, K., Mullapudi, A., & Tryby, M. (2021). Open Water Analytics Stormwater Management Model (Version 5.1.13). Zenodo. https://doi.org/10.5281/zenodo.5484299