RiverFlow2D Tutorials
RiverFlow2D Tutorials
Hydronia LLC
OilFlow2DTM , RiverFlow2DTM models, and documentation produced by Hydronia, LLC, Pembroke Pines, FL. USA.
Information in this document is subject to change without notice and does not represent a commitment on part of Hydronia,
LLC. The software described in this document is furnished under a license agreement.
RiverFlow2D, OilFlow2D, RiverFlow2D, and RiverFlow2D GPU are copyrighted by Hydronia, LLC. 2011-2023.
OilFlow2DTM and RiverFlow2DTM are registered trademarks of Hydronia, LLC.
All other products or service names mentioned herein are trademarks of their respective owners.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form
or by any means electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of
Hydronia, LLC.
Last document modification date: June, 2023.
Technical Support: [email protected]
Web site: www.hydronia.com
Content
List of Figures vi
1 Introduction 1
4 Simulating bridges 27
4.1 Create a bridge geometry file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2 Open an existing project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.3 Enter the bridge polyline in the Bridges layer . . . . . . . . . . . . . . . . . . . . . 30
4.4 Generate the mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
4.5 Exporting files to RiverFlow2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
4.6 Running the Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5 Simulating culverts 38
5.1 Open an existing project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.2 Create Culverts layer and draw the culvert . . . . . . . . . . . . . . . . . . . . . . . 41
5.3 Generate the mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.4 Exporting files to RiverFlow2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.5 Running the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
ii
5.6 Review culvert output file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
8 Simulating bed load sediment transport with limited erosion bed areas 62
8.1 Open an existing project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.2 Add MaximumErosionDepth layer and draw the polygon that defines the area of
limited erosion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.3 Generate the mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.4 Exporting files to RiverFlow2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.5 Running the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.6 Check the output files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
9 Hydrologic simulations 71
9.1 Create the rainfall and evaporation time series data file . . . . . . . . . . . . . . . . 72
9.2 Create the infiltration parameters data file . . . . . . . . . . . . . . . . . . . . . . . 73
9.3 Open an existing project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
9.4 Add the RainEvap component layer, and the rainfall/evaporation polygons . . . . . 74
9.5 Add the Infiltration component layer, and the Infiltration polygons . . . . . . . . . . 76
9.6 Generate the mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
9.7 Exporting files to RiverFlow2D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.8 Running the model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
9.9 Review the output files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
vi
3.10 Control data panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3.11 Weirs component data panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.12 RiverFlow2D output graphics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.13 Extract of the output file of the Weir1. . . . . . . . . . . . . . . . . . . . . . . . . . 26
10.1 DEM used, with the location of the manhole. The course of the storm drain is
indicated, although irrelevant to the modeling. Purple lines: outline of roads and
pavements. Black lines: building outlines. Triangles: output point locations. . . . 86
10.2 Inflow hydrograph applied at upstream end of storm drain. . . . . . . . . . . . . . 86
10.3 Storm drain profile. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
10.4 QGIS interface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
10.5 Coordinate Reference System Selector dialog window. . . . . . . . . . . . . . . . 95
10.6 Create New RiverFlow2D Project. . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
10.7 Layers created for the project. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
10.8 Digital elevation model in raster format. . . . . . . . . . . . . . . . . . . . . . . . . 97
10.9 Window to change the raster layer render style. . . . . . . . . . . . . . . . . . . . 98
10.10 Digital elevation model with color render. . . . . . . . . . . . . . . . . . . . . . . . 98
10.11 Import EPA-SWMM INP file command . . . . . . . . . . . . . . . . . . . . . . . . 99
10.12 .INP successfully loaded . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
10.13 Surface water-SWMM exchange nodes. . . . . . . . . . . . . . . . . . . . . . . . 99
10.14 Menu buttons for digitalization toolbar. . . . . . . . . . . . . . . . . . . . . . . . . 100
10.15 Modeling area delimitation on the Domain Outline layer. . . . . . . . . . . . . . . 100
10.16 CellSize defined for the Domain Outline layer. . . . . . . . . . . . . . . . . . . . . 101
10.17 Domain Outline layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
10.18 Editing the Manning N layer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
10.19 Dialog to input Manning N Feature Attributes. . . . . . . . . . . . . . . . . . . . . 103
10.20 Polygon that covers the nodes defining the Outflow boundary condition segment. 103
10.21 Outflow Boundary Condition. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
10.22 Resulting mesh. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
10.23 Export RiverFlow2D dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
10.24 Hydronia Data Input Program window. . . . . . . . . . . . . . . . . . . . . . . . . 106
10.25 Storm Drain Dialog. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
10.26 Morel Report Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
10.27 Maximum depths. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
15.1 Areas with overlap and empty spaces in manual digitization of adjacent polygons. 166
15.2 Project screen loaded in QGIS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
15.3 QGIS Options / Digitizing Window. . . . . . . . . . . . . . . . . . . . . . . . . . . 169
15.4 QGIS with snapping panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
15.5 Snapping configuration panel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
15.6 The first polygon sketch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
15.7 Drawn of the second polygon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
15.8 Final draw of the second polygon. . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
15.9 Preliminary draw of the third polygon. . . . . . . . . . . . . . . . . . . . . . . . . 173
15.10 Final draw of the third polygon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
15.11 Preliminary draw of the fourth polygon. . . . . . . . . . . . . . . . . . . . . . . . . 174
15.12 Final draw of the fourth polygon. . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
15.13 Preliminary draw of the fifth polygon. . . . . . . . . . . . . . . . . . . . . . . . . . 175
15.14 Final draw of the fifth polygon. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
15.15 Final draw of the Manning N layer. . . . . . . . . . . . . . . . . . . . . . . . . . . 176
15.16 Polygon to be deleted selected. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
15.17 Manning N layer with the polygon removed. . . . . . . . . . . . . . . . . . . . . . 177
18.1 Drop-down list for displaying and selecting project scenarios . . . . . . . . . . . . 206
18.2 Tool to create a new scenario within the project . . . . . . . . . . . . . . . . . . . 206
18.3 Tool to convert existing project to multi-scenario . . . . . . . . . . . . . . . . . . . 206
18.4 Menu to create a new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
18.5 Dialog window to create a new RF2D project . . . . . . . . . . . . . . . . . . . . 207
18.6 Menu for creating a new scenario in an RF2D project . . . . . . . . . . . . . . . . 208
18.7 Window to create a new scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
18.8 Switching scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
18.9 Confirmation window for switching the scenario. . . . . . . . . . . . . . . . . . . . 209
18.10 Menu button to delete a scenario. . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
18.11 Menu to import a project to multi-scenario mode . . . . . . . . . . . . . . . . . . 210
18.12 Import tool window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Introduction
1
RiverFlow2D is a combined hydrologic and hydrodynamic, mobile bed, and pollutant transport
finite-volume model for rivers, estuaries, coastal areas, and floodplains. It can simulate floods
and inundation over complex terrain at high resolution and with remarkable stability, accuracy and
speed. The use of adaptive triangular-cell meshes enables the flow field to be resolved around
key features in difficult river environments.
Hydronia computational engines use an accurate, fast and stable finite-volume solution method
that eliminates the boundary and hot start difficulties of some two-dimensional flexible mesh mod-
els. RiverFlow2D also includes capability to represent dam or levee breaches and can integrate
hydraulic structures such as culverts, weirs, bridges, and gates. The hydrologic capabilities in-
clude spatially distributed rainfall, evaporation and infiltration. This current version can integrate
the effect of spatially distributed wind stresses on the water surface.
The user interface of Hydronia models is based on QGIS, a powerful software for the analysis of
geographic information systems of free distribution. This software system integrated with GMSH
mesh generation plugin provides interactive functions to generate and refine the finite-volume
flexible mesh, and uses familiar GIS objects to construct a high level representation of the model.
QGIS also offers a complete set of visualization tools that include rendering, for the representation
of the results generated by the model.
1
Creating your first RiverFlow2D project
2
This section provides a step-by-step guide to help you get started with a RiverFlow2D project
using the QGIS interface. The example illustrates the model application to simulate flow in a river
with a single inflow upstream and a single outflow downstream. It includes instructions to enter
the terrain elevation data, create the mesh, prepare the layers with the input information, and run
the model.
The first step is to start the QGIS software clicking the QGIS desktop icon . If this icon is not
available, you can run the qgis-bin.exe executable on the QGIS bin subdirectory. After loading,
2
3 Creating your first RiverFlow2D project
If you don’t see the toolbar with the model icons as shown, you will need to activate the plugin
using the Manage and Install Plugins... command under the Plugins menu.
1. To create a new RiverFlow2D project, click on the New RiverFlow2D Project button in
the toolbar. to start a new RiverFlow2D project. A dialog window appears where you select
the layers that will be created, the Coordinate Reference System (CRS), and the directory
path where the layers will be saved. This example will use the basic layers: Domain Outline,
Manning N, and BoundaryConditions
2.2 Start a new project 4
3. Select the Projection button. Note that QGIS sets EPSG:4326 by default, but it should be
changed to the actual projection code corresponding to the project data.
4. In the Filter textbox, type 2855 and select the Coordinate Reference System as shown:
5. Click OK.
7. Click the button to provide a path to store the project files in the Project Directory
textbox. This will be the folder where the model will write all results and output files.
8. After clicking OK, the layer templates are created, and displayed on the Layers Panel
The model will use the unit system as that defined in the projection you selected. If the
projection has coordinates in feet, units will be set to English. If the projection coordinates
are in meters, units will be set to Metric/SI.
9. On the QGIS Project menu, click Save, to save the project in the same directory that you
previously selected in the Create New Project dialog above.
1. To load an ASCII grid file, click the Add Raster Layer button .
2. In the dialog search for the tutorial folder and select the hohdem2.asc file as shown:
3. While on the dialog, click Add and then select the CRS for this layer that should be the same
used in the project EPSG: 2855). Then click OK and Close.
2.3 Load elevation data 6
4. Click OK.
Right-clicking on the label of the new raster layer and selecting Properties allows you to
change the rendering style for a more informative palette such as Hillshade for instance.
And now the raster layer is displayed with the new palette selected:
7 Creating your first RiverFlow2D project
6. You may move the raster layer dragging it to the end of the list of layers to avoid that it would
hide or interfere visually with the other layers.
1. Click the Domain Outline layer to activate it and then click Toggle Editing (pencil) in the
toolbar
2. This activates the rest of the editing buttons. Now click the Add Feature tool which is the
bean-looking polygon .
Proceed to delineate the outline of the polygon by clicking the vertices with the left mouse
button.
Make sure that the polygon is contained within the limits of the raster layer since the program
will not extrapolate elevations to areas that are outside of the available data on the raster
layer.
3. To finalize and close the polygon, right-click on the map view area. A dialog window to input
the cell size attribute of the newly created polygon will appear. The CellSize value for the
reference size of the mesh cell is indicated. Enter a value of 20 m.
2.5 Generating the triangular-cell mesh 8
If you want to make any correction in the outline of the created polygon, use the Node Tool
.
5. and click on Toggle Editing button to deactivate the layer Edit mode
The Domain Outline is now complete.
You can see the mesh generation statistics, and other messages produced by the mesh genera-
tion program while creating the mesh,in the Log messages panel. This window is accessed from
the View menu, then by clicking Panels.
2. Click the Toggle Editing button to add the polygons that will indicate the open boundary
segments where inflow and outflow conditions are imposed. Draw a polygon at the upper
end of the mesh as indicated in the figure:
Figure 2.15 – Polygon that covers the nodes defining the Inflow boundary condition segment.
3. To finish the polygon, right-click on desired location. A window to enter the attributes of the
newly created polygon is displayed.
4. In the Boundary Cond. ID enter the desired name or leave the default.
6. Click Import BC File button, and search for the QIN.DAT hydrograph file as shown below:
1. Draw the polygon defining the outflow boundary condition at the downstream end of the
channel as shown.
Figure 2.18 – Polygon that defines the outflow boundary condition segment.
2. Right click to close the polygon. A dialog window will appear to enter the parameters. Select
the condition type Uniform flow conditions and enter the channel slope. Slope is entered in
So as shown:
Figure 2.19 – Parameters for the uniform flow outflow open boundary condition.
3. Save the changes made to the layer by clicking the Save button .
The figure below shows how the BoundaryConditions layer should look:
Figure 2.20 – Polygons that define the inflow and outflow boundary conditions.
1. Select the Manning N layer and click the Toggle Editing button .
2. Draw a polygon that covers the entire domain. The polygon may extend beyond the mesh
area as shown:
13 Creating your first RiverFlow2D project
3. Close the polygon by right-clicking on the end vertex and enter a Manning’s n equal to 0.035:
4. Click Save , and then click the Toggle Editing button to deactivate editing mode.
Save the QGIS project using the Save command in the Project menu. Name the project file
Hoh.qgs.
2.8 Exporting the files 14
1. In the RiverFlow2d plugin toolbar, click the Export files for RiverFlow2d button and select
Export RiverFlow2d ...
2. In the export dialog window indicate the Project Name and the raster layer of the Digital
Elevation Model (DEM).
3. Click OK.
A message at the top of the Map area shows the progress of the Export process.
Once the model files have been created, the Hydronia Data Input Program will appear au-
tomatically with the main control data file loaded, in this case: Hoh.DAT.
15 Creating your first RiverFlow2D project
4. Click the Run RiverFlow2D button to run the model. An image similar to the one shown
below should appear:
Figure 3.1 – The weir polyline representing the levee is shown in red.
The procedure to incorporate the weir in a RiverFlow2D simulation involves the following steps:
16
17 Simulating levees using weirs
The files required to follow this tutorial can be found in the following directory:
...MyDocuments\RiverFlow2D QGIS\ExampleProjects\WeirsTutorial
2. On the Project menu click Open... and browse to select the existing project: WeirsTutorial.qgs.
This project contains the following layers: Domain Outline, Digital Elevation Model (DEM)
of the river bed in raster format, aerial photography, polygon with the Manning coefficient
and the polygons with the boundary conditions where the flow entrance is in the upper left
corner and exit in the lower left corner. The boundary conditions are a hydrograph with a
peak discharge of 220,000 f t3 /s, and outflow condition is set to uniform flow. When you
open the project you will have a project image loaded in QGIS as shown in Figure 3.2:
• The first line must indicate the number n of nodes that contains the polyline.
• The n successive lines will contain three columns with the X, Y coordinates.
• The elevation of the weir crest separated by space as shown in Figure 3.3:
1. Create Weirs layer: for this click on the New Template Layer button in the RiverFlow2D
toolbar
3. Edit the Weirs layer: In the layer panel, select the Weirs layer and in the digitalization toolbar
click on the Toggle Editing button
A pencil icon will appear in the Weirs layer indicating that the layer is in edit mode:
4. Draw the line representing the weir: Using the Add Feature tool from the digitalization bar
Draw a line anywhere in the map area (just mark two vertices or nodes. This line will then
be replaced by the coordinates of the file to be imported)
5. Right-click to finish the layout and a dialog window will appear to input the weir parameters.
6. Input the weir parameters: The window to input the weir attributes contains two tabs. In the
first one there are the fields of the general parameters, within which has:
3.2 Create a Weirs layer and the weir polyline 20
The weir parameters window should look like the image shown below:
In the second tab ’Weir crest elevation for vertex’ the data contained in the file LeveeRB Breakline.txt
is displayed, as shown in the following Figure:
8. Save the changes in the layer using the Save button of the digitalization toolbar
21 Simulating levees using weirs
9. Disable the editing mode of the layer with the Toggle Editing button
and we will have on screen an image similar to the one shown below where you can see the
layout of the weir:
2. When running the plugin a window is displayed, here we must select the raster layer that
contains the Digital Elevation Model (DEM) and the name of the project to be exported.
Enter the name without any extension.
3. Before executing the plugin, activate the layer with the DEM (if it is disabled) and turn off the
MeshDensityLine layer since it does not have any element.
Once the plugin is executed, a window will be shown (Figure 3.9), as it should be for our
example.
23 Simulating levees using weirs
4. After inputting the data, click on the OK button and the export process will begin. Once it is
finished, Hydronia Data Input Program will be loaded as shown in Figure 3.10
1. In the list of components, select ’Weirs’ and the panel of the Weirs component will appear.
In this window the contents of the .WEIRS file content as prepared by RiverFlow2D will be
displayed (Figure 3.11).
3.5 Running the model 24
3. Click on the Run RiverFlow2D button in the lower section of Hydronia Data Input Program.
A window will appear indicating that the model began to run. The window also informs the
simulation time, the volume conservation error, the total input and output discharge and
other parameters as the execution progresses (Figure 3.12).
• EDGE: The segments into which the weir is divided and is given by the length of the cells in
contact with the weir,
• N1 and N2: The numbers that identify the cells that share the EDGE segment in the weir,
• WSE1 and WSE2: The elevations of the water surface in the cells indicated by N1 and N2,
• D1 and D2: The depths of the flow in the cells indicated by N1 and N2,
The files required to follow this tutorial can be found in the following directory:
...MyDocuments\RiverFlow2D QGIS\ExampleProjects\BridgesTutorial
27
4.1 Create a bridge geometry file 28
can use the Bridges panel in the Hydronia Data Input Program to perform the adjustments nec-
essary to the geometry generated by QGIS. This option is useful when the bridge is located on a
natural section of the river, and the geometry of the bridge is simple (Figure 4.1a). However, other
cases may involve more complex bridge geometries (Figure 4.1b), that require a more detailed
preparation of the bridge geometry file.
Figure 4.2 shows the front view of the bridge that you will to incorporate into the model for this
tutorial. The data is also in the file BRIDGEGEOMETRY.DAT contained in the directory of this tutorial.
It represents the cross section of a bridge with only one central pier, although this is just for
the purpose of illustrating the Bridges component in this tutorial since the actual bridge in this
location has about 12 sets of piers. This geometry is represented in the RiverFlow2D model using
the bridge geometry file shown below, where the header row is presented only to describe the
parameters, and they should not be included in the actual data file:
29 Simulating bridges
You may use the Bridges panel in Hydronia Data Input Program to create to some extent, or edit
a bridge geometry file (see Figure 4.4). The program lets you enter data in tabular form and view
a graph of the bridge geometry. You may also manipulate the graphical lines, which will make that
the tabular data be modified.
An alternative way to create the bridge geometry file is to use a spreadsheet. In the folder for this
tutorial there is a MS-Excel sheet (BridgesGeometryPlot.xlsx) that allows editing and plotting
bridge geometry files.
1. Create a new Bridges layer: for this, go to the RiverFlow2D toolbar of and click with the
mouse on the New Template Layer button
31 Simulating bridges
in the plugin window we activate the Bridges checkBox, as shown in the Figure below
2. Edit the Bridges layer: In the layers panel we select the Bridges layer then in the digitaliza-
tion toolbar we click with the mouse on the Toggle Editing button
A pencil icon will appear in the Bridges layer that tells us that the layer is in edit mode:
3. Draw the line representing the bridge: (if necessary, turn off the DEM layer so that it does
not interfere with the identification of the bridge site in the aerial photograph).
draw the line indicating the location of the bridge. In the case shown, to demarcate the line
that indicates the location of the bridge, it is only necessary to indicate two vertices (initial
4.3 Enter the bridge polyline in the Bridges layer 32
and final), then click with the right button to finish the drawing and we will have an image
similar to the one shown in the following figure:
5. Enter the bridge data: After the bridge layout is finished, the window to input the attributes
of the bridge created is immediately displayed, these are:
The figure below shows the attributes window of the Bridges layer:
33 Simulating bridges
6. After entering the values, click on the [Check Fields] button, then click the [OK] button.
7. Save the changes in the layer using the save button of the digitalization toolbar:
and disable the editing mode of the layer with the Toggle Editing
check that the resulting mesh is perfectly aligned with the bridge as shown in Figure 4.9.
4.5 Exporting files to RiverFlow2D 34
In the export files dialog we need to make sure that the appropriate raster layer correspond-
ing to the Digital Elevation Model (DEM) is selected. Also enter the name of the project; only
the name must be indicated without any extension.
Once the complement is executed, a window is presented as shown in Figure 4.10, as it
should be for our example.
35 Simulating bridges
2. After input the information, click on the OK button and the export process will begin.
Once finished, the RiverFlow2D program will be loaded with the .DAT file of the specific
example.
Select the Bridges panel to review the contents of the bridge geometry file (Figure 4.12). Note
how the bridge profile was discretized every 150 feet according to the element size imposed to
the bridge line.
4.6 Running the Model 36
38
39 Simulating culverts
The water enters from upstream with a constant discharge of 1000 cfs, and outflows downstream
along the indicated section. The area is initially dry. The culvert has a circular cross section, and
other characteristics as summarized in the following Table (CulvertA). CulvertB data is provided
in case that you wanted to extend the tutorial adding a second culvert to the project.
The procedure to integrate this culvert into a RiverFlow2D simulation involves the following steps:
The files required to follow this tutorial can be found in the following directory:
...MyDocuments\RiverFlow2D QGIS\ExampleProjects\CulvertTutorial
2. On the Project menu click Open... and browse to the existing project: CulvertTutorial.qgs.
This project contains the following layers: Domain Outline, Digital Elevation Model (DEM) in raster
format, polygon with the Manning’s n coefficient, and the boundary condition polygons. The inflow
is located in the upper left, and the outflow in the lower left. The boundary conditions corresponds
to a constant discharge of 1000 f t3 /s, and outflow conditions is set to free. Figure 5.2 shows the
opened project.
3. Edit the Culverts layer: In the layers panel, select the Culverts layer and in the digitalization
toolbar we click on the Toggle Editing button
A pencil icon will appear in the Culverts layer indicating that the layer is in edit mode:
4. Draw the line representing the culvert alignment: Using the tool Add Feature from the digi-
talization toolbar
5.2 Create Culverts layer and draw the culvert 42
draw the line that represents the culvert. It is only necessary to indicate two vertices.
5. Click with the right button to finish, and you should get an image similar to the one shown in
the following Figure:
6. Enter the culvert data: After the culvert drawing is finished, the window to input the culvert
attributes immediately appears. The dialog window has 2 tabs, in the General tab you enter
the basic data for circular and box culverts:
8. Save the changes in the layer using the Save button of the digitalization toolbar
9. Disable the editing mode of the layer with the Toggle Editing button
2. Select the raster layer that contains the Digital Elevation Model (DEM) and the name of the
project to be exported. Indicate a name without any extension, in this case, CulvTutorial.
3. Before running the plugin, activate the layer with the DEM (if it is disabled) and deactivate
the MeshDensityLine layer, since it does not have any element.
Once the plugin is executed, a window will be shown (Figure 5.7), as it should be for our example.
45 Simulating culverts
After input the information, click on the OK button and the export process will begin, once finished,
the RiverFlow2D program will be loaded with the CulverTutorial.DAT file.
Note that the Culverts Component appears selected. On the left side of the Control Data panel, in
the list of components select Culverts to activate the Culverts panel. The contents of the culvert
file prepared by QGIS will be displayed (Figure 4.10).
5.5 Running the model 46
For this exercise, a file with the time evolution of the breaching dimensions is required, this file can
be prepared before setting the model or it can be created when entering the input the parameters.
The procedure to model the dam break involves the following steps:
48
49 Simulating dam breaches
2. Create a DamBreach layer and to draw a line that represent the transverse axis of the dam.
The files required to follow this tutorial can be found in the following directory:
...MyDocuments\RiverFlow2D QGIS\ExampleProjects\DamBreachTutorial
2. On the Project menu click Open... and browse to the existing project: DamBreach.qgs.
This project contains the Domain Outline layer, the digital elevation model DEM of in raster format,
outflow conditions are set to free outflow in the lower left, and an initial condition of water surface
elevation behind the dam. Figure 6.2 shows the project in QGIS.
6.2 Create the DamBreach layer and draw the line that
defines the dam
Creating the dam involves the following steps:
1. Create the template for the DamBreach layer: in the RiverFlow2D toolbar click on the New
Template Layer button
6.2 Create the DamBreach layer and draw the line that defines the dam 50
3. Edit the DamBreach layer: In the layers panel, select the DamBreach layer.
A pencil icon will appear in the DamBreach layer, indicating that the layer is in edit mode:
5. Draw the line that defines the axis of the dam: Using the Add Feature tool of the digitalization
toolbar
51 Simulating dam breaches
6. Draw the line that defines the dam axis. Keep in mind that the breach centroid is measured
from the first vertex of the dam line. In this example it occurs 550 feet from the left margin
of the dam (Figure 6.1). The dam axis is drawn from the top of the channel (point v0) to
the bottom (point v1) along one side of the polygon that defines the initial water surface
elevation, as illustrated in the image below.
7. Once finished drawing the dam axis, the window to input the parameters of the DamBreach
appears.
8. Input the information as seen below in the figure and click the Check Fields button:
9. Click the Temporal evolution tab and click on the Import Dam Breach File button. Select the
Breach1.txt file in the project folder. Click OK to close.
10. The temporal evolution of the Breach1.TXT file is shown in the Temporal evolution tab below:
Figure 6.8 – The resulting dam breach mesh. Detail show mesh along the dam axis.
2. Select the raster layer that contains the Digital Elevation Model (DEM) and the name of the
project.
3. Input the name without any extension. For this example it will be: DamBreach.
6.5 Running the model 54
4. Once finished inputting the information, click on the OK button and the export process will
begin. Once it is finished, RiverFlow2D will be loaded with the DamBreach.DAT file.
It can be seen that the Dam Breach component is selected as well as the initial condition that
indicates that the initial elevation of the water surface of the .FED file will be read. Selecting from
the list on the left panel the Dam Breach component will show the panel where you can see the
parameters of the dam breach as shown in the figure below:
3. To run the model, click on the Run RiverFlow2D button in the lower section of Hydronia Data Input Program.
4. Save the changes with the same name as the DamBreach.DAT file.
A window will appear indicating that the model has started running. The window thatRiverFlow2D
presents while running the model shows simulation time information, volume conservation error,
the total input and output discharge as well as other parameters as execution progresses (Figure
6.12).
6.6 Review the output files 56
Sometimes it is practical to use a raster layer to establish the initial condition of the water surface
elevation (Initial WSE). For instance, when modeling tailings dam breaks, it is often necessary to
define the initial surface of the tailings behind the dam.
This tutorial illustrates how to use a raster file that contains the initial elevations of the fluid con-
tained by a dam with the purpose of simulate a dam breach and determine the fluid runout after
the dam collapses.
The procedure of modeling a dam-breach using an initial condition of fluid surface elevation in-
volves the following steps:
2. Import a raster layer with the initial values of the water surface elevation (WSE).
3. Export the files to RiverFlow2D by setting the option to use the raster layer with the Initial
WSE.
The files used in this tutorial can be found in the following directory:
58
59 Establishing initial water, mud, or tailings elevations
1. Open the ASCII grid file representing the initial condition elevations clicking on on the Add
Raster Layer button and selecting the InitiaWSE r.tif file.
2. Confirm the CRS 2229 projection that will be used for this layer
3. If necessary, move the new layer under the group MESH SPATIAL DATA. You should have
an image on the screen like the one shown below:
7.3 Exporting files to RiverFlow2D 60
The image shows the InitialWSE r raster layer in grays gradient where there is a change in
the WSE ranging from 135.0 to 135.4 ft.
The window above has the Trimesh layer disabled for clarity. Re-enable it for the export
process in the next section.
As shown in the figure, click the Options arrow to display the group of options that appear
hidden by default.
2. Select the DEM raster in the DEM (Single Raster) drop down.
3. Check the box Using Initial WSE Raster Layer. Select the InitialWSE r layer from the drop-
down list.
From this point on, run the model in the usual manner as explained in previous tutorials.
Simulating bed load sediment transport with
8
limited erosion bed areas
In the Sediment Transport model you can define areas with a maximum erosion depth. This is
useful to represent pavements, rock outcrops or any surface that does not erode or that it has
a known erodible layer of sediment above it. This tutorial illustrates how to perform a sediment
transport simulation in which there is a non-erodible area using the QGIS interface. The procedure
includes the following steps:
2. Create a MaximumErosionDepth layer and the polygons that define the limited erosion areas.
The files required to follow this tutorial can be found in the following directory:
...\Documents\RiverFlow2D QGIS\ExampleProjects\MaxErosionDepth
2. In the main menu go to Project → Open... browse to the existing project: MaxErosionDepth.qgs.
62
63 Simulating bed load sediment transport with limited erosion bed areas
This project contains the layers of the domain outline, of the digital elevation model DEM of the
river bed in raster format, the layer with the boundary conditions where inflow is located in the
upper left and outflow in the lower left. The boundary conditions are a hydrograph with a peak
discharge of 6,500 f t3 /s and outflow condition is set to free outflow. When you open the project
you will have a project image loaded in QGIS as shown in Figure 8.1.
1. Create the template for the MaximumErosionDepth layer: In the RiverFlow2D toolbar click
on the New Template Layer button
3. Edit the MaximumErosionDepth layer: In the layers panel, select the MaximumErosionDepth
layer and in the digitalization toolbar we click on the Toggle editing button
A pencil icon will appear in the MaximumErosionDepth layer, indicating that the layer is in
edit mode:
4. Draw the polygon of the limited erosion area: Using the Add Feature tool
draw the polygon that defines the area of limited erosion. The polygon should cover all the
cells that will have limiting erosion. In this tutorial we will assume that an area on the river
has the maximum erosion depth limited to 0.1 feet, at the end you should have an image
similar to the one shown in the following figure:
65 Simulating bed load sediment transport with limited erosion bed areas
Once you finish drawing the polygon, the window to input the area parameters immediately
appears. Input a maximum depth of erosion of 0.1 feet, as shown below:
Figure 8.4 – Window for input the polygon parameters of MaximumErosionDepth layer.
8.3 Generate the mesh 66
The results obtained as shown in Figure 8.5 (mesh of close to 17,500 cells).
2. When run the plugin a window is displayed, select the raster layer that contains the Digital
Elevation Model (DEM) and the name of the project to be exported. Input the name without
any extension. For this example it will be: MaxErosion.
3. Before running the plugin activate the layer with the DEM (if it is deactivated).
Once the plugin is executed, a window will be shown (Figure 8.6), as it should be for our
example.
4. Once finished inputting the information, click on the OK button and the export process will
begin.
Once it is finished, tRiverFlow2D will be loaded with the MaxErosion.DAT file of the specific ex-
ample.
Note that the sediment transport module appears selected and displays a message warning that
the file with the sediment information must be created. The procedure includes the following
steps:
1. To create the .SEDB file with the parameters to calculate sediment transport: in the Modules
list select SedimentTransport.
2. Enter the parameters for transport in suspension and bed load transport, for this example
the transport of sediments in suspension is deactivated and bed load transport is left active.
3. Add the sediment fractions to be considered: for this example add a single fraction with the
default values presented by the Hydronia Data Input Program, we will have an image similar
to the one shown in the following Figure:
4. Click the [Save SED* Files] button and leave the default name provided.
5. To run the model, click on the Run RiverFlow2D button in the lower section of Hydronia Data Input Program.
6. Save the changes with the same name of the MaxErosion.DAT file, then a window will ap-
pear indicating that the model started running.
The window presented while running the model shows: information of the simulation time, the
volume conservation error, the total discharge of the liquid flow in and out and in this case also
shows the sediment load at the inlet and outlet as well as other parameters as the execution
progresses (Figure 8.9).
where DDDD indicates the date, HH, hour, MM minutes and SS seconds.
Column 6 reports the changes in the elevation of the river bed with respect to the initial elevation.
We can also visualize the changes in the elevation of the riverbed generating layers in vectorial
8.6 Check the output files 70
format map from the aforementioned files using the Maps of Results vs Time plugin in QGIS,
specifically the Delta Bed Elevations map:
In the following figure, the river elevation difference map for the end of the run. At the time
0000:02:00:00 it can be observed that the zone where the erosion was limited, does not present
erosion, but deposition:
Figure 8.10 – Maps of elevation difference of the river bed between the initial time and at the end of the
run.
4. Add the template of the RainEvap component layer and the rain/evaporation polygons.
5. Add the template of the Infiltration component layer and the Infiltration polygons.
71
9.1 Create the rainfall and evaporation time series data file 72
Note: The files required to follow this tutorial can be found in the following directory:
...MyDocuments\RiverFlow2D QGIS\ExampleProjects\RainfallInfiltrationTutorial
2. On the Project menu click Open... and browse to the existing project: RainfallInfiltrationTutorial.qgs.
This project contains the information to simulate the rainfall runoff resulting from a 10 yr
storm. The layers contained are the following:
• Domain Outline
• Digital Elevation Model (DEM) in raster format
• Aerial photography
• Polygons with the Manning’s n coefficients
• Cross section at watershed outlet
• Outflow boundary conditions set to free outflow
9.4 Add the RainEvap component layer, and the rainfall/evaporation polygons 74
When you open the project you will have an view similar as that shown in Figure 6-2.
2. In the window check RainEvap, as shown in the Figure below. Then click OK:
75 Hydrologic simulations
3. Edit the RainEvap layer: In the layers panel, select the RainEvap layer and click on the
Toggle Editing button in the digitization bar
A pencil icon will appear in the RainEvap layer, indicating that the layer is in edit mode:
4. Draw the polygon that demarcates the spatial distribution of rainfall and evaporation: Using
the Add Feature tool from the digitalization bar
draw the rainfall/evaporation polygon, as only one file will be used. The polygon should
9.5 Add the Infiltration component layer, and the Infiltration polygons 76
5. Input the parameters or attributes of the RainEvap polygon: just after the polygon is fin-
ished, the dialog to input the parameters will open, clicking on the button [...] search the
Rainfall1.dat file in the folder of this tutorial.
1. To create the Infiltration layer y use the New Template Layer button
3. Edit the Infiltration layer: In the layers panel, select the Infiltration layer and click on the
Toggle Editing tool
A pencil will appear in the Infiltration layer, indicating that the layer is in edit mode:
4. Draw the polygon that demarcates the spatial distribution of the infiltration: Using the tool
Add Feature tool of the digitalization bar, draw the infiltration polygons
9.5 Add the Infiltration component layer, and the Infiltration polygons 78
Figure 9.6 shows the polygons that define the two infiltration zones of the watershed that
are based on the land use and vegetation cover.
5. Draw a polygon for the infiltration2 area trying to maintain the shape as indicated in the
previous figure and that protrudes from the polygon of the Domaine Outline as shown in the
figure below:
6. Once completing the polygon, the dialog to input the parameters opens. Browse to the input
79 Hydrologic simulations
Figure 9.8 – Window to input the parameters for the infiltration2 polygon.
7. To draw the second polygon corresponding to infiltration2 use the snapping option as shown
in the section Advanced Digitalization/Snapping Tutorial and there should be a polygon like
the one shown in the following figure:
8. Once finished drawing the polygon, enter the file name Infiltration1.txt as shown:
Figure 9.10 – Dialog to enter the parameters for the infiltration1 polygon.
When running the export command, you need to select the raster layer that contains the
Digital Elevation Model (DEM), and the name of the project to be exported, only the name
must be indicated without any extension.
When the export files finalizes, a window will be appear as shown in Figure 9.12.
2. After entering the data, click on the OK button and the export process will begin. Once
finished, the RiverFlow2D program will be loaded with the RainfallInfiltration.DAT file.
As shown above, the Rainfall Components Evaporation/Infiltration are selected in the data panel.
1. Under Time control data set the Output interval for components (hrs) to 0.1.
If you have an nVidia GPU installed, you may select the RiverFlow2D GPU radial button
under Model Selection to accelerate the model execution
3. Select Rainfall/Evaporation and the rainfall data contained in the rainfall1.txt file will
appear (Figure 9.14). In the Infiltration panel the data contained in the Infiltration1 and
Infiltration2 files is shown (Figure 9.15).
5. To run the model, click on the Run RiverFlow2D button. A window will appear indicating that
the model began to run. The window also report the simulation time, volume conservation
error, total input and output discharge, and other parameters as the execution progresses
(Figure 9.16).
This tutorial illustrates how to apply the RiverFlow2D Urban Drainage module that integrates
surface flooding with EPA-SWMM storm drain model. The project objective is to assess the
shallow inundation originating from a surcharging underground pipe. The procedure involves
the following steps:
3. Import the surface-storm drain exchange points from the.INP SWMM file.
The files required to follow this tutorial can be found in the following directory:
...MyDocuments\RiverFlow2D QGIS\ExampleProjects\UrbanDrainageTutorial
The pipe is modeled in 1D and connected to the 2D mesh through a manhole. The modeled area
is approximately 0.4 km by 0.96 km (see Figure 10.1). A storm drain of circular section of 1.4m in
diameter and 1340 m in length is assumed to run through the modeled area. The pipe Manning’s
roughness is set to n=0.017. An inflow boundary condition is applied at the upstream end of the
pipe, illustrated in Figure 10.2. A free outfall is considered as downstream boundary condition. A
85
86
base initial flow of 1.6 m3 /s is set as uniform initial condition. A surcharge is expected to occur
at a vertical manhole of 1 m2 cross-section located 467 m from the top end of the culvert at the
coordinates (x=264,896 m,y=664,747 m). The profile geometry of the culvert is given in Table
10.1 and shown in Figure 10.3.
Figure 10.1 – DEM used, with the location of the manhole. The course of the storm drain is indicated,
although irrelevant to the modeling. Purple lines: outline of roads and pavements. Black lines: building
outlines. Triangles: output point locations.
Node Distance from upstream inlet (m) Invert level (m) Reach length (m) X Y
N1 0 39.17 - 264896.000 664747.000
N2 manhole 467 29.46 467 264896.000 664747.000
N3 571 27.70 104 265633.232 664154.002
N4 677 26.37 106 266474.164 663829.787
N5 877 25.70 200 267730.496 663302.938
N6 991 24.64 114 268470.111 662978.723
N7 1145 24.29 154 269533.941 662725.431
Out1 1340 23.49 195 271874.367 661752.786
Table 10.1 – Pipe longitudinal profile
If you want to skip this step, you may want to use the SWMM TEST8B.INP in the tutorial folder. In
that case, please go to section 10.1.1.
1. The first step consists in setting the position of all the nodes that conforms the drainage
network by means of the button Add a junction node:
On the Study area map window, click as many times as nodes should be added to the net-
work. In this project there will be 8 nodes. Note that the position of the nodes is schematic:
10.1 Storm drain configuration in EPA-SWMM 88
2. Configure the node data by double-clicking on each node. The node properties window
should appear:
In this example, the most relevant parameters are: Name, X- and Y-Coordinates, Inflows,
Invert elevation and Max. depth. The only inflow nodes are N1 and N2 manhole. Node
N2 manhole should have Max. depth=2 m. Node N1 is the discharge input and should
follow the time series given in Figure 10.2.
89 Urban Drainage using RiverFlow2D and EPA-SWMM
The time series can be inserted point-by-point or read from file. On the other hand, node
N2 manhole will be the connection with the surface domain and the baseline values should
be 0.0:
The most relevant properties are: Name, Inlet node, Outlet node, Shape, Max. depth,
Length, Roughness and Initial flow.
5. Once the network is completely configured, the project should be saved in order to generate
the .INP file that should be similar to the one shown below.
10.1 Storm drain configuration in EPA-SWMM 92
[EVAPORATION]
;;Data Source Parameters
;;-------------- ----------------
CONSTANT 0.0
DRY_ONLY NO
[JUNCTIONS]
;;Name Elevation MaxDepth InitDepth SurDepth Aponded
;;-------------- ---------- ---------- ---------- ---------- ----------
N1 39.17 0 0 0 0
N2_manhole 29.46 2 0 0 0
N3 27.7 0 0 0 0
N4 26.37 0 0 0 0
N5 25.7 0 0 0 0
N6 24.64 0 0 0 0
N7 24.29 0 0 0 0
[OUTFALLS]
;;Name Elevation Type Stage Data Gated Route To
;;-------------- ---------- ---------- ---------------- -------- ----------------
Out1 23.49 FREE NO
[CONDUITS]
;;Name From Node To Node Length Roughness InOffset OutOffset InitFlow MaxFlow
;;-------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ---------- ----------
L1 N1 N2_manhole 467 0.017 0 0 1.6 0
L2 N2_manhole N3 104 0.017 0 0 1.6 0
L3 N3 N4 106 0.017 0 0 1.6 0
L4 N4 N5 200 0.017 0 0 1.6 0
L5 N5 N6 114 0.017 0 0 1.6 0
L6 N6 N7 154 0.017 0 0 1.6 0
L7 N7 Out1 195 0.017 0 0 1.6 0
[XSECTIONS]
;;Link Shape Geom1 Geom2 Geom3 Geom4 Barrels Culvert
;;-------------- ------------ ---------------- ---------- ---------- ---------- ---------- ----------
L1 CIRCULAR 1.4 0 0 0 1
L2 CIRCULAR 1.4 0 0 0 1
L3 CIRCULAR 1.4 0 0 0 1
L4 CIRCULAR 1.4 0 0 0 1
L5 CIRCULAR 1.4 0 0 0 1
L6 CIRCULAR 1.4 0 0 0 1
L7 CIRCULAR 1.4 0 0 0 1
[INFLOWS]
;;Node Constituent Time Series Type Mfactor Sfactor Baseline Pattern
;;-------------- ---------------- ---------------- -------- -------- -------- -------- --------
N1 FLOW discharge_inflow FLOW 1.0 1
N2_manhole FLOW "" FLOW 1.0 1.0 0.0
[TIMESERIES]
;;Name Date Time Value
;;-------------- ---------- ---------- ----------
discharge_inflow 0:00 1.6
discharge_inflow 0:02 1.6
discharge_inflow 0:04 1.6
discharge_inflow 0:06 1.6
discharge_inflow 0:08 1.61644
discharge_inflow 0:10 1.6336
discharge_inflow 0:12 1.65472
discharge_inflow 0:14 1.67188
discharge_inflow 0:16 1.68904
discharge_inflow 0:18 1.70488
discharge_inflow 0:20 1.71808
discharge_inflow 0:22 1.71808
discharge_inflow 0:24 1.7392
discharge_inflow 0:26 1.75636
discharge_inflow 0:28 1.77352
discharge_inflow 0:30 1.7986
discharge_inflow 0:32 1.82764
discharge_inflow 0:34 1.8448
discharge_inflow 0:36 1.88704
discharge_inflow 0:38 1.92136
discharge_inflow 0:40 1.95436
discharge_inflow 0:42 1.98868
discharge_inflow 0:44 2.02168
discharge_inflow 0:46 2.056
discharge_inflow 0:48 2.09824
discharge_inflow 0:50 2.1484
discharge_inflow 0:52 2.19988
discharge_inflow 0:54 2.25928
discharge_inflow 0:56 2.32264
discharge_inflow 0:58 2.3728
discharge_inflow 1:00 2.4784
discharge_inflow 1:02 2.56288
93 Urban Drainage using RiverFlow2D and EPA-SWMM
[REPORT]
;;Reporting Options
INPUT NO
CONTROLS NO
SUBCATCHMENTS ALL
NODES ALL
LINKS ALL
[TAGS]
[MAP]
DIMENSIONS 260000.000 660000.000 270000.000 670000.000
Units Meters
[COORDINATES]
;;Node X-Coord Y-Coord
;;-------------- ------------------ ------------------
N1 264903.824 664753.843
N2_manhole 264896.000 664747.000
N3 265633.232 664154.002
N4 266474.164 663829.787
N5 267730.496 663302.938
N6 268470.111 662978.723
N7 269533.941 662725.431
Out1 271874.367 661752.786
[VERTICES]
;;Link X-Coord Y-Coord
;;-------------- ------------------ ------------------
to start a new RiverFlow2D project. A dialog window appears where you select the layers
that will be created, the Coordinate Reference System (CRS), and the directory path where
the layers will be saved. This example will use the basic layers: Domain Outline, Manning
N, and BoundaryConditions
3. Select the Projection button. Note that it is EPSG:4326 is set as default, but should be
changed!.
4. In the Filter textbox, type 7405 and select the Coordinate Reference System as shown:
5. Click OK.
6. The Coordinate Reference System (CRS) EPSG code: 7405 should be selected, and the
dialog window will look like this:
10.1 Storm drain configuration in EPA-SWMM 96
7. Click the ”...” button to provide a path to store the project files in the Project Directory textbox.
This will be the folder where the model will write all results and output files.
8. After clicking OK, the layer templates are created, and displayed on the Layers Panel:
RiverFlow2D will use the unit system as that defined in the projection you selected. If the
projection has coordinates in meters, units will be set to Metric. If the projection coordinates
are in feet, units will be set to English.
9. On the QGIS Project menu, click Save, to save the project in the same directory that you
previously selected in the Create New Project dialog above.
1. Click Add, assign the EPSG:7405 projection code to the file, and raster will be displayed on
the screen, by default it is rendered in gray gradient as shown in Figure 16.6.
Right-clicking on the label of the created layer and selecting Properties allows you to change
the rendering style for a more informative color palette.
And now the raster layer is displayed with the new color palette selected:
It is convenient to move the raster layer created to the end of the list of layers, thus it does
not interfere with the display of other layers.
99 Urban Drainage using RiverFlow2D and EPA-SWMM
To connect the surface water mesh with the storm drain components, we will import the
exchange nodes from the .INP file created in the first part of this tutorial. For that we will
use the Import EPA-SWMM INP file command from the RiverFlow2D tools drop down icon:
Select the TEST8B.INP file and a message will indicate the transfer was successful:
You will note that there is a new StormDrain layer created and the imported exchange nodes
are displayed:
1. Click the Domain Outline layer to activate it and then click Toggle Editing (pencil) in the
toolbar:
2. This activates the rest of the editing buttons. Now click the Add Feature tool which is the
bean looking polygon.
Proceed to delineate the outline of the polygon by marking the vertices clicking with the left
mouse button:
Make sure that the polygon is contained within the limits of the raster layer since
RiverFlow2D will not extrapolate elevations to areas that are outside of the available data
on the raster layer. Also, the SWMM exchange nodes should be inside the Domain Outline
polygon.
101 Urban Drainage using RiverFlow2D and EPA-SWMM
3. To finalize and close the polygon, right-click anywhere on the map view area. A dialog win-
dow to input the cell size attribute of the newly created polygon. The value for the reference
size of the mesh cell is indicated. Enter a value of 10 m.
Now click on Toggle Editing button to deactivate the layer Edit mode and save the changes.
1. Select the Manning N layer and click the Toggle Editing button:
2. Draw the polygon around the entire domain taking care that it covers all the cells.
You should have an image like the one shown below:
3. Close the last vertices on the polygon by right-clicking on the desired position. The following
dialog window is presented where you must input the Manning’s n value associated to the
polygon. For this case, enter 0.03:
103 Urban Drainage using RiverFlow2D and EPA-SWMM
Figure 10.20 – Polygon that covers the nodes defining the Outflow boundary condition segment.
10.1 Storm drain configuration in EPA-SWMM 104
2. Click the Toggle Editing button to add the polygons that are going to indicate the nodes on
which the inflow and outflow conditions are established.
3. To finish the polygon, right-click on desired location. A window to enter the attributes of the
newly created polygon is displayed.
4. The window contains a list to select the name of ID of this BC (Boundary Cond. ID), set Id
to OUTFLOW condition, and from the list of boundary condition Types select Free Outflow.
Enter the data as shown in Figure 2.16 below:
The following figure shows the generated mesh. You will also see in the Layers panel two new
layers: Trimesh and Trimesh point:
Before using the Export plugin, save the QGIS project. To accomplish this, from the Project
menu, click Save. Name the project file Test8B.qgs. Also, uncheck the MeshDensityLine and
MeshBreakLine layers that will not be used in this tutorial.
2. A dialog window is presented. We must indicate the raster layer of the Digital Elevation
Model (DEM), as this layer is not created by the plugin and its name may be different.
3. Using the ”...” button, select the path, and enter the file name. Please, ensure that the path
is the same as that previously selected, and the one corresponding to the .qgs project file.
4. Click OK.
10.2 Exporting the files 106
The plugin will begin to process the information. A message bar at the top will indicate the
approximate progress of the process.
Once the process of creating the files with the input data is finished, the Hydronia Data Input Programprogram
is opened automatically and a dialog window is presented with the model project to run. In
this case: Test8B.DAT should already be set.
Then the window with the input parameters of RiverFlow2D is presented, as shown in the
image below:
Enter 5 hours for the Simulation time and click on the Storm Drain EPA-SWMM panel. Enter
for the N1 node CD = 0 since we don’t want exchange with that inflow node to the conduit.
107 Urban Drainage using RiverFlow2D and EPA-SWMM
5. Click [Save .LWSMM] and overwrite the existing file, for this tutorial the filename will be the
name of the project when it was exported with the .lwsmm extension.
6. Click the Run RiverFlow2D button to run the model. The model will show a window reporting
on the model progress.
10.2 Exporting the files 108
When the run finishes, close the window and you can import results back in QGIS to prepare
maps and animations. An example of the maximum depths is shown below:
109 Urban Drainage using RiverFlow2D and EPA-SWMM
This tutorial will show how to set up a tailings dam failure simulation with the RiverFlow2D model
with the Mud and Tailings Flow Module (MT) using the QGIS interface. The exercise consists of
modeling a tailings dam failure flood and creating results maps for the impacted areas. The data
is based on the Brumadinho dam disaster occurred on 25 January 2019 when a tailings dam at
the Córrego do Feijão iron ore mine, east of Brumadinho town, in Minas Gerais, Brazil, suffered a
catastrophic failure.
In this tutorial we will use the data included in the BrumadinhoRF2D folder under
Documents\RiverFlow2D QGIS\ExampleProjects\BrumadinhoRF2D. The folder contains the files
shown:
110
111 Simulating a tailings dam failure with RiverFlow2D MT
2. Select None in the Layers drop-down menu, then click the MeshDensityLine and the Initial
Concentrations check boxes.
3. Click the Projection button and in the Filter text box, type 31983 and select the Coordinate
Reference System and click OK as shown:
11.1 Start a new project for a tailing dam break simulation 112
4. Click the button to provide a path to store the project files in the Project Directory text
box. This will be the folder where the model will write all results and output files. Browse
to the tutorial directory Documents\RiverFlow2D QGIS\ExampleProjects\BrumadinhoRF2D
then click Select folder. The dialog window should look like the following:
113 Simulating a tailings dam failure with RiverFlow2D MT
5. After clicking OK, the layer templates are created, and displayed on the Layers Panel
On the QGIS Project menu, click Save, to save the project in the same directory that you
previously selected in the Create New Project dialog above.
1. To load the DEMs, click the Add Raster Layer button . You may also use the QGIS
shortcut Control+Shift+R.
2. In the dialog search for the tutorial folder and select the RasterBRUMADINHO.tif and RasterDAM10.tif
files as shown:
4. Click on the RasterBRUMADINHO layer. Use the Zoom Full button to center the image.
The raster will be displayed on the screen, by default it is rendered in gray gradient as
shown.
115 Simulating a tailings dam failure with RiverFlow2D MT
Right-clicking on the label of the new raster layer and selecting Properties, in the Symbology
panel you can change the Render type for a more informative palette such as Hillshade for
instance.
You may move the raster layer by dragging it to the end of the list of layers to avoid that it would
hide or interfere visually with the other layers.
1. Click the Domain Outline layer to activate it and then click Toggle Editing (pencil) in the
toolbar
2. Click the Add Polygon Feature tool . Proceed to delineate the outline of the polygon by
clicking the vertices with the left mouse button.
3. To finalize and close the polygon, right-click on the map view area. A dialog window to input
the cell size attribute of the newly created polygon will appear. The CellSize value for the
reference size of the mesh cell is indicated. Enter a value of 50 m.
The Domain Outline should look similar to the following figure:
11.4 Create more detail for the mesh down the main
flow area
Once the Domain Outline is created, a Mesh Density Line will provide the necessary detail down
the main channel for more accuracy.
2. Click the Add Line Feature button then Left-click to draw the points down the middle of
the channel all the way to the river entrance at the bottom of the Domain Outline.
3. Right-click to finish the line. A dialog requesting input for the MeshDensityLine Feature
Attributes will appear. Input 25 as the CellSize for the MeshDensityLine layer. The first line
should look as follows:
11.4 Create more detail for the mesh down the main flow area 118
Another line will need to be drawn to finish adding detail down the main path on the river in
the south.
4. Click the Add Line Feature button then Left-click to draw the points starting from the the
south-western part of the Domain Outline along the riverbed and right-click to finish the line,
joining it to the first line as follows:
5. Right-click to finish the second line. A dialog requesting input for the MeshDensityLine
119 Simulating a tailings dam failure with RiverFlow2D MT
Feature Attributes will appear. Input 25 as the CellSize for the MeshDensityLine layer.
Figure 11.12 – Triangular mesh generated for the tailings dam break tutorial.
2. Click the Toggle Editing button to add the polygons that will indicate the open boundary
segments where inflow and outflow conditions are imposed. Draw a polygon at the bottom
end of the mesh as indicated in the figure:
121 Simulating a tailings dam failure with RiverFlow2D MT
Figure 11.13 – Polygon that covers the nodes defining the Inflow boundary condition segment.
3. To finish the polygon, right-click on desired location. A window to enter the attributes of the
newly created polygon is displayed.
The exact form of the polygon is not important. You only need to make sure that the polygon
covers the segment length at which you want to impose the condition. All cells falling within
that polygon will be open boundary cells.
4. In the Boundary Cond. ID enter the desired name or leave the default.
5. Select 2. Discharge vs. Time from the Type of Open Boundary list.
6. Click Import BC File button, and search for the inlet1.QVT hydrograph file as shown below:
11.6 Setting up the boundary conditions 122
7. Click OK to close the dialog and then click Save Layer Edits .
All boundary condition files, such as inlet1.QVT in this tutorial, need to be in the same directory
as all the other project files.
Now we will enter an free outflow condition where the fluid will be let to flow out from the mesh.
123 Simulating a tailings dam failure with RiverFlow2D MT
1. Click the Add Polygon Feature tool . Proceed to delineate the outline of the polygon
by clicking the vertices with the left mouse button. Draw the polygon defining the outflow
boundary area at the downstream end of the river as shown:
Figure 11.16 – Polygon that defines the outflow boundary condition segment.
2. Right click to close the polygon. A dialog window will appear to enter the parameters. Select
the condition type Free outflow and should look like the following:
Figure 11.17 – Parameters for the free outflow open boundary condition.
3. Save the changes made to the layer by clicking the Save Layer Edits button .
11.7 Assigning Manning’s n 124
Figure 11.18 – Polygons that define the inflow and outflow boundary conditions.
1. Select the Manning N layer and click the Toggle Editing button .
2. Click the Add Polygon Feature to draw a polygon that covers the entire domain. The
polygon may extend beyond the mesh area as shown:
125 Simulating a tailings dam failure with RiverFlow2D MT
3. Close the polygon by right-clicking on the end vertex and enter a Manning’s n equal to 0.035:
4. Click Save Layer Edits , and then click the Toggle Editing button to deactivate editing
mode.
table attribute that gives the concentrations for each sediment class.
1. Select the InitialConcentrations layer in the Layers and click the Toggle Editing button
2. Click the Add Polygon Feature button and draw the polygon, keeping within the edges
of the RasterDAM10 raster:
3. An InitialConcentrations - Feature Attributes dialog will appear. Browse to select the Deposit Initial.txt
file from the project folder and then click OK.
4. Save the changes made to the layer by clicking the Save Layer Edits button .
Save the QGIS project using the Save Project button or by using the Project menu. Name the
project file Brumadinho.qgs.
1. In the RiverFlow2D plugin toolbar, click the Export files for RiverFlow2D button and select
Export RiverFlow2D ...
2. In the export dialog window indicate the Project Name, Brumadinho in this tutorial.
4. Click on the Options arrowhead to view the additional parameters for the export.
127 Simulating a tailings dam failure with RiverFlow2D MT
5. Click to enable the checkbox for Using Initial WSE Raster Layer, then on the drop down
menu select the RasterDAM10 as your InitialWSE layer.
Your Export RiverFlow2D dialog window should look like this:
6. Click OK.
1. In the Control Data panel under the Time control data section, Set the Output interval (hrs.):
to 0.01.
*Optional* If you have an nVidia graphics card installed on the system, you can enable the
RiverFlow2D GPU under the Model Selection section to accelerate the computation speed
for the simulation.
11.10 Configure final model parameters in the Hydronia Data Input Program (DIP). 128
Figure 11.23 – Hydronia Data Input Program window with Control Data parameters for the tailings dam
break tutorial.
3. Click the Save .DAT button. Save the file as Brumadinho.dat and click Yes to replace the
existing file.
1. Click on the Mud/Tailings Flow on the left side panel to activate it.
3. A dialog will appear asking for a file ending with the .MUD extension. Select the one named
brumDam.MUD and click Open.
You will now see that the panel has changed most of the parameters. More importantly, the
Variable properties-Erosion-Deposition Model has been enabled, and there are six sediment
classes loaded. Take some time to familiarize yourself with the parameters.
The parameters that have been loaded need to be saved with the same name as the project
name so that the model will use it upon execution.
4. Click the Save .MUD button and the project name Brumadinho.MUD should already be set.
Click Save.
The Mud/Tailings Flow panel should look like the following:
129 Simulating a tailings dam failure with RiverFlow2D MT
Figure 11.24 – Hydronia Data Input Program window with Mud/Tailings Flow parameters for the Bru-
madinho Tutorial.
5. Click on the Open Boundary Conditions under Components in the side panel of the Hydronia Data Input Progra
6. Click on the cell in the first table that contains the inlet1.QVT variable:
Figure 11.25 – Section containing table with Boundary Conditions set for this run.
Upon clicking the cell, a dialog box should appear that will allow us to automatically update
the existing data table in the inlet1.QVT file with the additional rows needed, and setting
each to 0:
11.11 Running the model 130
Figure 11.26 – Dialog for correcting the Boundary Conditions file automatically.
1. Click on Control Data in the side panel of the DIP and then click the Run RiverFlow2D button
at the bottom.
2. The DIP will ask to save changes to the .DAT file, click No.
A few windows should appear, the last one will be the graphical model windows that displays
the status of the model. When the model is finished running, it should look as follows:
131 Simulating a tailings dam failure with RiverFlow2D MT
3. Click Close and let the program finish writing the remaining output files.
1. In QGIS , in the RiverFlow2D plugin toolbar, click on the drop down menu for Results vs
Time Maps and select Concentrations and Properties vs Time Maps
Figure 11.28 – Concentrations and Properties vs Time button in RiverFlow2D Plugin toolbar.
The Concentrations and Properties vs Time Maps window will provide maps for each Sed-
iment class, labeled Conc # under the Maps subsection. Users can also create maps for
each of the variables in the list.
3. Select one of the Maps, then select an Output Times of interest. You can hold Control key
while clicking on multiple Maps and / or Output Times.
4. Once all outputs of interest are selected, click on the Right Arrow button to move them
to the Output Maps subsection.
Repeat these steps to create maps for each of the concentrations if desired.
On the QGIS Project menu, click Save, to save the project in the same directory that you previ-
ously selected in the Create New Project dialog above. This is required for the Animations panel
to function.
2. Click on the Select layer drop-down menu and select Mud/Tailings Flow.
3. Click Add Layer. A dialog box will appear asking for the specific Animation we would like to
create:
11.13 Generating animations for the Mud/Tailings Flow module 134
4. Click on the drop-down menu to see the available outputs. They will be the same as the
ones from Concentrations and Properties vs Time Maps plugin.
6. Select the output range desired, or just leave the default for the entire range of output inter-
vals. Click OK
There is a status bar underneath the Select layer drop-down showing the progress of the
animation generation. When it is finished, the layer previous choice of animation will appear
in the box underneath the status bar.
Figure 11.32 – RF2D Animation panel indicating the status bar and generated animation layer.
7. Click and hold to drag the newly created ANIMATION group in the Layers panel and move
it above the Raster layers so that the animation will be visible.
8. Click on the layer that was generated in the RiverFlow2D Animation panel then click the Play
button to view the animation.
Repeat these steps to create animations for each of the concentrations if desired.
This concludes the tutorial for Simulating tailings dam Failures utilizing the Mud/Tailings Flow
module in RiverFlow2D.
Wind driven circulation
12
RiverFlow2D and OilFlow2D allow defining wind velocity on the water surface to account for the
effect of the wind stress on the flow velocities. The conceptual model of a wind driven simulation
require a series of non-overlapping polygons that determine the wind velocity data to the model.
Only areas covered by polygons will be affected by the wind stress. Each wind velocity polygon
should be associated with a file containing a wind velocity time-series file containing the two
components of the wind velocity vector for each time. The user will need to generate the wind
velocity data file associated with each polygon, and copy them to the project folder, prior to running
the model.
This tutorial illustrates how to perform a wind drive simulation using the QGIS interface. The
procedure includes the following steps:
3. Create the template of the wind layer and the wind speed polygons.
Note: The files required to follow this tutorial can be found in the following directory:
...\Documents\RiverFlow2D QGIS\ExampleProjects\WindTutorial
135
12.1 Open an existing project 136
2. On the Project menu click Open... to load the existing project: WindTutorial.qgs.
This project contains the layers of the domain contour and the layer of the Digital Elevation Model
(DEM) of Lake Champlain in the USA. When the project is opened, a project image will be loaded
in QGIS as shown in Figure 12.1.
NP lines containing:
TIME Wvx Wvy
where Wvx and Wvy, are the wind velocity components in x and y directions respectively in m/s or
ft/s.
The following table is an excerpt of the WindVelocDATA.TXT file that is included in the Data folder
for this tutorial:
6544
0 5.97 -2.17
1 5.09 8.83
2 3.84 6.63
3 5.87 4.92
4 0.00 0.00
5 -3.31 -1.90
...
6543 3.84 -6.63
12.3 Create the template for the wind layer and the
wind speed polygons
To add the template where the polygons are drawn with the wind speed time series data involves
the following steps:
1. Create the template for the Winds layer: In the model toolbar click on the New Template
Layer command
2. In the plugin window, activate the Wind checkBox, as shown in the Figure below:
12.3 Create the template for the wind layer and the wind speed polygons 138
3. Edit the Wind layer: In the layers panel, we select the Wind layer and in the digitalization
toolbar we click on the Toggle Editing tool . A pencil icon will appear in the Wind layer,
indicating that the layer is in edit mode:
4. Draw the polygon that demarcates the Wind area: Using the Add Feature tool from the
digitalization toolbar .
Draw the polygon that defines the wind area. In this case, the tracing of the polygon must
be done in such a way that it covers all the cells of the mesh. Once you finish drawing the
polygon a window to input the polygon parameters is immediately opens, which are three:
5. After input the values, click OK and accept the changes. There should be an image similar
to the one shown in the following figure:
The results obtained as shown in Figure 12.5 (mesh of around 17,500 cells).
2. In the dialog, select the raster layer that contains the Digital Elevation Model (DEM) and the
name of the project to be exported.
4. Input the name without any extension. For this example it will be: WindTutorial.
5. Before executing the plugin activate the DEM layer (if it is deactivated).
Once the plugin is executed, a window will be shown (Figure 10.6) as it should be for our
example.
141 Wind driven circulation
1. Select the Wind component from list in the left side of the panel. The window with the
information of the wind parameters will appear as can be seen in the figure below:
12.6 Running the model 142
3. In the Initial conditions select Horizontal water surface elevation and 0 on the text box. Leave
all other parameters at their default values.
4. Click on the Run RiverFlow2D button in the lower section of Hydronia Data Input Program.
5. Save the changes with the same name as the WindTutorial.DAT file, then a window will
appear indicating that the model started running.
The model window that appears during the run model shows several runtime parameters.
143 Wind driven circulation
where DDDD indicates the day, HH, hour, MM minutes and SS seconds.
In these files, columns 1, 2 and 3 report the velocity components in Vx, Vy and the module
respectively. We can visualize the water velocity fields generating layers either in raster or vectorial
format from the aforementioned files using the Maps of Results vs Time
The following figure shows the water velocity field map for time 0000:20:00:00:
12.7 Check the wind output files 144
Figure 12.10 – Map with the speed field for the time 20 hours.
The files required to follow this tutorial can be found in the following directory:
...\Documents\RiverFlow2D QGIS\ExampleProjects\ManningsNShapefileTutorial
2. On the Project menu click Open... and browse to the existing project: ManningsN shapefile.qgs.
This project contains the layers of the domain contour, the Digital Elevation Model (DEM) of
the river bed in raster format, an aerial photograph, and the boundary conditions layer where
the inflow is located in the upper right and outflow in the lower left. The inflow boundary
condition is a hydrograph with a peak discharge of 220,000 ft3 /s, and the outflow conditions
is set to Free outflow. When you open the project you will have an image of the project
loaded in QGIS as shown in 13.1.
145
13.2 Load the shape file with the Manning’s n polygons 146
of Manager layer toolbar or from the main menu Layer → Add layer → Add Vector Layer...
When loading the file, an image similar to the one shown in the following figure will be
147 Using Manning’s n ESRI shape files
1. Check the fields name of shape file: Right-click on the layer label and in the pop-up menu
select the option Open attribute table (Figure 13.4).
13.3 Import the Manning’s n geometry and values to the Manning N layer 148
You can see that the shape file loaded has two fields, LUCode and N Value, the first one with
the coding of the land cover type and the second corresponds to the value of the Manning’s
n, in the case of the Manning N layer, it has a single field called ManningN.
2. Proceed to change the name of the field N Value to ManningN. Close the table of attributes
and right-click on the layer label. In the pop-up menu, select Properties then in window that
opens select the Fields tab as shown in Figure 13.5:
then change the N Value field name by ManningN (Figure 13.6), and click on the Toggle
Editing button again, and save.
4. Copy the polygons of the shape file: select the SaltRiver ManningsN layer in the Layers
Panel.
5. With the select tool we draw a rectangle that covers the entire layer:
Figure 13.7 – Selecting all the polygons in the SaltRiver ManningsN layer.
6. Copy the spatial elements by clicking on the Copy button of the digitization toolbar
7. Paste the spatial elements in the Manning N layer: select Manning N layer of the Layers
13.3 Import the Manning’s n geometry and values to the Manning N layer 150
Panel and set it in edit mode by clicking on the Toggle Editing button .
To verify the operation was successful, open the attribute table of the Manning N layer and you
can see that the polygons have been copied with their Manning n values. As shown in the Figure
below:
You can now remove the SaltRiver ManningsN layer from the Layer Panel.
This concludes the Using Manning’s n ESRI shape files tutorial.
Post-processing calculations
14
RiverFlow2D has three output controls that make it easier for the user to analyze the results of
the runs at specific sites in the domain calculator. These output controls are: Observation points,
Cross sections and Profiles.
This tutorial illustrates how to incorporate the output controls in a model using the QGIS interface.
The procedure includes the following steps:
2. Create ObservationPoints, CrossSections and Profiles layers, and draw the output controls.
The files required to follow this tutorial can be found in the following directory:
...\Documents\RiverFlow2D QGIS\ExampleProjects\OutControlTutorial
2. On the Project menu click Open... and browse to the existing project: OutControlTutorial.qgs.
151
14.2 Create a template of the layers ObservationPoints, CrossSections and Profiles and draw
the output controls 152
This project contains the layers of the domain outline, the Digital Elevation Model DEM of
the river bed in raster format, the layer with the boundary conditions where inflow is located
in the upper left and outflow in the lower left. The boundary conditions are a hydrograph
with a peak discharge of 6,500 f t3 /s and outflow condition set to Free outflow. When you
open the project you will have an image of the project loaded in QGIS as shown in Figure
14.1.
1. Create the templates of the layers ObservationPoints, CrossSections and Profiles: for this
in the RiverFlow2D toolbar click on the New Template Layer button
2. In the plugin window activate the checkBox ObservationPoints, CrossSections and Profiles,
as shown in the Figure below:
153 Post-processing calculations
3. Edit the layers and draw the output controls: Select in the layers panel, the Observation-
Points, CrossSections and Profiles layers one by one.
A pencil will appear on the label of the layers, indicating that the layers are in edit mode:
5. Draw the lines or points that represent the output control: To draw the cross sections, profiles
or observation points, the Add Feature tool will be used.
for the CrossSections and Profiles layers, the icon for the Add Feature button is
6. Drawing the cross sections: Select the CrossSection layer, and activate the Add Feature
button.
7. Proceed to draw three sections: One at the beginning of the channel, another in the middle
and the third almost at the end of the channel, identify (XSECID) as: Section1, Section2
and Section3, with intervals (ND CS) of 10, 15 and 20 respectively. The attribute tables of
the sections will be as shown in Figure 14.3 and at the end of the drawing a similar image
should appear as shown in the following Figure 14.4.
8. Save the polygon by clicking the Save button and click on the Toggle Editing button
to deactivate Edit mode on the CrossSections layer.
9. Drawing the Profile: Select the Profile layer and activate the Add Feature button, we proceed
to draw the profile along the channel central axis, identifier (PROFILEID) is Profile1 and the
number of intervals (ND PR) equal to 50. The attribute table will be as shown in Figure 14.5.
Once finished drawing, it should appear like the one shown in the following Figure 14.6.
156 Post-processing calculations
10. To finalize the profile drawing, save the polygon by clicking the Save button and click on
Toggle Editing button to deactivate Edit mode on the Profile layer.
11. Drawing the observation points: Select the ObservationPoints layer, and activate the Add
Feature button, proceed to draw two observation points, the first between sections 1 and 2
and the second between sections 2 and 3. As an identifier, (Obsid) is assigned Point1 and
Point2 respectively. The attribute tables will be as shown in Figure 14.7 and at the end of
the drawing you should have an image similar to the one shown in the following Figure 14.8.
12. To finish the drawing of the observation points, you click again on the Toggle Editing button
to disable the editing mode of the ObservationPoints layer.
2. When run the plugin a window is displayed, select the raster layer that contains the Digital
Elevation Model (DEM) and the name of the project to be exported.
161 Post-processing calculations
3. Input the name without any extension. For this example it will be: OutControl.
4. Before executing the plugin, activate the layer with the DEM (if it is deactivated).
Once the plugin is executed, a window will be shown (Figure 14.10), as it should be for our
example.
5. Once finished inputting the information, click on the OK button and the export process will
begin.
You can observe in the control panel in Output Options the outputs of results for cross sections,
profiles and observation points are selected.
14.5 Review the output files 162
Figure 14.14 shows an extract of the OutControl.prfe file with the report of the profile results:
164 Post-processing calculations
Figure 14.15 shows an extract of the RESvsT Point1.oute file with the report of the results of the
observation point Point1:
Figure 15.1 – Areas with overlap and empty spaces in manual digitization of adjacent polygons.
166
167 Advanced digitization/snapping
This tutorial illustrates how to use the QGIS Snapping tool to facilitate the scanning of adjacent
polygons. The procedure includes the following steps:
The files required to follow this tutorial can be found in the following directory:
...\Documents\RiverFlow2D QGIS\ExampleProjects\SnappingTutorial
2. In the main menu go to Project → Open... browse to the existing project: SnappingTutorial.qgs.
This project contains the basic templates of a RiverFlow2D project and a raster with 4 areas with
different Manning’s n coefficients derived from land cover and land use maps. From this raster,
the polygons of the Manning N layer will be drawn. When the project is opened, a project image
will be loaded in QGIS as shown in Figure 15.2.
15.2 Activate the Snapping tool 168
3. In Snapping, activate the option Open snapping options in dock window (Figure 15.3). As
indicated by the label
Once you restart QGIS and open the project again you should have an image similar to the one
shown in Figure 15.4 where you can see the Snapping tool panel at the bottom. If it does not
appear, Open the main menu → Configuration → Snapping options..., to load panel.
15.3 Configure the snapping tool 170
2. In the list of layers, you unselect all but the layer where the polygons will be drawn. In this
case the Manning N layer is selected.
The configuration window of the Snapping tool should be as shown in the following Figure:
1. Edit the Manning N layer: In the layers panel, select the Manning N layer
A pencil icon will appear in the Manning N layer indicating that the layer is in edit mode:
3. Draw the polygon that demarcates the Manning’s n area: Using the Add Toggle Editing
button in the digitalization toolbar
proceed to draw the polygons. Start by drawing the polygon in the bottom of the watershed
shown in gray which corresponds to n = 0.02. After completing the drawing you should have
an image similar to the one shown in the following figure:
4. Proceed to draw the second polygon. This will be the small yellow polygon to which cor-
responds to n = 0.30. To draw the polygon, follow the boundary with the green polygon
as indicated by the raster, but in the boundary with the polygon already drawn (the gray)
an overlap will be made so that the snapping tool takes the edge that already exists and
completes the polygon. Try to make a path as shown in the figure below:
6. Enter the Manning coefficient, n = 0.30 and you will have an image like the one shown below
where you can see how the final drawing of the second polygon took the vertices of the first
adjacent polygon:
7. The third polygon to be drawn will be the large yellow polygon. Just as in the previous case,
the contour of the polygon according to the raster is faithfully followed, but in the adjacent
173 Advanced digitization/snapping
polygons it is already drawn overlapped. The figure below shows the initial drawing, with an
approach in the area where the overlap is made with the existing polygon:
8. After finishing the drawing and assigning the Manning N umber to the polygon, the final
drawing of the third polygon will be shown as shown below:
9. The fourth polygon to draw will be the green polygon which corresponds to n = 0.45. To do it
will follow the outer boundary of the same and the boundary with the brown polygon. Then
a thick overlap will be made within the polygon already drawn, the yellows and the gray, as
shown in the figure below:
15.4 Draw contiguous or adjacent polygons using the Snapping tool 174
10. After finishing the drawing and assigning the Manning’s n value to the polygon, you will have
the final layout of the third polygon as shown below:
11. To finish, draw the fifth polygon of brown color, which corresponds to n = 0.03. For this the
outer limit is drawn following the contour of the raster and for the shared limits an overlap is
175 Advanced digitization/snapping
12. After finishing the drawing and inputting the Manning coefficient to the polygon, you will have
the final drawing of the third polygon as shown below:
changes are accepted and saved. Then the layer of the raster Manning Map n is deacti-
vated, and the Manning N vectorized layer can be observed as shown in the Figure below:
2. Then the polygon to be eliminated is selected using the Select Feature button
3. With the active select Feature tool, click on the polygon to be deleted and it will be high-
lighted in yellow to indicate that it is selected (Figure 15.16).
177 Advanced digitization/snapping
4. Then the polygon is deleted either with the Delete key on the keyboard or with the Delete
selected button
5. Finally, the changes are saved and the editing mode of the layer is deactivated by clicking
on the Toggle Editing button.
Creating raster elevations from X Y Z data sets
16
RiverFlow2D uses elevation data in raster format. For instance, to load an ASCII grid file, from
the Layer menu, click Add Layer, and then click Add Raster Layer... You may also click the Add
Raster Layer button:
In this example we will use elevation data available in a tab delimited X Y Z file, and create an
interpolated raster layer.
The X Y Z file can be formatted as comma, space or tab delimited data, where the first two
columns correspond to point X and Y coordinates and the third column is the point elevation Z as
shown in the following figure.
First, the X Y Z file is loaded to create an event layer. This can be accomplished as follows:
178
179 Creating raster elevations from X Y Z data sets
1. From the Layer menu, click Add Layer, and then click Add Delimited Text Layer... Alterna-
tively, you may also click the Add Delimited Text Layer button:
Figure 16.2 – Dialog to create a layer from delimited data text file.
2. Here you must indicate the location and name of the file with the X Y Z data.
3. Make sure that the first row has the names of the fields, and this is assigned to X field,
field 1 and Y field, field 2, then click OK to load the points in the project window. The
Coordinate Reference System Selector dialog box appears again and we can click OK to
continue making sure that the CRS is the appropriate one.
4. As surely the points are not within the extension of the window, you will have to click with
the right mouse button on the label of the created layer and select the option Zoom to the
layer.
180
6. The raster is created interpolating from the data in the point layer. For that we will use
the Interpolation command which is found on the Raster menu under Interpolation. This
command is a plugin that is installed by default in QGIS. If for any reason it does not appear,
on the Plugins menu, click Manage and Install Plugins..., type Interpolation on the search
field, and then then select the Interpolation Plugin checkbox to enable it.
181 Creating raster elevations from X Y Z data sets
7. In this window select the layer to be interpolated to create the raster, in this example we
assume it is a point layer that we just created named HohRiverBedElevations. Change it
by selecting the dropdown for Vector Layers. We select the field that has the attribute that
was used as the value to interpolate, in this case the z field. This is done by clicking the
dropdown for Interpolation Attribute, selecting Z, then clicking the Add button.
8. Once added, go to select the interpolation method. There are 2 options: triangular interpo-
lation (TIN), or Inverse Distance Weighting (IDW). In this case the TIN method is selected,
then the resolution of the raster is defined, which is fixed to cells of 10f t × 10f t, which
generates a raster of 315 columns x 514 rows.
9. Select the path to the folder where the raster layer is to be created. It is recommended to
point to the project folder directory chosen earlier in the tutorial.
Once the process is completed, the raster resulting from the interpolation will be displayed on the
screen, by default it is rendered in gray gradient as shown in Figure 16.6.
Note: Right-clicking on the label of the created layer and selecting Properties allows you to change
the rendering style for a more informative color palette.
And now the raster layer is displayed with the new color palette selected:
It is convenient to move the raster layer created to the end of the list of layers, thus it does not
interfere with the display of other layers.
Creating high-impact graphics and animations
17
using Paraview
ParaView is an open-source, multi-platform data analysis and visualization application. You can
quickly build visualizations to analyze model results using qualitative and quantitative techniques.
The data exploration can be done interactively in 2D and 3D, or using ParaView’s batch processing
capabilities.
This tutorial will demonstrate the use of Parview to generate high quality graphics, including depth
maps, velocity fields, 3D visualizations, and animations of RiverFlow2D results.
This tutorial requires ParaView version 5.8.1 or later. You can download and install ParaView
version 5.8.1 or later from the website www.paraview.org. To create the ParaView graphs, the
RiverFlow2D model needs to generate during runtime the .vtk files using the Create graphic
output files option in the Hydronia Data Input Program Graphic Output Options panel.
184
185 Creating high-impact graphics and animations using Paraview
To open the tutorial example group file, click in the Menu bar and double-click the file group
BridgeTutorial..vtk in the ParavirewTutorial folder. The group contains multiple .vtk files,
where each file corresponds to a specific simulation time.
Make it visible clicking Apply in the Properties tab. The following graphic in the Render View
layout will look as follows:
Using the Time control toolbar (see Figure 17.3), select a time to visualize the selected variable.
17.2 Two-dimensional (2D) visualizations 186
The graphic will change according with the selected simulation time. For example, for Time = 2 it
should look similar to this:
An adequate visualization depends on the selection of a color scale of a defined variable. In the
previous figure, the default color scale was selected associated with the depth variable (h). The
next section shows how to customize color rendering.
Although it is possible to customize the color maps, we will see how to do it later in this tutorial,
for this example we will use a predefined color.
Click in the Properties tab to pick up the Rainbow Desaturated color map in the Choose Preset
dialog box. Once selected, Apply/Close.
17.2 Two-dimensional (2D) visualizations 188
Double click in the right circle of the range marker bar and select any blue color from the Select
Color dialog box. This example uses Red = 0, Green = 85 and Blue = 255 and Click OK
To create a 2D velocity vector map for this example, follow these steps:
• Click Apply in the Properties panel. You will adjust the big arrows after
In order to save the Paraview project, select File/Save State. This will save a .pvsm file.
Generating a 3D visualization in ParaView requires an interpolation from Cell Data to Node Data
as follows.
• Select Cell Data to Point Data in the Filters/Alphabetical menu. Then, press the Apply
button in the Properties tab.
• Select again z in the Variable selector. Note that the color view is smoother due to the
interpolation. The result should look as follows:
17.3 Three-dimensional (3D) visualizations 194
• With the CellDatatoPoint selected in the Pipeline Browser, select Warp by Scalar in the
Filters/Alphabetical menu to do the extrusion and then click Apply.
– Scalars = z
– Scale Factor = 25
• Click Apply
• Switch from 2D to 3D visualization in the Layout Render view to manipulate the project in
3D.
• Remove the color map of the bed elevation z by selecting Solid Color in the Coloring drop-
down menu of the Properties tab:
• The Solid Color can be customized clicking the Edit color map icon in the Proper-
ties tab. Once the desired color has been chosen at the Pick Solid Color tab (this example
uses HTML=#ecb57d), the Render view should look as:
17.3 Three-dimensional (3D) visualizations 196
To view the terrain from different points, use the left mouse button to rotate, press down the mouse
wheel to translate, and scroll the mouse wheel to zoom in or out the image.
Using the Viewpoint Toolbar (Figure 17.22), you can add different view points of your graphic
clicking .
A more sophisticated visualization can include additional layers. In the next section we will add
two more layers: the water elevation (h+z) and the velocity vector field.
• Click on the CellDataToPointData item in the Pipeline Browser and select Warp by Scalar
in Filter/Alphabetical. A WrapByScalar2 item will be created in the Pipeline Browser.
– Scalars = (h+z)
– Scale factor = 25 (very important)
• Click and choose the Rainbow Desaturated color map, then Apply/Close.
As seen in this figure, the layers corresponding to z and (h+z) variables are overlapped in the
dry areas of the domain, generating a confusing presentation. One easy way to fix this issue is
to remove the water depth h values below a user-defined value to avoid overlapping, doing as
follows:
• Click WrapbyScalar2 in the Pipeline Browser and select Threshold in Filter/Common in the
main menu
• Click Apply in the Properties panel, and check that h is in the Variable selector
• Set the minimum value equal to 0.01 m. Depths (h) below this minimum will not appear in
the color representation.
With the Threshold layer selected, change the color map for water depth h to a white-to-blue as it
was explained in Section 17.2.2 of this tutorial. The result graph should look as follows:
• Select Time ̸= 0 as the current time control tool bar. In this example chose for instance
Time=3.
After these steps, the graphic should look like this one:
201 Creating high-impact graphics and animations using Paraview
In order to save this Paraview project select File/Save State and create a .pvsm file. To load any
of the saved projects select emphFile/Load State and select a .pvsm file.
In this dialog, the user can configure the video frame rate, the number of frames per time step, the
resolution (in pixels) and the range of time steps. In order to reduce the size of the output video
file, a compression mode is also available for the video. Note that this will also reduce the video
quality of the animation. As an example, the next figures show three frames of the output video
17.4 Generating animations 202
– Representation = StreamLines
– Step Length = 1
– Number of Particles = 1000
– Max Time to Live = 600
• To have Streamlines in one color, select in the Property panel Coloring = Solid and then
click on and select a color.
If you load a Paraview project .pvsm file, you have to deactivate the filters in the Pipeline Browser
by clicking the open eyes so that only the *.vtk file layer is open.
Multiple Scenario Project Tool
18
When establishing a mathematical model of a system, it is very common to perform a variety of
runs with different values of the most significant parameters to see their effects. In some cases, it
is also useful to have the model run the scenario without a project and within a project. In previ-
ous versions of the plugin this had to be done in separate QGIS projects, which involved making
copies of the project folders and data, which can bring problems with data handling and access.
This new version of the RiverFlow2D plugin for QGIS allows the management of multiple scenar-
ios within the same project. In this way variants of the same model can be created as subprojects,
thus bringing with it the advantage of having all the variants organized in the same project which
facilitates access and management of information.
The following describes the new features of the QGIS interface for RiverFlow2D that allow the
handling of multiple scenarios.
• A drop-down list that shows the user the list of scenarios contained in the project.
205
18.2 Creating a new RiverFlow2D multiple-scenario project using QGIS 206
• An option in the RF2D tools menu that allows you to import an existing RF2D project into
the multi-scenario mode.
Figure 18.1 – Drop-down list for displaying and selecting project scenarios
The dialog window a field is presented to indicate the name of the initial scenario (highlighted in a
red box in the figure below), by default this field is labeled 'base'. The drop-down list for displaying
scenario names is limited in length, we recommend that you assign short names to scenarios for
ease of viewing and to assign names without spaces.
207 Multiple Scenario Project Tool
When creating a multi-scenario project, within the folder selected for the project a subfolder is
created with the name given to the initial scenario, (in this example the folder name base)and
within that sub-folder another subfolder is created with the name shape where QGIS creates the
templates of the layers used by the model for that scenario. Each other scenario will have its own
shape subfolder that contain the layers for that particular scenario.
• To create a new scenario, access the first button on the toolbar and select the New Scenario
menu option as shown in the figure below:
18.3 Create a new scenario 208
• A window will be presented, input the scenario name keeping in mind to use short names
without spaces.
The new scenario is based on the layers with the input data of the current scenario. The
plugin will proceed to create a subfolder with the name of the new scenario within the project
folder. In this folder the files corresponding to the layers of the RiverFlow2D project will be
copied with the input geospatial information it requires.
Please note that the model layers will not copy post-processing products such as maps
or animations. The plugin then updates the paths of the sources of the layers to the files in
the new folder and finally the drop-down list in the RF2D toolbar is updated with the name
of the new scenario.
209 Multiple Scenario Project Tool
• Then a Dialog window will ask for confirmation to switch scenarios, as shown in the figure:
When you switch scenarios, the state of the layers in the current scenario is automatically
saved.
• Use the button below the New RiverFlow2D Project dropdown, and select Delete Scenario:
*IMPORTANT* Please note that deleting a scenario folder manually from the project directory will
cause the entire project to be unusable. This tool must be used in order to avoid this.
18.6 Import an RiverFlow2D project into Multi-scenario mode 210
• When you start the import tool a window is displayed as illustrated in the figure below, you
must specify the project file. DAT to import.
• Once you click [OK], a subfolder with the name of the file is created inside the folder where
the original project is located.
211 Multiple Scenario Project Tool
• All files and sub directories in that main project folder are copied, and the metadata of the
project QGZ is updated with the new location of the layers.
• Finally the drop-down list on the RF2D toolbar is updated with the name of the new scenario.
The files of the original project are kept in the project folder, it is at the discretion of the user delete
it if you think it necessary, the only one that is required then is the QGIS project file (.qgz)
This concludes the tutorial on using the Multiple Scenario Project tool within the QGIS RF2D
toolbar.
1. Create the bridge geometry data: Use the QGIS interface to generate the bridge cross section geometry from the terrain profile obtained from the digital elevation model . 2. Open an existing project: Load the existing RiverFlow2D project in QGIS, ensuring the project contains required layers such as the domain contour and DEM . 3. Enter the bridge polyline in the Bridges layer: Create and edit a new Bridges layer, draw the bridge line using the digitalization toolbar, and ensure it's correctly positioned . 4. Enter the bridge data: Input attributes like bridge name, size element, and elevation details in the Bridges layer attribute dialog . 5. Generate the mesh: Use the Generate TriMesh feature to align the mesh with the bridge polyline . 6. Export files to RiverFlow2D: Select the appropriate DEM layer and export the project in the required format . 7. Run the model: Load the project file in the RiverFlow2D program, review the bridge geometry file, and initiate the simulation .
To create a digital elevation model (DEM) using a raster file, elevation data must first be loaded from an ASCII grid file. This involves adding the raster data as a layer, selecting the appropriate CRS, and rendering it, possibly using Hillshade for a more informative display. This model enhances hydrological modeling by providing a detailed topographical surface, which is critical for simulating water flow and understanding terrain impact on hydrological processes .
Paraview basics are essential for creating high-impact graphics and animations because they provide tools for both 2D and 3D visualizations. For 2D, it includes creating bed elevation maps and velocity vector fields; for 3D, it is used to develop water elevation graphics and velocity field graphics. Paraview also helps in generating animations and streamlines which enhance the visualization and understanding of hydrological data .
Managing multi-scenario projects in RiverFlow2D involves using QGIS to handle different scenarios within a single project framework. This starts with creating a new scenario through the interface elements provided and switching between scenarios using scenario management tools. Scenarios can also be deleted using the scenario menu options. Additionally, existing RiverFlow2D projects can be imported into multi-scenario mode, allowing for comprehensive management and comparison of various hydrological scenarios within the same project .
Creating elevation graphics and velocity field graphics for 3D visualizations in Paraview is essential for comprehending water dynamics and aiding in better decision-making for hydrological infrastructures. The methodology includes creating 3D water elevation graphics by adding a layer that considers height and elevation (h+z), and representing velocity fields using vector graphics. This approach allows for detailed visualization of how water flow varies in a 3D space, facilitating more accurate analyses of hydrological phenomena .
Boundary conditions are vital in hydrological modeling as they specify the entry and exit points of water flow in the system. They are applied by defining segments for inflow and outflow within the model using polygons. Parameters for these segments are loaded from relevant files, such as hydrographs for inflow. This helps in accurately capturing the interactions of different water forces and guides the simulation of flow patterns under various conditions .
To enhance terrain visualization in QGIS, strategies such as creating detailed meshes using the GMSH mesh generation plugin allow for the refinement of finite-volume meshes and the representation of hydraulic structures like dams and levees . Implementing rendering tools available in QGIS, such as the creation of observation points, cross sections, and profiles, helps in detailed data interpretation by providing focused analysis of specific terrain sections . Additionally, employing plugins for tasks like interpolating DEM data can enhance the resolution and detail of terrain visualization . These strategies increase the accuracy of data interpretation and help in identifying subtle terrain features and hydrological impacts .
The use of Manning’s N coefficient in hydrological models significantly impacts the simulation of water flow by accounting for the resistance exerted by the riverbed and banks on the flow of water. It is a crucial parameter for determining flow resistance and velocity, thus affecting water level predictions and flow patterns . To integrate Manning’s N into a project, one needs to follow a systematic process using a GIS interface like QGIS. First, open the existing project and load the shape files containing the Manning’s N polygons. These polygons include spatial variations of Manning’s N values . You import these polygons into the model by ensuring they align with the Mannings N layer, possibly modifying field names for consistency. After that, copy and paste these polygons into the Manning N layer, ensuring to save changes . Finally, export the modified data to a simulation tool like RiverFlow2D, which uses this data to run the hydrological models ."}
Raster elevations from X, Y, Z datasets enhance hydrological analysis in RiverFlow2D by providing a detailed digital elevation model (DEM). To generate this data, the process begins by creating a layer from delimited data containing X, Y, Z points, which represent spatial coordinates and elevation, respectively. These points are loaded into QGIS, ensuring the correct assignment of fields . Next, using the Interpolation plugin in QGIS, the point data is interpolated into a raster format. The interpolation can be done using methods like Triangular Irregular Network (TIN) or Inverse Distance Weighting (IDW), with TIN selected in this process. This produces a raster of specific resolution (e.g., 10ft x 10ft cells). Once created, the raster can be styled and moved appropriately within the layer panel to not interfere with other data . This raster is then used in RiverFlow2D simulations by exporting it as a DEM raster layer. The export process involves selecting the raster layer and confirming its use for hydrological modeling, which supports the simulation of features like initial water surface elevation and bed topography in hydrological models .
The snapping tool in RiverFlow2D is used to accurately draw hydrological boundaries by creating contiguous polygons without overlaps or gaps. It facilitates the precise alignment of adjacent polygon borders, which is crucial for defining hydrological features such as Manning’s n coefficients distributed across a mapped area . By configuring the snapping tool appropriately, users can ensure that polygons align perfectly along shared edges, which is significant for preventing errors associated with manual polygon digitization, such as unintended overlaps and empty spaces . This precision is essential for creating accurate hydrological models that reflect realistic terrain and land use conditions, enabling reliable simulation results in RiverFlow2D .