Flood Modeller Tutorial Module01 Provisional: Difference between revisions
Content deleted Content added
(39 intermediate revisions by 3 users not shown) | |||
Line 10:
For this module, the second option will be demonstrated.
TUFLOW can also link with other 1D solvers, including ESTRY (TUFLOW 1D), XP-SWMM and 12D Solutions’ Dynamic Drainage. Setting up a channel that cuts through a 2D domain is typically one of the more time-consuming modelling tasks.
For this module, the complete Flood Modeller 1D model network has been provided, to allow for progressing through the module in a relatively short period of time.
===Linking Flood Modeller to TUFLOW===
It is assumed from the outset of this module that Flood Modeller has already been linked to the desired version of TUFLOW. There are four methods by which Flood Modeller and TUFLOW can be linked, all of which are described on this <u>[[Running_linked_Flood_Modeller_-_TUFLOW_Models | page]]</u>.
Using the Flood Modeller interface to set the location of the TUFLOW engine files for the TUFLOW build you want to use, is the simplest approach to linking Flood Modeller and TUFLOW and does not duplicate files. This method is recommended if it is expected that the same versions of Flood Modeller and TUFLOW will be used consistently when running linked models.
1) Open the Flood Modeller software and in the 'Home' tab select the 'General' option. <br>
[[file:FM Home Tab.png|500px]] <br>
2) Select the 'Project Settings' sub-menu and within the TUFLOW Engine File Location choose to browse to the version of TUFLOW that you would like to link Flood Modeller to. Choose 'Open' and then 'OK'. It is recommended that the option 'Show Solver Window when Running Simulations' be switched on as well. <br>
[[file:FM TUFLOW Linking 26092025.png|500px]] <br>
3) Save the changes that you have made to the setup. This will update the settings file (formed.ini).
4) Restart Flood Modeller to effect the revised setting.
4) The linked model can then be run by opening the .ief file within the Flood Modeller Interface and clicking Run. <br>
=Existing Model Data=
This tutorial builds upon the 2D TUFLOW domain that was constructed as part of [[Tutorial_M01 |Module 1]] and [[Tutorial_M02 |Module 2]] of the TUFLOW Tutorial Model.
Line 23 ⟶ 43:
*1D ESTRY culverts
*1D/2D boundary links to connect the 1D ESTRY culverts to the 2D TUFLOW domain.
= Project Initialisation =
TUFLOW models are separated into a series of folders which contain the input and output files. The recommended set up for the model directory and sub-folders is shown below. For a more detailed description, refer to the <u>[https://docs.tuflow.com/classic-hpc/manual/2025.2/FoldersFileTypesandFileNaming-2.html#FoldersFileTypesandFileNaming-2]</u>. <br>
<ol>
[[File:Tute M01 Directory Structure v3.png|left]]
{| class="wikitable"
! style="background-color:#005581; font-weight:bold; color:white;"| Sub-Folder
! style="background-color:#005581; font-weight:bold; color:white;" width=10%| Input / Output
! style="background-color:#005581; font-weight:bold; color:white;" width=75%| Description
|-
| bc_dbase|| Input || Boundary condition database(s) and input time-series data.
|-
| check|| Output || GIS and other check files to carry out quality control checks (use Write Check Files).
|-
| model|| Input ||Geometry (TGC), Boundary (TBC) and other model control text files (i.e. no GIS files).
|-
| model\gis|| Input || GIS layers that are inputs to the 2D and 1D model domains are contained within this folder, model\gis is typically used for all QGIS and ArcGIS files.
|-
| model\mi|| Input || GIS layers that are inputs to the 2D and 1D model domains are contained within this folder, model\mi is typically used for MapInfo formatted GIS files.
|-
| results|| Output|| TUFLOW outputs the results to this folder in specified formats.
|-
| runs|| Input|| TUFLOW Control Files (TCF).
|-
| runs\log|| Output || TUFLOW log files (TLF) and messages layers.
|}
</ol>
The TUFLOW folders can be set up manually, automatically running TUFLOW model with <font color="blue"><tt> Write Empty GIS Files </tt></font> command or automatically through GIS programs:
:*<u>[[Tutorial_M01_Configure_TUFLOW_Project_QGIS | QGIS - SHP]]</u>
:*<u>[[Tutorial_M01_Configure_TUFLOW_Project_QGIS_GPKG | QGIS - GPKG]]</u>
:*SMS - the folder structure listed above is automatically created before running the model using the 'Export TUFLOW files' command (see <u> [[Run TUFLOW from within SMS | Run TUFLOW from within SMS]])</u>.
:*ArcMap (10.1 and newer) - the ArcTUFLOW Toolbox can be used to automatically create the model folders, model projection, TUFLOW control files and run TUFLOW to create the template files.
The following points on TUFLOW folders and filenames are worth noting:
:*TUFLOW accepts any folder structure, though the above listed format is most commonly used and is recommended. <br>
:*TUFLOW accepts spaces and special characters (such as ! or #) in filenames and paths, but other software may not. It is recommended that spaces and other special characters are not used in the simulation path and filenames. <br>
:*Folder paths, filenames, file extensions and TUFLOW commands are not case sensitive in any TUFLOW control files. <br>
:*Any directories that don't apply can be omitted, for example, if using QGIS or ArcMap the model\mi directory is not required. <br>
<br>
= Model Familiarisation=
Become familiar with the model location, using an aerial image and DEM:<br>
:*<u>[[Model_Familiarisation_QGIS | QGIS]]</u>
<br>
=GIS and Model Inputs=
The steps
===Define the External 1D Networks===
This part of the module creates the GIS layers that specify the location of the Flood Modeller nodes that are to be connected to the 2D domain.
Follow the instructions below for
* [[FM Tutorial M01_QGIS_SHP_x1D_Nodes | QGIS - SHP]]
* [[FM Tutorial M01_QGIS_GPKG_x1D_Nodes | QGIS - GPKG]]
===Define the Water Level Lines===
This part of the module creates the Water Level Lines that will be used to visualise 1D results in 2D map outputs.
Follow the instructions below for the preferred GIS format.
* [[FM Tutorial M01_QGIS_SHP_WLL_Lines | QGIS - SHP]]
* [[FM Tutorial M01_QGIS_GPKG_WLL_Lines | QGIS - GPKG]]
===Define the 1D/2D Boundary Links===
This part of the module creates the 1D/2D boundaries to link the Flood Modeller 1D component to the TUFLOW 2D domain.
Follow the instructions below for
* [[FM Tutorial M01_QGIS_SHP_1D2D_Links | QGIS - SHP]]
* [[FM Tutorial M01_QGIS_GPKG_1D2D_Links | QGIS - GPKG]]
Line 45 ⟶ 118:
This part of the module defines the bank elevations of the watercourse which are the elevations of the 1D/2D boundary links created in the previous section.
Follow the instructions below for
* [[FM Tutorial M01_QGIS_SHP_Banks | QGIS - SHP]]
* [[FM Tutorial M01_QGIS_GPKG_Banks | QGIS - GPKG]]
Line 52 ⟶ 125:
This part of the module describes the steps to deactivate the 2D cells where the 1D model is replacing the 2D solution.
Follow the instructions below for
* [[FM Tutorial M01_QGIS_SHP_1D2D_Code | QGIS – SHP ]]
* [[FM Tutorial M01_QGIS_GPKG_1D2D_Code | QGIS - GPKG]]
=Modify Simulation Control Files=
With the input GIS layers modified, the next step is to update the TUFLOW control files and Flood Modeller simulation files to create a linked model.
== TUFLOW Geometry Control File (TGC) ==
At this stage,
* The cells along the watercourse that are represented in the 1D Flood Modeller component of the model are deactivated.
* Bank elevations along the watercourse are enforced.
<ol>
<li> In the '''FMT_Tutorial\FMT_M01\TUFLOW\model''' folder, save a copy of <b>M01_5m_002.tgc</b> as <b>FMT_M01_001.tgc</b>. </li>
<li> Open <b>FMT_M01_001.tgc</b><br>
<u>'''QGIS - SHP'''</u><br>
Add an extra command line after <font color="blue"><tt>Read GIS Code </tt></font><font color="red"><tt>==</tt></font>..\model\gis\2d_code_FMT_M01_001_R.shp<br>
<font color="blue"><tt>Read GIS Code BC </tt></font> <font color="red"><tt>== </tt></font> gis\2d_bc_FMT_M01_HX_001_R.shp <font color="green"><tt> ! Deactivates the cells where the watercourse has been modelled in 1D </tt></font><br>
Note that the order of the commands is important. The layer '''2d_code_FMT_M01_001_R.shp''' first activates cells within the modelled area, then the layer '''2d_bc_FMT_M01_HX_001_R.shp''' deactivates selected cells along the watercourse.
<br><u>'''QGIS - GPKG'''</u><br>
Add an extra command line after <font color="blue"><tt>Read GIS Code </tt></font><font color="red"><tt>==</tt></font> 2d_code_FMT_M01_001_R<br>
<font color="blue"><tt>Read GIS Code BC </tt></font> <font color="red"><tt>== </tt></font> 2d_bc_FMT_M01_HX_001_R <font color="green"><tt> ! Deactivates the cells where the watercourse has been modelled in 1D </tt></font><br>
Note that the order of the commands is important. The layer '''2d_code_FMT_M01_001_R''' first activates cells within the modelled area, then the layer '''2d_bc_FMT_M01_HX_001_R''' deactivates selected cells along the watercourse. </li>
<li> Topography amendments should be added in a new section at the bottom of the TGC. These are:<br>
<u>'''QGIS - SHP'''</u><br>
<font color="blue"><tt>Read GIS Z HX Line MAX </tt></font> <font color="red"><tt>==</tt></font> gis\2d_bc_FMT_M01_HX_001_L.shp | gis\2d_bc_FMT_M01_HX_001_P.shp <font color="green"><tt>! Defines the bank crest levels (1D/2D boundary cell elevations). The 'MAX' option prevents any zpt elevations from being lowered </tt></font><br>
The two GIS layers must be read in together on the same command line. This tells TUFLOW to associate the points within the '''2d_bc_FMT_M01_HX_001_P.shp''' layer (defining elevation) with the polylines within the '''2d_bc_FMT_M01_HX_001_L.shp''' layer (defining bank location).
<br><u>'''QGIS - GPKG'''</u><br>
<font color="blue"><tt>Read GIS Z HX Line MAX </tt></font> <font color="red"><tt>==</tt></font> 2d_bc_FMT_M01_HX_001_L | gis\2d_bc_FMT_M01_HX_001_P <font color="green"><tt>! Defines the bank crest levels (1D/2D boundary cell elevations). The 'MAX' option prevents any zpt elevations from being lowered </tt></font><br>
The two GIS layers must be read in together on the same command line. This tells TUFLOW to associate the points within the '''2d_bc_FMT_M01_HX_001_P''' layer (defining elevation) with the polylines within the '''2d_bc_FMT_M01_HX_001_L''' layer (defining bank location). </li>
<li> Save the file. The geometry control file is now ready to be used. </li>
</ol>
==TUFLOW Boundary Control File (TBC)==
Next, update the TBC to reference the model boundary files created in the previous steps, as described below:
Line 80 ⟶ 173:
<ol>
<li> Open '''M02_5m_001.tbc''' and save a copy as '''FMT_M01_001.tbc'''.
<li> Remove the boundary linking to the TUFLOW inflows by putting an exclamation mark before the line reading:<br><u>'''QGIS - SHP'''</u><br><font color="blue"><tt>Read GIS BC</tt></font> <font color="red"><tt>== </tt></font> gis\2d_bc_M01_002_L.shp<br><u>'''QGIS - GPKG'''</u><br><font color="blue"><tt>Read GIS BC</tt></font> <font color="red"><tt>== </tt></font> 2d_bc_M01_002_L
<li> Add reference to the 1D/2D boundary links that connect Flood Modeller to the 2D floodplain:
<br><u>'''QGIS - SHP'''</u><br><font color="blue"><tt>Read GIS BC </tt></font> <font color="red"><tt>== </tt></font> gis\
</ol>
== TUFLOW Control File (TCF) ==
Finally, the TCF is updated as follows:
<
<li>Remove references to model parameters that are read from Flood Modeller.
<li>Read in the GIS layer of the Flood Modeller nodes.
<li>Read in the GIS layers used to create Water Level Lines along the Flood Modeller component of the model (optional).
<li>Add a reference to the ESTRY Control File.
<li>Update references to the TBC and TGC.
</ul>The following steps outline how to apply these updates:
# In the \FMT_Tutorial\FMT_M01\TUFLOW\runs folder, save a copy of the TUFLOW file created as a part of [[Tutorial_M02 |Module 2]] ('''M02_5m_001.tcf''') as '''FMT_M01_001.tcf.'''
# Remove the Start Time, End Time, and 2D Timestep parameters from the TCF, as these are read from the Flood Modeller .ief file in a linked Flood Modeller-TUFLOW model. If they are left in place the Flood Modeller settings will override the TUFLOW settings. This is done by adding an exclamation mark in front of each of the following commands.<br><font color="green"><tt>! SIMULATION TIME CONTROL COMMANDS</tt></font><br><font color="blue"><tt>Timestep </tt></font> <font color="red"><tt>== </tt></font> 1.5 <font color="green"><tt>! Specifies a 2D computational timestep of 1.5 seconds </tt></font><br><font color="blue"><tt>Start time </tt></font> <font color="red"><tt>== </tt></font> 0 <font color="green"><tt>! Specifies a simulation start time of 0 hours</tt></font><br><font color="blue"><tt>End Time </tt></font> <font color="red"><tt>== </tt></font>3 <font color="green"><tt>! Specifies a simulation end time of 3 hours</tt></font>
#Read in the GIS layers of the Flood Modeller Nodes. Place the below command line anywhere in the .tcf. It is good practice to create a section within the .tcf to reference all 1D commands:<br><u>'''QGIS - SHP'''</u><br><font color="blue"><tt>Read GIS X1D Nodes</tt></font> <font color="red"><tt>== </tt></font>..\model\gis\1d_x1d_FMT_M01_nodes_001_P.shp <font color="green"><tt>! GIS layer referencing node IDs from Flood Modeller </tt></font><br><u>'''QGIS - GPKG'''</u><br><font color="blue"><tt>Read GIS X1D Nodes</tt></font> <font color="red"><tt>== </tt></font> 1d_x1d_FMT_M01_nodes_001_P <font color="green"><tt>! GIS layer referencing node IDs from Flood Modeller</tt></font>
#Add commands to read in the GIS layers referencing Water Level Lines drawn along the Flood Modeller component of the model:<br><u>'''QGIS - SHP'''</u><br><font color="blue"><tt>Read GIS X1D Network</tt></font> <font color="red"><tt>== </tt></font>..\model\gis\1d_x1d_FMT_M01_nwk_001_L.shp <font color="green"><tt>! GIS layer representing channels to allow for the digitisation of Water Level Lines (optional)</tt></font><br><font color="blue"><tt>Read GIS X1D WLL</tt></font> <font color="red"><tt>== </tt></font> ..\model\gis\1d_x1d_WLL_FMT_M01_001_L.shp <font color="green"><tt>! GIS layer containing WLLs for visualising 1D results in 2D (optional)</tt></font><br><u>'''QGIS - GPKG'''</u><br><font color="blue"><tt>Read GIS X1D Network</tt></font> <font color="red"><tt>== </tt></font> 1d_x1d_FMT_M01_nwk_001_L <font color="green"><tt>! GIS layer representing channels to allow for the digitisation of Water Level Lines (optional)</tt></font><br><font color="blue"><tt>Read GIS X1D WLL</tt></font> <font color="red"><tt>== </tt></font> 1d_x1d_WLL_FMT_M01_001_L <font color="green"><tt>! GIS layer containing WLLs for visualising 1D results in 2D (optional)</tt></font><br>The addition of TUFLOW Water Level Lines (WLL) allows the Flood Modeller 1D results to be visualised within the TUFLOW 2D map outputs. They provide a means by which to remove the gaps in the map outputs where the 1D Flood Modeller domains are located and the 2D cells are deactivated. To do this, TUFLOW requires a 1D_WLL layer to define the cross sections locations, and a 1d_nwk layer that defines the river centre line. The layers are not used in the hydraulic calculations and their inclusion is not always required. The Dist_for_Add_Points determines the intervals in metres at which interpolation points are inserted along each WLL.
#Add commands to read in an ESTRY Control File which contains references to some of the culverts present on the floodplain:<br><font color="blue"><tt>ESTRY Control File</tt></font> <font color="red"><tt>== </tt></font>..\model\FMT_M01_001.ecf <font color="green"><tt>!Reference the ESTRY Control File </tt></font>
#Update the links to the Geometry control file, the Boundary Condition control file and the bc_dbase file:<br><font color="blue"><tt>Geometry Control File</tt></font> <font color="red"><tt>== </tt></font>..\model\FMT_M01_001.tgc <br><font color="blue"><tt>BC Control File</tt></font> <font color="red"><tt>== </tt></font>..\model\FMT_M01_001.tbc <br><font color="blue"><tt>BC Database</tt></font> <font color="red"><tt>== </tt></font>..\bc_dbase\bc_dbase_FMT_M01.csv
</ol>
This concludes the changes
=Flood Modeller Simulation Files=
Line 123 ⟶ 208:
===IEF File===
<
<li> Open Flood Modeller. Select 'Load 1D Network'. Navigate to '''\FMT_Tutorial\FMT_M01\Flood_Modeller\DAT''' and load the '''FMT_M01_001.dat'''.</li>
<li> Right click 'Event Data' and select 'Add Item'. Navigate to '''\FMT_Tutorial\FMT_M01\Flood_Modeller\IED''' and load the '''FMT_Inflows.IED'''.</li>
<li> On the 'Simulation' tab, click New 1D Simulation. Save the file when prompted in the '''\FMT_Tutorial\FMT_M01\Flood_Modeller\IEF''' folder as '''FMT_M01_001.ief'''</li>
<li> On the 'Files' Tab of the simulation window, set the following parameters:</li>
*Event Title: FMT_M01_001
*1D Data File: The full path to the \FMT_Tutorial\FMT_M01\Flood_Modeller\DAT\FMT_M01_001.dat
*Use Initial Conditions from: Network File (.dat)
*Results File: set the full path to \FMT_Tutorial\FMT_M01\Flood_Modeller\RES\FMT_M01_001.
[[File:Ief file.png|frameless|500x500px]]
<li>To the right of the Event Data box, click Add and select the '''FMT_Inflows.IED''' file in the '''\FMT_Tutorial\FMT_M01\Flood_Modeller\IED''' folder.</li>
<li>On the 'Times' tab,
*Run Type: Unsteady (Fixed Timestep)
*Start Time (hrs): 0
*Finish Time (hrs): 3
*Timestep (s):1
*Save Interval (s): 300.
[[File:Ief time.png|frameless|500x500px]]
<li> Add the 'Links' tab by clicking View> Tabs > Links. On the 'Links' tab, enter the following parameters:
Line 146 ⟶ 233:
*2-d Timestep: 2
*Check the box for ‘Perform corrective 1D timestep’
*2-d control file: full path to the '''FMT_M01_001.tcf''' from the '''\FMT_Tutorial\FMT_M01\TUFLOW\runs''' folder.
[[File:Ief tcf.png|frameless|500x500px]]
</li></li><li></li><li> Save the Scenario Data and run the Flood Modeller simulation. </li>{{Video|name=Setting up FMP IEF Simulation File.mp4 |width=1123}}</ul>
= Review Check Files =
=== Review Boundaries and 1D/2D Links ===
From the TUFLOW\check\2d\ folder open within QGIS:
*FMT_M02_001_1d_to_2d_check
*FMT_M02_001_sac_check
The _1d_to_2d_check layer highlights the location of all 1D/2D boundary links within the model. In this case it should show the HX boundaries that have been digitised along the river banks.
The _sac_check layer highlights the lowest 2d cells within the SA boundary polygon to which inflow is first distributed.
=== Review Bank Elevations ===
From the TUFLOW\check\2d\ folder open within QGIS:
*FMT_M01_001_zln_zpt_check_P
The _zln_zpt_check layer highlights the cells whose elevations have been modified by z lines to represent the bank crests of the watercourse.
= Review the Results =
Line 154 ⟶ 262:
The video below demonstrates both methods:
*[[TUFLOW Viewer - Load Results - Time Series FM|Loading Flood Modeller 1D results]] in QGIS using the TUFLOW Viewer plugin.
*Loading TUFLOW mesh results in Flood Modeller Pro.
{{Video|name=Viewing Results in Flood Modeller and TUFLOW.mp4.mp4 |width=1123}}
=
=== Troubleshooting for HPC Simulation ===
If the following error message is encountered when running the TUFLOW HPC model:
<pre>ERROR 3999 - ptx file version mismatch
</pre>
Please ensure that the four TUFLOW kernel files below have been transferred from your TUFLOW engine folder into your Flood Modeller "bin" folder.
*hpcKernels_nSP.ptx
*hpcKernels_nDP.ptx
*qpcKernels_nSP.ptx
*qpcKernels_nDP.ptx
=== Troubleshooting for GPU Simulation ===
If
<pre>TUFLOW GPU: Interrogating CUDA enabled GPUs …
TUFLOW GPU: Error: Non-CUDA Success Code returned
Line 182 ⟶ 292:
Please try the following steps:
<ol>
<li> Check if
<li> Check if
</ol>If
{{Tips Navigation
|