Tutorial M04 DRAFT
USEFUL LINKS | ||
Wiki Links | Help | Downloads |
TUFLOW FV Wiki Main Page | Products Support/Contact | TUFLOW FV Downloads |
TUFLOW FV Tutorials | Requesting a Licence | Tutorial Module Data |
TUFLOW Classic/HPC Wiki | TUFLOW FV Glossary | Manuals |
Tutorial Description
Read the Tutorial Model Introduction before starting this tutorial. It outlines programs requiring installation.
This tutorial is designed to introduce the skills required for floodplain modelling and builds upon the previous tutorials Tutorial Module 1, Tutorial Module 2 and Tutorial Module 3. Specifically, this tutorial demonstrates how to build three models:
- A 2D floodplain model without topographic alterations or structures.
- A 2D floodplain model with topographic alterations.
- A 2D floodplain model with both topographic alterations and structures.
The workflow uses QGIS and Notepad++ to setup and run our models.
Model Domain
The tutorial focuses on a inland floodplain. The model domain is 0.5 km² and includes a low-flow channel and hydraulic structures.
Requirements And Downloads
Requirement | Brief Description |
---|---|
Model Data | Download the Tutorial Module 4 Data Package MADDYTODO link this. |
Assumed Knowledge | It is recommended to complete Tutorial Module 3 prior to completing this tutorial. |
Prepare Your Working Environment
Copy and unzip the folder to your preferred working location, for example E:\TUFLOWFV\Tutorial_M04.
- The Complete_Model folder contains a completed version of the tutorial and its supporting files. You can use this as a reference if you require.
- The Exe folder contains the TUFLOW FV executable used to run your models.
- The Module_Data folder contains the model files required to complete this tutorial.
- The Working folder is for the files you create and work within.
Note: All file paths referred to will be relative to this base directory. For example, ModuleData\Mesh\Floodplain001.2dm refers to E:\TUFLOWFV\TutorialM03\ModuleData\Mesh\Floodplain_001.2dm MADDYTODO fix these paths and file examples
Initialise The Project With GIS Integration
Save The Workspace
Launch QGIS and use the below steps and video to save the workspace in the Working folder:
- 1. From the menu bar select Project > Save As.
- 2. Navigate to Working folder.
- 3. Save the workspace as Floodplain_001.qgz.
Set The Projection
Use the below steps and video to set your workspace projection:
- 1. Go to Project > Properties.
- 2. In the CRS tab, type WGS 84.
- 3. Select WGS 84 / UTM zone 60S in the Predefined Coordinate Reference Systems section.
- 4. Click Apply and OK.
Configuring A TUFLOW FV Project
The TUFLOW Viewer plugin is used to configure the TUFLOW FV project. This includes specifying the model and executable file paths, defining the GIS projection (i.e. the geographic coordinate system used for the TUFLOW FV model, all inputs need to use the same projection) and writing GIS empty files for model inputs. Use the below steps and video as guide to configure your TUFLOW FV project:
- 1. Select the Configure / Create TUFLOW Project symbol from the TUFLOW Plugin toolbar.
- 2. Click Select CRS and use the filter to select: WGS 84 / UTM zone 60S.
- 3. Click Browse... to select the folder location of the Working folder. This creates the default TUFLOW FV model directory and sub-folders.
- 4. Click Browse... to select the location of the TUFLOW FV single precision executable file. Note: The provided version may differ from the video, however use the build provided in the Exe folder.
- 5. Select SHP as the GIS Format.
- 6. Select TUFLOW Flexible Mesh (TUFLOW FV).
- 7. Tick all box options:
- Save Default Settings Globally (for all projects): The settings configured by this window sets the default for opening a new QGIS workspace.
- Create Model Folder Structure: The TUFLOW sub-folders (e.g. bc_dbase, model, runs) are made within the Working\TUFLOWFV folder.
- Create Template Files: This creates the 'empty' gis file template folder in Working\TUFLOWFV\model\gis folder. It contains all the TUFLOW FV template files in the projection set above. It is important to create new template files for each project to ensure the projection is correct.
- Tutorial Model: Sets a command within the automatically generated FVC instructing TUFLOWFV to run the tutorial model licence free.
- 8. Click OK and a TUFLOW FV DOS console window opens. This runs the first part of a TUFLOW FV model initialisation and creates TUFLOW FV folder structure, projection file, TUFLOW FV empty GIS files and base FVC file called Create_Empties.fvc. In the windows explorer navigate to Working\TUFLOWFV to review the newly created folder structure and files.
Reviewing The Model Domain
Become familiar with the model location, using aerial imagery, DEM, and the model mesh.
Firstly, review the model location and DEM using the below steps and video:
- Drag and drop the DEM_UTM_z60s.asc file from Module_Data\DEM into the workspace.
- Drag and drop the Aerial_Image.jpg file from Module_Data\Aerial_Photo into the workspace.
- Right click on the Aerial_Image in the Layers panel and select Properties. From the Transparency tab update the Global Opacity to 50%. Apply and OK.
- Right click on the DEM_UTM_z60s in the Layers panel and select Properties. From the Symbology tab select the Render type drop down and select Hillshade. Apply and OK.
Use the below steps and video to copy and review the model mesh:
- Copy Floodplain_001.2dm from Module_Data\Mesh and paste it into Working\TUFLOWFV\model\geo. Then drag and drop Floodplain_001.2dm into the workspace.
- Right click on the Floodplain_001.2dm file in the Layers panel and select Properties. Set the following symbology:
- Select the Rendering tab and check Native Mesh Rendering and assign a Line width of 0.10.
- Select the Contours tab and update the Color ramp to Viridis. Select Apply and OK.
Base 2D Floodplain Model
This section of the tutorial outlines the process of building a basic 2D floodplain model. Specifically, it covers:
- Defining the model boundaries and inflow locations.
- Reviewing the model materials.
- Review flux and create a PO point.
- Reviewing the floodplain inflow boundary conditions.
- Outlines the TUFLOW FV control file and materials include file.
Required Files
To save you time and allow focus on model simulation and review, multiple model files have been provided:
- From data package copy the files in the Module_Data folder outlined in the Module_Data\ column (refer to below table).
- Paste these files into the relevant folders outlined in the Copy to Working\TUFLOWFV column (refer to below table).
Module_Data\GIS | Copy to Working\TUFLOWFV | Description |
---|---|---|
2d_mat_Land_Use_001_R.* | \model\gis | Specifies the spatial location of varying material types within the model domain. |
2d_ns_Flux_Monitoring_001_L.* | \model\gis | GIS polyline layer that defines 2d_ns used to output fluxes across nodestrings. The suffix _L defines a polyline feature type. |
Module_Data\Model | Copy to Working\TUFLOWFV | Description |
Floodplain_001.fvc | \runs | TUFLOW FV control file defined as .fvc file. |
Materials_001.fvc | \runs | Materials include file which specifies the bed roughness of the material types within the model domain. |
Inflows_001.csv | \bc_dbase | Flow vs time inflow boundary condtion. |
*Multiple files with the same name as the shapefile but with a different file extension support a shapefile (e.g. .shx, .prj, .cpg, .dbf). Ensure you copy all files into relevant folder.
Spatial Definition Of Open boundaries
TUFLOW FV uses nodestrings to specify the location of open boundary conditions. This section demonstrates how to create the nodestrings by first importing an empty template GIS layer using the TUFLOW plugin, then digitising the nodestring locations.
Use the below steps and video to import an empty 2d_ns shapefile:
- Select the Import Empty File symbol from the TUFLOW Plugin toolbar. Visit TUFLOW FV Empty Files for more information on empty file types.
- In the empty dialog box set the following:
- Check the Empty Directory is set to the Working\TUFLOWFV\model\gis\empty directory.
- Select the Empty Type 2d_ns.
- Update the Run ID name to Open_Boundaries_001.
- Check the Geometry Type: Lines.
- Select OK.
- From the TUFLOW Plugin toolbar select Apply TUFLOW Styles to Current Layer. This style shows the direction of the nodestring which is nesseccary for the next steps.
Now that the empty Nodestring file has been the open boundaries can be digitised. Use the following steps and video to digitise the nodestrings:
- Select 2d_ns_Open_Boundaries_001_L from the Layers panel and select Toggle Editing from the Digitizing toolbar. Then Select Add Line Feature and zoom into the downstream channel boundary (refer to video).
- Using the video as a reference digitise a line from right to left along the boundary. Note the boundary conditions do not need to be snapped to the mesh when using the BD flag.
- Use the right mouse button to terminate the line. An attributes dialog will appear, use the below attributes:
- ID = Downstream
- Flags = BD
- Zoom into the upstream channel boundary (refer to video). Repeat Step 2 - 3 and use the below attributes:
- ID = Upstream
- Flags = BD
- From the Digitizing toolbar select Toggle Editing and Save.
- From the TUFLOW Plugin toolbar select Apply Labels to Current Layer. Zoom out and review – the nodestrings should resemble those in the video.
Add Point Inflow
TUFLOW FV uses a 2d_sa point file to define a source-point boundary (flow vs. time) by applying the flow directly to the cell where the point is digitised. Follow the steps below and video to create the 2d_sa file and digitise the point location:
- Select the Import Empty File symbol from the TUFLOW Plugin toolbar.
- In the empty dialog box set the following:
- Check the Empty Directory is set to the Working\TUFLOWFV\model\gis\empty directory.
- Select the Empty Type 2d_sa.
- Update the Run ID name to Point_Inflows_001.
- Check the Geometry Type: Points.
- Select OK.
- Select 2d_sa_Point_Inflows_001_P from the Layers panel and select Toggle Editing from the Digitizing toolbar. Then Select Add Point Feature and zoom into the downstream channel boundary (refer to video).
- Add a point over the dam towards the far eastern boundary (refer to video) and use below attribute:
- Name = FC04
- From the Digitising toolbar select Toggle Editing and Save. From the TUFLOW Plugin toolbar select Apply TUFLOW Styles to Current Layer and Apply Labels to Current Layer.
Review Materials
TUFLOW FV uses polygons to specify the spatial location of varying material types within the model domain. To reduce the amount of digitising required in this tutorial we have provided the material file. In this model we have assigned five material types:
Landuse | Manning's 'n' Bed Roughness | Material ID |
---|---|---|
Pasture | 0.04 | 1 |
Roads | 0.02 | 2 |
Buildings | 0.10 | 3 |
Water bodies | 0.03 | 4 |
Creek Channel | 0.08 | 5 |
Use the below steps and video to review the model material types:
- Navigate to Working\TUFLOWFV\model\gis.
- Drag and drop 2d_mat_Land_Use_001_R.shp into the QGIS workspace.
- Select Apply Label current layer and review the material types throughout the model domain.
Flux And Point Outputs
TUFLOW FV uses nodestrings to specify the spatial location of flux reporting time series locations. To reduce the amount of digitising required in this tutorial the 2d_ns_Flux_Monitoring_001_L.* polyline file has been provided.
Use the below steps and video to review the provided flux nodestrings:
- Navigate to Working\TUFLOWFV\model\gis.
- Drag and drop 2d_ns_Flux_Monitoring_001_L.shp into the QGIS workspace.
- Select Apply TUFLOW Styles to Current Layer and Apply Label current layer.
Points can be used to define point output locations for time series reporting. Follow the steps below and video to create a 3d_po file and digitise the point output location:
- Select the Import Empty File symbol from the TUFLOW Plugin toolbar.
- In the empty dialog box set the following:
- Check the Empty Directory is set to the Working\TUFLOWFV\model\gis\empty directory.
- Select the Empty Type 3d_po.
- Update the Run ID name to Output_Points_001.
- Check the Geometry Type: Points.
- Select OK.
- Select 3d_po_Output_Points_001_P from the Layers panel and select Toggle Editing from the Digitizing toolbar. Then Select Add Point Feature and zoom in towards the Flux nodestring CH950 the downstream channel boundary (refer to video).
- Add a point in the floodplain (refer to video) and use below attribute:
- Label = Point_1
- From the Digitising toolbar select Toggle Editing and Save.
- Close all model files by holding shift and selecting model files from the layer panel, right click and select Remove Layer.... Save QGIS workspace. MADDYTODO add this step into the video.
Boundary Condition Data.
Boundary conditions define how external hydrodynamic (water movement) and meteorological (weather-related) forces are applied to a model. This model uses a hydrodynamic boundary condition type, and the data is provided in a .csv file to simplify the setup.
To review the inflow data, open Working\TUFLOWFV\bcdbase\Inflows.csv, and plot Time_hr on the x-axis and FC01 on the y-axis. Note FC01 represents the flow rate (m³/s) at the upstream boundary (2d_ns).
For this tutorial, the boundary conditions represent a typical flood event. Key features of the hydrograph:
- Rising limb: The flow increases quickly from zero, often with a steep slope, depending on how quickly the rainwater reaches the river.
- Peak flow: The highest point on the graph, showing the maximum flow rate during the flood event.
- Falling limb: After the peak, the flow decreases gradually, but it may take some time before the water level returns to normal.
FC04 is applied at the source-point boundary (2d_sa), which represents a small sub-catchment of the floodplain, resulting in flow rates that are significantly lower than those of the main channel. Note the boundary conditins in columns D-J will be used in later sections of the tutorial. Once completed reviewing the model boundary condition data Close the Inflows.csv.
TUFLOW FV Control File
The TUFLOW FV Control File (.fvc extension) is created via a text editor. Notepad++ is recommended for this purpose as it allows for syntax highlighting of TUFLOW FV specific commands. This configuration information is provided in Notepad++ Tips.
The required commands are provided in the code blocks below. A brief description is also provided via a series of comments (green text after ! syntax). Copy the commands into your fvc file and save the file in Notepad++. [MADDYTODO chat to mitch about the layput of the FVC- it follows previous tutes but is differnt tot he example he sent me plus the BC is different here (aka I dont love have the BC or flux NS in the geometry block]
! TUFLOW FV Tutorial ! 2D Floodplain Model GIS FORMAT == SHP ! GIS layers will be ESRI Shapefile SHP Projection == ..\model\gis\projection.prj ! Projection string. All GIS layers in the model need to be in the same reference system Tutorial Model == ON ! Run the model in license free demo/tutorial mode ! Write Empty GIS Files == ..\model\gis\empty ! Generate empty template GIS layers. Already completed via QGIS
!__________________________________________________________________________________________________________________________________ ! SIMULATION CONFIGURATION Hardware == CPU ! The model uses the CPU Spatial Order == 1,1 ! Horizontal 1st order scheme, Vertical 1st order scheme. 1st-order schemes assume a piecewise constant value of the modelled variables in each cell Units == Metric ! Specifies the model Units to metric (default) Bottom Drag Model == Manning ! Use Manning's 'n' Coefficient for bed roughness
!__________________________________________________________________________________________________________________________________ ! TIME COMMANDS Time Format == HOURS ! Specifies the model time format to hours (default), when using hours time units are in decimal hours Start Time == 0.0 ! Model start time in hours End Time == 3.0 ! Model end time in hours CFL == 0.95 ! Courant stability criterion Timestep Limits == 0.01, 0.3 ! Minimum model timestep (s), Maximum model timestep (s)
!__________________________________________________________________________________________________________________________________ ! MODEL PARAMETERS Cell Wet/Dry Depths == 0.001, 0.02 ! Cell wet depth (m) below this depth the cell has its momentum set to zero, Cell dry depth (m) below this depth cell is dropped from computation (mass conserving) Momentum Mixing Model == Smagorinsky ! Sub-grid scale eddy viscosity model Global Horizontal Eddy Viscosity == 0.4 ! Smagorinsky coefficient Global Horizontal Eddy Viscosity Limits == 0.05, 99999. ! Minimum eddy viscosity (m^2/s), Maximum eddy viscosity (m^2/s)
!__________________________________________________________________________________________________________________________________ ! GEOMETRY Geometry 2D == ..\model\geo\Floodplain_001.2dm ! Computational mesh
! Topography/Bathymetry Set Zpts == 90.0 ! Sets the default elevation (m) Read Grid Zpts == ..\model\geo\DEM_UTM_z60s.asc ! Digital elevation model ! Materials Set Mat == 1 ! Sets the default material to Ocean Read GIS Mat == ..\model\gis\2d_mat_Land_Use_001_R.shp ! Material 2d_mat polygon GIS layer Include == Materials.fvc ! Material properties kept in TUFLOW FV Include file to keep fvc organised ! Boundary and Flux Reporting Nodestrings Read GIS Nodestring == ..\model\gis\2d_ns_Open_Boundaries_001_L.shp ! Open boundary 2d_ns nodestring GIS layer Read GIS SA == ..\model\gis\2d_sa_Point_Inflows_001_P.shp ! Point inflow 2d_sa point GIS layer Read GIS Nodestring == ..\model\gis\2d_ns_Flux_Monitoring_001_L.shp ! Flux 2d_ns nodestring GIS layer
!__________________________________________________________________________________________________________________________________ ! INITIAL CONDITIONS
! Not applicable. Assume dry downstream boundary at start time.
!__________________________________________________________________________________________________________________________________ ! BOUNDARY CONDITIONS BC == Q, Upstream, ..\bc_dbase\Inflows.csv ! Nodestring flow, nodestring ID provided from your 2d_ns nodestring GIS layer and csv input BC Header == time_hr, FC01 ! Decimal hour time, flow (m^3/s) Sub-Type == 4 ! Nodestring cell inflow, with cell width and depth considered. For overland application with inflows over an initially dry bed, subtype 4 is recommended End BC
BC == QN, Downstream, 0.01 ! Cell inflow (m3/s), Flow vs time cell inflow boundary End BC
BC == QC, FC04, ..\bc_dbase\Inflows.csv ! Cell inflow (m3/s), Flow vs time cell inflow boundary file BC Header == time_hr, FC04 ! Decimal hour time, flow (m^3/s) End BC
!__________________________________________________________________________________________________________________________________ ! HYDRAULIC STRUCURES
! Not applicable. Structures will be covered in later sections of the tutorial.
!__________________________________________________________________________________________________________________________________ ! OUTPUT COMMANDS
Logdir == log ! Directory where the TUFLOW FV log file will be saved
Write Check Files == ..\check ! Directory where GIS check files will be saved
Output Dir == ..\results\ ! Directory where time series and map output results will be saved
Output == netcdf ! Output block, NetCDF output format Output Parameters == h, v, d ! Water level, velocity, water depth
Output Interval == 300. ! Results will be saved every 300 seconds (5mins) of simulation time Output Statistics == max ! Tracks maximum statistics type Output Statistics dt == 1 ! Output statistics dt in seconds End Output
Output == flux ! Output fluxes across nodestrings Output Interval == 180. ! Results will be saved every 180 seconds (3mins) of simulation time
End Output
Output == mass ! Report whole of model mass content Output Interval == 300. ! Results will be saved every 300 seconds (5mins) of simulation time
End Output
Output == points ! Output results at fixed point location Read GIS PO == ..\model\gis\3d_po_Output_Points_001_P.shp ! Fixed point location file
Output Parameters == h, v, d ! Water level, velocity, water depth Output Interval == 180. ! Results will be saved every 180 seconds (3mins) of simulation time End Output
Since multiple material types are used in this model, an include file (Material.fvc) has been utilised to keep the FVC organised. The required material commands are provided in the code block below, with brief descriptions included as comments (green text after ! syntax).
! Material Specification ! Bottom roughness coefficients for Manning's Bed Roughness Model
Material == 1 ! Pasture Bottom Roughness == 0.04 ! Manning's 'n' roughness coefficient End Material
Material == 2 ! Roads Bottom Roughness == 0.02 ! Manning's 'n' roughness coefficient End Material
Material == 3 ! Buildings Bottom Roughness == 0.1 ! Manning's 'n' roughness coefficient End Material
Material == 4 ! Water Bodies Bottom Roughness == 0.03 ! Manning's 'n' roughness coefficient End Material
Material == 5 ! Creek Channel Bottom Roughness == 0.08 ! Manning's 'n' roughness coefficient End Material
Run TUFLOW FV
The model will be run using a Windows Batch file. This approach calls the TUFLOW FV executable file (.exe) and runs the TUFLOW FV Control file (.fvc).
- An example batch file (run_simulations.bat) has been included in the tutorial dataset download within the Complete_Model\TUFLOWFV\runs folder.
- Copy the .bat file into your Working\TUFLOWFV\runs and open it in Notepad++.
- Line 2 (as shown in the figure below) includes a file path to the executable from Exe\2025.0.0. Note: A relative path is used for the executable and the FVC, a full file path can also be used. The path is saved to the local Windows environment variable exe. Line 4 sets the number of parallel CPU threads to run the simulation on. Line 6 calls the TUFLOW FV executable file (it's path is saved in the environmental variation exe) and runs Floodplain_001.fvc. Line 9 keeps the Windows prompt open, rather than closing it automatically after the simulation completes.
- On Line 7 and 8 ensure to add the text rem. REM stands for remark and it disables the line from being executed by Windows. This batch file will run Floodplain_001.fvc but it will not run the simulation Floodplain_002.fvc and Floodplain_002.fvc (these are additional models presented later in the tutorial).
- Save the batch file and double click it in file explorer to run the simulation.
To run the batch file, double click on run_simulations.bat from Windows Explorer:
For more information on setting up a .bat file and running multiple models, head to Running TUFLOW FV.
Review Results
In this section we will review map output and time series results in QGIS using the TUFLOW Viewer Plugin.
As shown below our model setup specifies an output format as a NetCDF file with the map output parameters water level (h), velocity (v), and water depth (d), saved every 300 seconds (5 mins).
Output == NetCDF ! Output block, NetCDF output format Output Parameters == h, v, d ! Water level, velocity, water depth Output Interval == 300. ! Results will be saved every 300 seconds (5mins) of simulation time End Output
The map output results are saved to the file: Working\TUFLOWFV\results\Floodplain_001.nc.
Note: Model outputs from TUFLOW FV will have the same file name as the TUFLOW FV Control file, however the extension is modified, in this case to '.nc', for NetCDF format.
Use the below steps and video to set up the TUFLOW Viewer display and open the results:
- Open the TUFLOW Viewer and move it under the layer panel to make it easier to visualise the results (refer to video).
- From the TUFLOW Viewer select File > Load Results - Map Outputs. Navigate to Floodplain_001.nc in the Working\TUFLOWFV\results folder and open it.
Use the below steps and video to specify the display options of the results:
- Under the Result Type, select velocity vector and water depth. Then right click within the Result Type panel and select Properties.
- From the Layer Properties - Floodplain_001 -- Symbology select the Rendering tab. Make sure the Native Mesh Rendering is checked and update the Line width to 0.1 and click Apply.
- Select the Vectors tab and update the following:
- Check Display on User Grid.
- Specify an X spacing of 15px and Y spacing of 15px.
- Set the Arrow Length to Scaled to Magnitude with a length of 8.0.
- Select Apply.
- Select the Contours tab and update the following:
- Set the Color ramp to Blues.
- Select Apply and OK.
From the TUFLOW Viewer press Play Through Timesteps to visuilse how the depth and velocity vectors change throughout the simulations. Pay particular attention to how the roadways act as hydraulic controls on the depth and velocity vectors throughout the floodplain. It's important to note that the current model does not incorporate topographic alterations or hydraulic structures (pipes and culverts) around the roadways. These features significantly affect water flow, and their inclusion will enhance the accuracy of the model. We will address these adjustments in later sections of this tutorial.
Use the below steps to create a timeseries of the velocity results:
- From the Result Type unselect velocity vectors and water depth. Select velocity.
- From the TUFLOW Viewer click the First Timestep button and check Show Current Time.
- Zoom in on the roadway near the upstream end of the channel. (refer to video).
- Select the Plot Time Series drop down
and check velocity.
- Select the Plot Time Series button the
and your cursor will become a crosshair [+]. Digitise the time series point within the channel downstream of the roadway (refer to video).
- From the TUFLOW Viewer press Play Through Timesteps. Observe the delay in velocity as the road embankment retains the flow, followed by a sharp increase in velocity once the road is overtopped.
Use the below steps to view the flux and PO results:
- From the TUFLOW Viewer select Clear Current Plot and uncheck Show Current Time.
- select File > Load Results - Time Series. Navigate to Floodplain_001.tpc in the Working\TUFLOWFV\results\plot folder and open it.
- When prompted Do you also want to open result GIS layer? select Yes.
- Select the Apply Label to Current Layer for both the point and line shapefiles.
- From the Layer panel make sure Floodplain_001_PLOT_L is selected. Then under the Result Type select Flow from the Time Series option.
- Using the Select features cursor select the flux lines and view the plot window. Holding shift select flux lines NSCH50 and NSCH1120 and compare how the flux changes across the model domain. When finished click on the workspace window to unselect the flux lines.
- From the Layer panel select Floodplain_001_PLOT_P. Then under the Result Type > Time Series select Depth and unselect the Flow.
- Using the Select Features cursor, select Point_001. This point represents the depth result at that cell throughout the model duration, which is useful for analysing model output at that specific location.
Now close the map output and time series results:
- From the TUFLOW viewer under Open Results right click on the Floodpoain_001 and select Close Results.
- From the Layers panel hold shift and select Floodplain_001_PLOT_P and Floodplain_001_PLOT_L. Right click and select Remove Layer....
2D Floodplain Model With Topographic Alterations
This section of the tutorial outlines how to make topographic changes in the model using using 2d_zln (point and line vectors) files to represent the road crests and channel thalweg within the floodplain.
Specifically, this section covers:
- Defining the road crest.
- Defining the channel thalweg.
- Updating the FVC file with topographic changes.
- Reviewing check files to ensure the topographic changes are correctly applied.
- Comparing the original floodplain model results with the updated model results that account for topographic changes.
Required Files
To save time and focus on model simulation and review, multiple model files have been provided:
- From data package copy the files in the Module_Data folder outlined in the Module_Data\ column (refer to below table).
- Paste these files into the relevant folders outlined in the Copy to Working\TUFLOWFV column (refer to below table).
Module_Data\GIS | Copy to Working\TUFLOWFV | Description |
---|---|---|
2d_zln_Rd_Crest_002_L.* | \model\gis | GIS polyline layer that defines the spatial location of the 2d_zln used to define the road crest. The suffix _L defines a polyline feature type. |
2d_zln_Rd_Crest_002_P.* | \model\gis | GIS point layer that defines the elevation along the 2d_zln polyline file. In the model, this file is used to define spatial variations in elevation along the road crest. The suffix _P defines a point feature type. |
2d_zln_Thalweg_002_L. | \model\gis | GIS polyline layer that defines the spatial location of the 2d_zln used to define the channel thalweg. The suffix _L defines a polyline feature type. |
2d_zln_Thalweg_002_P. | \model\gis | GIS point layer that defines the elevation along the 2d_zln polyline file. In the model, this file is used to define spatial variations in elevation along the channel thalweg. The suffix _P defines a point feature type. |
*Multiple files with the same name as the shapefile but with a different file extension support a shapefile (e.g. .shx, .prj, .cpg, .dbf). Ensure you copy all files into relevant folder.
Reviewing Topographic Alterations
In this tutorial, multiple 2d_zln files are used to define topographic features within the floodplain. This approach is particularly useful for specifying the crest elevation of roads or levees that traverse the floodplain, or for defining the thalweg. In this example, the point files contain elevation data, while the polyline shapefile includes the spatial location of the road crest and thalweg. This setup is beneficial for managing data and especially helpful when viewing or interrogating the data in GIS.
Use the below steps and video to review the channel thalweg 2d_zln shapefile provided:
- Navigate to TUFLOWFV\model\gis and drag and drop the following files into the workspace. Note that the file extension for each file must be .shp.
- 2d_zln_Thalweg_002_P.shp.
- 2d_zln_Thalweg_002_L.shp.
- From the Layers panel select 2d_zln_Thalweg_002_P and click Apply Label to Current Layer.
- Right click on 2d_zln_Thalweg_002_L and select Properties. Update the symbology with the following:
- Line colour blue.
- Line width 0.5.
- Review the channel thalweg and elevations values
Use the below steps and video to review the road crest 2d_zln shapefile provided:
- Navigate to TUFLOWFV\model\gis and drag and drop the following files into the workspace. Note that the file extension for each file must be .shp.
- 2d_zln_Rd_Crest_002_P.shp.
- 2d_zln_Rd_Crest_002_L.shp.
- From the Layers panel select 2d_zln_Rd_Crest_002_P and click Apply Label to Current Layer.
- Right click on 2d_zln_Rd_Crest_002_L and select Properties. Update the symbology with the following:
- Line colour black.
- Line width 0.5.
- Review the road crest elevations values. Note that one of the road crests in 2d_zln_Rd_Crest_002_L is incomplete.
Editing Topography
This section demonstrates how to digitise the missing road crest in the 2d_zln_Rd_Crest_002_L.
Use the following steps and video to digitise the missing road crest:
- From the Layer panel select 2d_zln_Rd_Crest_002_P and toggle off Apply Label to Current Layer. This will help you see where you need to snap the line to.
- Select Enable Snapping from the toolbar and then select Advanced Configuration > Open Snapping Options....
- From the Project Snapping Settings dialog check 2d_zln_Rd_Crest_002_P. This will enable snapping to this layer only. Leave the dialog open and move to the side.
- From the Layer panel select 2d_zln_Rd_Crest_002_L. Then select Toggle Editing and Add Line Feature from the toolbar.
- Zoom into the missing road crest and digitise the line by snapping it to each elevation point (refer to the video).
- Once finished right click to complete the line. In the feature attributes dialog set the Elevation to -99 and select OK. Note as mentioned previously, the points are used to assign elevations along the line; therefore, no elevation is assigned to the line itself.
- From the Project Snapping Settings dialog uncheck 2d_zln_Rd_Crest_002_P and close. Toggle off Enable Snapping.
- Select Save Layer Edits and Toggle Editing. Close all 2d_zln files in the Layers panel.
Update TUFLOW FV Control File
Save a copy of Floodplain_001.fvc and name it Floodplain_002.fvc. Open in Notepad++ and within the Geometry block update the ! Topography / Bathymetry section to read the GIS 2d_zln files as shown below (copy the lower two command lines): (GS TODO: Do you think it's unclear what they need to copy?)
!__________________________________________________________________________________________________________________________________ ! GEOMETRY Geometry 2D == ..\model\geo\Floodplain_001.2dm ! Computational mesh
! Topography/Bathymetry Set Zpts == 90.0 ! Sets the default elevation (m) Read Grid Zpts == ..\model\geo\DEM_UTM_z60s.asc ! Digital elevation model Read GIS Z Line == ..\model\gis\2d_zln_Thalweg_002_L.shp | ..\model\gis\2d_zln_Thalweg_002_P.shp ! River thalweg detailed survey Read GIS Z Line == ..\model\gis\2d_zln_Rd_Crest_002_L.shp | ..\model\gis\2d_zln_Rd_Crest_002_P.shp ! Road crest detailed survey
Run TUFLOW FV
Open the run_simulations.bat has been included in the tutorial dataset download within the Complete_Model\TUFLOWFV\runs folder. Update the following and run the model:
- Line 6 add the text rem (as shown in the figure below) to disables the line from being executed by Windows.
- On Line 7 remove the text rem so that the batch file will run Floodplain_002.fvc.
- Save the batch file and double click it in file explorer to run the simulation as shown in section Run TUFLOW FV. MADDYTODO update link when in final phase.
Review Check Files
Check files are used by modellers and reviewers to confirm that the constructed model is as intended. These files are provided as the model initialises, ensuring that the modeller does not have to wait for the completion of the simulation to check the model's geometry and boundary conditions. For more information on check files refer to the TUFLOW FV Manual found at the Downloads page. In this tutorial, GIS check files are reviewed to confirm that the elevation changes made to the thalweg and road crest are being correctly applied.
Use the below steps and videos to open the check files and review how the 2d_zln files have altered the model topography:
- From the TUFLOW plugin Toolbar select Import Check Files from Folder. In the dialog, specify the following:
- Ensure the Check Directory is set to the model check folder e.g. Working\TUFLOWFV\check.
- Specify the Run ID as Floodplain_002 and select OK.
- Uncheck all imported files and check on Floodplain_002_zln_zpt_check_P and toggle on Apply Label to Current Layer.
- Review how the 2d_zln files have increased and decreased the elevations along the road crest and thalweg. For more information see Check Files zln zpt check P.
Use the steps below and the video to review the mesh check file, which represents the final mesh, including modifications from the .fvc file, such as ZB updates:
- Toggle off Apply Label to Current Layer for Floodplain_002_zln_zpt_check_P.
- Check on Floodplain_002_mesh_check_R from the layer panel. Right click and select Properties. Under Labels set the following:
- From the drop down select Single Labels.
- From the Value drop down select ZB.
- Select the expression builder and in the dialog type the following expression round("ZB",2) select OK.
- Under Buffer options check Draw text buffer.
- Under Text options update the colour to blue and select Apply > OK.
- Zoom into the road crest you digitises earlier and view the elevations along the road. For more information on the mesh_check outputs see Check Files mesh check R.
Use the steps below and the video to compare how the mesh has changed between Floodplain_001 to Floodplain_002:
- From the windows explore navigate to Working\TUFLOWFV\model\check.
- Drag and drop Floodplain_002_mesh_check_R.shp into the QGIS workspace.
- Toggle on Apply Label to Current Layer for Floodplain_002_zln_zpt_check_P and Apply Tuflow Styles to Floodplain_002_mesh_check_R.
- Right click on Floodplain_001_mesh_check_R and select Properties. Under Labels set the following:
- From the drop down select Single Labels.
- From the Value drop down select ZB.
- Select the expression builder and in the dialog type the following expression round("ZB",2) select OK.
- Under Text options update the colour to magenta.
- Under Buffer options check Draw text buffer and select Apply > OK.
- Compare Floodplain_001_mesh_check_R and Floodplain_002_mesh_check_R. How does the difference compare with the Floodplain_002_zln_zpt_check_P?
- Close all check files in the Layers pane.
Review Results
This section uses timeseries plots of the results to review how topographic changes have affected the water levels.
Use the below steps and video to compare the water level timeseries of Floodplain_002 and Floodplain_001:
- Open the TUFLOW Viewer and dock it under the layer panel as shown in previous reviewing result section. MADDYTODO update final link.
- From the TUFLOW Viewer select File > Load Results - Map Outputs. Open both Floodplain_002.nc and Floodplain_001.nc.
- Make sure both result files are select in the Open Results panel.
- Select the Plot Time Series drop down
and check water surface elevation.
- Select the Plot Time Series button the
and your cursor will become a crosshair [+]. Zoom into the first roadway embankments and digitise a time series point upstream of the road (refer to video).
- Digisities another times series point upstream of the road embankment further down the catchment. Note how increasing the road crest elevation has raised the water level behind the roads, as water is held for longer and accumulates before the road is overtopped.
2D Floodplain Model With Structures
This section of the tutorial outlines how to incorporate hydraulic structures into the model.
Specifically, this section covers:
- Defining hydraulic structures.
- Adjusting elevation to culvert inverts.
- Updating structures within FVC and creating a structures control file.
- Reviewing culvert input file.
- Review results.
Required Files
To save you time and allow focus on model simulation and review, multiple model files have been provided:
- Create a new folder called csv in the Working\TUFLOWFV\model\ directory.
- From data package copy the files in the Module_Data folder outlined in the Module_Data\ column (refer to below table).
- Paste these files into the relevant folders outlined in the Copy to Working\TUFLOWFV column (refer to below table).
Module_Data\Model | Copy to Working\TUFLOWFV | Description |
---|---|---|
Culvert_dbase.csv | \model\csv | CSV file is used to define culvert inputs such as the structure type, geometry, inverts, and hydraulic control parameters. |
Module_Data\GIS | Copy to Working\TUFLOWFV | Description |
2d_ns_Weirs_003_L.* | \model\gis | GIS polyline layer that defines 2d_ns used to define the weirs. The suffix _L defines a polyline feature type. |
*Multiple files with the same name as the shapefile but with a different file extension support a shapefile (e.g. .shx, .prj, .cpg, .dbf). Ensure you copy all files into relevant folder.
Define Culverts
Use the below steps and video to set up the workspace and create an empty file for the culvert nodestrings:
- From the windows explore navigate to Working\TUFLOWFV\model\geo and drag Floodplain_001.2dm into the QGIS workspace.
- Right click on the Floodplain_001.2dm file in the Layers panel and select Properties. Set the following symbology:
- Select the Rendering tab and check Native Mesh Rendering and assign a Line width of 0.10.
- Select the Contours tab and uncheck Show Contours. Select Apply and OK.
- Select the Import Empty File symbol from the TUFLOW Plugin toolbar. In the empty dialog box set the following:
- Check the Empty Directory is set to the Working\TUFLOWFV\model\gis\empty directory.
- Select the Empty Type 2d_ns.
- Update the Run ID name to Culverts_003.
- Check the Geometry Type: Lines.
- Select OK.
Use below steps and videos to digitise the culverts nodestrings within model domain:
- From the Layer Panel select 2d_ns_Culverts_003_L and Apply Tuflow Styles.
- Select Toggle Editing and then Add Line Feature from the Digitizing toolbar. Zoom into the downstream roadway where it traverses the channel (refer to video). If you you are having issues locating where to digitise the culvert nodesrting refer to the complete model files.
- Using the video and mesh as a guide, digitise a nodestring on the downstream side of the roadway. It’s important to start digitising the nodestring on the right bank and end on the left bank. This will ensure that the nodestring is facing the correct direction.
- When complete right click and specify:
- ID as FC01.2_R_DS.
- Repeat on the upstream side of the road, and remember to digitise from the right bank to the left bank.
- When complete right click and specify:
- ID as FC01.2_R_US.
- Turn on Apply Label to Current Layer and Save Layer Edits.
Cont. to digitise the culverts nodestrings within model domain:
- Make sure 2d_ns_Culverts_003_L is selected. Refer to the video and zoom into the roadway towards the eastern dam (refer to video).
- Using the video and mesh as a guide, digitise a nodestring on the downstream side of the roadway, and remember to digitise from the right bank to the left bank.
- When complete right click and specify:
- ID as FC04.1_C_DS.
- Repeat on the upstream side of the road, and remember to digitise from the right bank to the left bank.
- When complete right click and specify:
- ID as FC04.1_C_US.
- Review and Save Layer Edits.
Cont. to digitise the culverts nodestrings within model domain:
- Make sure 2d_ns_Culverts_003_L is selected. Refer to the video and zoom into the upstream roadway where it traverses the channel (refer to video).
- Using the video and mesh as a guide, digitise a nodestring on the downstream side of the roadway, and remember to digitise from the right bank to the left bank.
- When complete right click and specify:
- ID as FC01.1_R_DS.
- Repeat on the upstream side of the road, and remember to digitise from the right bank to the left bank.
- When complete right click and specify:
- ID as FC01.1_R_US.
- Review and Save Layer Edits and Toggle Editing.
Define Culvert Invert Elevation
The culvert invert elevations are set using a 2d_zln file. Use the below steps and video to create 2d_zln empty file:
Select the Import Empty File symbol from the TUFLOW Plugin toolbar. In the empty dialog box set the following:
- Check the Empty Directory is set to the Working\TUFLOWFV\model\gis\empty directory.
- Select the Empty Type 2d_zln.
- Update the Run ID name to Invert_Correction_003.
- Check the Geometry Type: Regions.
- Select OK.
Follow the steps below and refer to the videos to digitise the upstream and downstream invert elevations for each culvert:
- From the Layer Panel select Invert_Correction_003. Select Toggle Editing and then Add Polygon Feature. Zoom into the downstream roadway where it traverses the channel (refer to video).
- On the downstream side of the road, digitise a polygon along the length of the FC01.2_R_DS culvert nodestring, extending approximately one cell width (refer to video)
- When complete right click and specify:
- Elevation as 37.5.
- Repeat on the upstream side of the road. When complete right click and specify:
- Elevation as 37.6.
- Review and Save Layer Edits.
Cont. follow the steps below and refer to the videos to digitise the upstream and downstream invert elevations for each culvert:
- From the Layer Panel select Invert_Correction_003. Refer to the video and zoom into the roadway towards the eastern dam (refer to video).
- On the downstream side of the road, digitise a polygon along the length of the FC04.1_C_DS culvert nodestring, extending approximately one cell width (refer to video)).
- When complete right click and specify:
- Elevation as 42.75.
- Repeat on the upstream side of the road. When complete right click and specify:
- Elevation as 43.35.
- Review and Save Layer Edits.
Cont. follow the steps below and refer to the videos to digitise the upstream and downstream invert elevations for each culvert:
- From the Layer Panel select Invert_Correction_003. Refer to the video and zoom into the upstream roadway where it traverses the channel (refer to video).
- On the downstream side of the road, digitise a polygon along the length of the FC04.1_C_DS culvert nodestring, extending approximately one cell width (refer to video)).
- When complete right click and specify:
- Elevation as 44.5.
- Repeat on the upstream side of the road. When complete right click and specify:
- Elevation as 45.4.
- Review and Save Layer Edits and Toggle Editing. Close all
Review Weirs
Fixed Weir Options can be used to model flow control structures or levees. In this case, a weir structure is added above the existing cell elevation (m above mesh ZB) to model the weir.
Use the below steps and video to review the weir nodestings provided:
- From the windows explore navigate to Working\TUFLOWFV\model\gis and drag 2d_ns_Weirs_003.shp into the QGIS workspace.
- Right click on 2d_ns_Weirs_003 and select Properties. Update the symbology with the following:
- Line width 0.5.
- Turn on Apply Label to Current Layer and review the weirs.
- Close 2d_ns and 2d_zln files.
Update TUFLOW FV Control File
Make a copy of Floodplain_002.fvc and name it Floodplain_003.fvc. Open in Notepad++ and within the Geometry block update the ! Topography / Bathymetry section to read the GIS 2d_zln files as shown below (refer to the last command lines):
!__________________________________________________________________________________________________________________________________ ! GEOMETRY Geometry 2D == ..\model\geo\Floodplain_001.2dm ! Computational mesh
! Topography/Bathymetry Set Zpts == 90.0 ! Sets the default elevation (m) Read Grid Zpts == ..\model\geo\DEM_UTM_z60s.asc ! Digital elevation model Read GIS Z Line == ..\model\gis\2d_zln_Thalweg_002_L.shp | ..\model\gis\2d_zln_Thalweg_002_P.shp ! River thalweg detailed survey Read GIS Z Line == ..\model\gis\2d_zln_Rd_Crest_002_L.shp | ..\model\gis\2d_zln_Rd_Crest_002_P.shp ! Road crest detailed survey Read GIS Z Line == ..\model\gis\2d_zln_Invert_Correction_003_R.shp ! Culvert inverts
Copy the below commands into the empty Hydraulic Structures block:
!__________________________________________________________________________________________________________________________________ ! HYDRAULIC STRUCURES Read GIS Nodestring == ..\model\gis\2d_ns_Culverts_003_L.shp ! Location of culvert structure connections Read GIS Nodestring == ..\model\gis\2d_ns_Weirs_003_L.shp ! Location or broad crested weirs associated with road crossings Include == Structures_003.fvc ! Culvert and weir details
Copy the below commands to the bottom of the Output Commands block. This will output will assist in reviewing and visualising the flow through the structures:.
!__________________________________________________________________________________________________________________________________ ! OUTPUT COMMANDS Output == structflux ! Output fluxes across culvert nodestrings Output Interval == 180. ! Results will be saved every 180 seconds (3mins) of simulation time
End Output
Using Notepad++, create an FVC for structures by opening a new page, saving it in the working/TUFLOWFV/runs directory, and naming it Structures_003.fvc.
Now copy the below commands into Sturctures_003:
! Culvert and Weir Details Structure == Linked Nodestrings, FC01.1_R_US, FC01.1_R_DS ! Linked Structure Location (from FC01.1_R_US to FC01.1_R_DS) Flux Function == Culvert ! Culvert flow between nodestrings Culvert File == ..\model\csv\Culvert_dbase.csv, 3 ! Culvert details, ID 3 in culvert file End Structure
Structure == Linked Nodestrings, FC04.1_C_US, FC04.1_C_DS ! Location (from FC04.1_C_US to FC04.1_C_DS) Flux Function == Culvert ! Culvert flow between nodestrings Culvert File == ..\model\csv\Culvert_dbase.csv, 2 ! Culvert details, ID 2 in culvert file End Structure
Structure == Linked Nodestrings, FC01.2_R_US, FC01.2_R_DS ! Location (from FC01.2_R_US to FC01.2_R_DS) Flux Function == Culvert ! Culvert flow between nodestrings Culvert File == ..\model\csv\Culvert_dbase.csv, 1 ! Culvert details, ID 1 in culvert file End Structure
Structure == Nodestring, FC01.1_W ! Single structure Location (at FC01.1_W) Flux Function == Weir_dz ! Weir flag Properties == 0.1, 1.705 ! Weir elevation (m above mesh ZB), weir coefficient End Structure
Structure == Nodestring, FC04.1_W ! Single structure Location (at FC04.1_W) Flux Function == Weir_dz ! Weir flag Properties == 2.0, 1.705 ! Weir elevation (m above mesh ZB), weir coefficient End Structure
Structure == Nodestring, FC01.2_W ! Single structure Location (at FC01.2_W) Flux Function == Weir_dz ! Weir flag Properties == 0.1, 1.705 ! Weir elevation (m above mesh ZB), weir coefficient End Structure
To save time and focus on modelling the culvert file Culvert_dbase.csv was provided as a csv file. Open and review the culvert file located in Working\TUFLOWFV\model\csv. The ID (column A) matches each culvert in the above Sturctures_003.fvc, and the upstream (column G) and downstream (column H) invert elevations are aligned with the elevations previously set in the 2d_zln_Invert_Correction.shp file. For more information on the culvert inputs refer to the TUFLOW FV Manual found at the Downloads page.
Run TUFLOW FV
Open the run_simulations.bat has been included in the tutorial dataset download within the Complete_Model\TUFLOWFV\runs folder. Update the following and run the model:
- Line 7 add the text rem (as shown in the figure below) to disables the line from being executed by Windows.
- On Line 8 remove the text rem so that the batch file will run Floodplain_003.fvc.
- Save the batch file and double click it in file explorer to run the simulation as shown in section Run TUFLOW FV. MADDYTODO update link when in final phase.
Review Check Files
Use the below steps and videos to open the check files to review that the culvert inverts have been applied:
- From the TUFLOW plugin Toolbar select Import Check Files from Folder. In the dialog, specify the following:
- Ensure the Check Directory is set to the model check folder e.g. Working\TUFLOWFV\check.
- Specify the Run ID as Floodplain_003 and select OK.
- Uncheck all imported files and check on Floodplain_002_zln_zpt_check_P.
- Right click on Floodplain_002_zln_zpt_check_P and select Properties. Under Labels set the following:
- From the drop down select Single Labels.
- From the Value drop down select Elevation.
- Select the expression builder and in the dialog type the following expression round("Elevation",2) select OK.
- Under Buffer options check Draw text buffer and select Apply > OK.
- Review culvert invert elevations.
- Close check files
Review Results
This section does XYZ to review and compare the results to the previous model.
Use the below steps and video to compare the water level timeseries of Floodplain_003 and Floodplain_002:
Show depth and velocity plan view at most upstream culvert. Floodplain_002 vs. 003.
- Open the TUFLOW Viewer and dock it under the layer panel as shown in previous reviewing result section. MADDYTODO update final link.
- From the TUFLOW Viewer select File > Load Results - Map Outputs. Open both Floodplain_003.nc and Floodplain_002.nc.
- MADDY flick through the extents and talk about the velocity vectors.
Show impact on water level upstream of southern crossing.
- MADDY use a timeseries to compare the change.
Open up structure flux results in excel and show the amount of flow through each culvert.
MADDYTODO Notes the structflux output file is orders the naming of each ouput according to the order it was place in the stucture_003.fvc note we don't get any flux across the FC04.1_W wier
Feedback
If you have any queries, feedback or requests for new functionality you would like added to the tutorial modules, please feel free to get in contact with support@tuflow.com.
If you wish to keep up-to-date with all things TUFLOW and TUFLOW FV, then please join our LinkedIn group.
Conclusion And Next Steps
Well done on completing Tutorial Module 4. You have now learnt how to build, run and review a model and model results of a floodplain model.
Return to the Tutorial Introduction Page to complete further meshing and model build tutorials.