Tutorial M02: Difference between revisions

Content deleted Content added
 
(16 intermediate revisions by 4 users not shown)
Line 4:
The GIS layers are:<br>
:*TGC layers:
<ol><ol><li>2d_zsh: A layer used to modify Zpt elevations using points, lines and polygons.<br> </ol></olli>
<li>2d_mat: A layer used to define the land use (material) types within the developmental area.</li></ol></ol>
'''Module 2 builds from the model created in <u>[[Tutorial_M01 | Module 1]]</u>. The completed Module 1 model is provided in the Module_02\TUFLOW folder.''' <br>
<br>
Line 18 ⟶ 19:
== GIS Inputs ==
Create, import and view input data:<br>
:*<u>[[Tutorial_M02_001_GIS_Inputs_QGIS | QGIS - SHP]]</u>
:*<u>[[Tutorial_M02_001_GIS_Inputs_QGIS_GPKG | QGIS - GPKG]]</u>
 
== Simulation Control Files ==
Line 24 ⟶ 26:
<ol>
<li>Save a copy of '''M01_001.tgc''' as '''M02_001.tgc''' in the '''Module_02\TUFLOW\model''' folder. <br>
<li>Open the '''M02_001.tgc''' in a text editor and add the following line after the '<font color="blue"><tt>Read GRID Zpts</tt></font> <font color="red"><tt> == </tt></font> <font color="black"><tt>grid\DEM.flttif</tt></font>' command. Note, the points and lines are in separate layers, but are part of the same breakline, therefore they are input on the same line with a vertical bar '|' to tell TUFLOW the layers are linked. The TUFLOW modelling convention is to list the lines first and then points.<br>
<u>'''QGIS - SHP'''</u><br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>gis\2d_zsh_M02_rd_crest_001_L.shp | gis\2d_zsh_M02_rd_crest_001_P.shp </tt></font> <font color="green"><tt> ! Defines the road crest</tt></font> <br>
<u>'''QGIS - GPKG'''</u><br>
As the points and lines are in separate shapefiles, but are part of the same breakline, they are input on the same line with a vertical bar '|' to tell TUFLOW the layers are linked. The TUFLOW modelling convention is to list the lines first and then points. <br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>2d_zsh_M02_rd_crest_001_L | 2d_zsh_M02_rd_crest_001_P </tt></font> <font color="green"><tt> ! Defines the road crest</tt></font> <br>
<li>Save the TGC.
</ol>
Line 33 ⟶ 37:
<ol>
<li>Save a copy of '''M01_5m_001.tcf''' as '''M02_5m_001.tcf''' in the '''Module_02\TUFLOW\runs''' folder.
<li>Open the file '''M02_5m_001.tcf''' in a text editor and updatemake the TGCfollowing reference updates: <br>
<u>'''QGIS - SHP'''</u><br>
<font color="blue"><tt>Geometry Control File </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>..\model\M02_001.tgc </tt></font> <font color="green"><tt> ! Reference the TUFLOW Geometry Control File</tt></font> <br>
<u>'''QGIS - GPKG'''</u><br>
<font color="blue"><tt>Spatial Database </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>..\model\gis\M02_001.gpkg </tt></font> <font color="green"><tt> ! Specify the location of the GeoPackage Spatial Database</tt></font> <br>
<font color="blue"><tt>Geometry Control File </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>..\model\M02_001.tgc </tt></font> <font color="green"><tt> ! Reference the TUFLOW Geometry Control File</tt></font><br>
<li>Save the TCF.
</ol>
Line 43 ⟶ 51:
<li>Save a copy of '''_run_M01_HPC.bat''' as'''_run_M02_HPC.bat''' in the '''Module_02\TUFLOW\runs''' folder.
<li>Open the '''_run_M02_HPC.bat''' in a text editor and update the text: <br>
<font color="blue"><tt>'''set'''</tt></font> <font color="black"><tt>exe</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>"..\..\..\exe\2020-10-AF2025.1.0\TUFLOW_iSP_w64.exe"</tt></font> <br>
<font color="blue"><tt>'''set'''</tt></font> <font color="black"><tt>run</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>start "TUFLOW" /wait</tt></font> <font color="orange"><tt> %exe%</tt></font> <font color="black"><tt> -b</tt></font> <br>
<font color="orange"><tt>%run% </tt></font> <font color="black"><tt>M02_5m_001.tcf </tt></font> <br>
Line 62 ⟶ 70:
 
== Check Files ==
While the model is running, reviewcheck that the added features are specified correctly:
:*<u>[[Tutorial_M02_001_Check_Files_QGIS | QGIS - SHP]]</u>
:*<u>[[Tutorial_M02_001_Check_Files_QGIS_GPKG | QGIS - GPKG]]</u>
 
== Results ==
Line 72 ⟶ 81:
<ol>Tip: check the maximum 2D results. </ol>
:*What is the difference in peak water level at the upstream of the roads compared to the Module 1 run? <br>
<ol>Tip: Use the ‘Plot Time Series from Map Output’ tool in the TUFLOW Viewer QGIS Plugin. </ol><br>
 
=Part 2 - Other Topographic Updates=
The second part of this module introduces a range of options to make both simple and more complex polygontopography modifications. It also introduces an additional materials file to reflect the changes of land use based on the complex topographictopography modifications.<br>
There are a few ways to create polygon topographic modifications based on the Shape_Option attribute:
:*Merge - merges the elevations at polygon perimeter vertices with the topography Zpt values.
Line 84 ⟶ 93:
== GIS Inputs ==
Create, import and view input data:
:*<u>[[Tutorial_M02_002_GIS_Inputs_QGIS | QGIS - SHP]]</u>
:*<u>[[Tutorial_M02_002_GIS_Inputs_QGIS_GPKG | QGIS - GPKG]]</u>
 
== Simulation Control Files ==
Line 91 ⟶ 101:
<li>Save a copy of the '''M02_001.tgc''' as '''M02_002.tgc''' in the '''Module_02\TUFLOW\model''' folder.
<li>Open the '''M02_002.tgc''' in a text editor and add the following lines after the road crest input. <br>
<u>'''QGIS - SHP'''</u><br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>gis\2d_zsh_M02_fill_002_R.shp </tt></font> <font color="green"><tt> ! Defines areas of imported fill</tt></font> <br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>gis\2d_zsh_M02_merge_002_R.shp </tt></font> <font color="green"><tt> ! Defines areas of merging topography</tt></font> <br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>gis\2d_zsh_M02_cut_002_R.shp </tt></font> <font color="green"><tt> ! Defines excavation through embankment</tt></font> <br>
<font color="blue"><tt>CreateRead TINGIS ZptsZ Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>gis\2d_zsh_M02_landscape_002_R.shp | gis\2d_zsh_M02_landscape_002_L.shp | gis\2d_zsh_M02_landscape_002_P.shp </tt></font> <font color="green"><tt> ! Defines areas of complex landscaping</tt></font> <br>
<u>'''QGIS - GPKG'''</u><br>
As the points, lines and regions are in separate shapefiles, but are part of the same topographic modification, they are input on the same line with a vertical bar '|' to tell TUFLOW the layers are linked. The TUFLOW modelling convention is to list the polygons first, then lines and points last. <br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>2d_zsh_M02_fill_002_R </tt></font> <font color="green"><tt> ! Defines areas of imported fill</tt></font> <br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>2d_zsh_M02_merge_002_R </tt></font> <font color="green"><tt> ! Defines areas of merging topography</tt></font> <br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>2d_zsh_M02_cut_002_R </tt></font> <font color="green"><tt> ! Defines excavation through embankment</tt></font> <br>
<font color="blue"><tt>Read GIS Z Shape </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>2d_zsh_M02_landscape_002_R | 2d_zsh_M02_landscape_002_L | 2d_zsh_M02_landscape_002_P </tt></font> <font color="green"><tt>
! Defines areas of complex landscaping</tt></font> <br>
As the points, lines and linesregions are in separate shapefilesfiles, but are part of the same breaklinetopographic modification, they are input on the same line with a vertical bar '|' to tell TUFLOW the layers are linked. The TUFLOW modelling convention is to list the linespolygons first and, then lines and points. <br>last.
<li>Add in the following line after the '<font color="blue"><tt>Read GIS Mat</tt></font>' command.<br>
<u>'''QGIS - SHP'''</u><br>
<font color="blue"><tt>Read GIS Mat </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>gis\2d_mat_M02_landscape_002_R.shp </tt></font> <font color="green"><tt> ! Sets the material values according to attributes in the GIS layer</tt></font> <br>
<u>'''QGIS - GPKG'''</u><br>
<font color="blue"><tt>Read GIS Mat </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>2d_mat_M02_landscape_002_R </tt></font> <font color="green"><tt> ! Sets the material values according to attributes in the GIS layer</tt></font> <br>
Assigns the updated materials values due to the development. As the order of commands in the TGC is critical, ensure this command is written after the original <font color="blue"><tt>Read GIS Mat</tt></font> command.
<li>Save the TGC.
</ol>
Line 102 ⟶ 125:
<ol>
<li>Save a copy of '''M02_5m_001.tcf''' as '''M02_5m_002.tcf''' in the '''Module_02\TUFLOW\runs''' folder.
<li>Open the file '''M02_5m_002.tcf''' in a text editor and updatemake the TGCfollowing reference updates: <br>
<u>'''QGIS - SHP'''</u><br>
<font color="blue"><tt>Geometry Control File </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>..\model\M02_002.tgc </tt></font> <font color="green"><tt> ! Reference the TUFLOW Geometry Control File</tt></font> <br>
<u>'''QGIS - GPKG'''</u><br>
<font color="blue"><tt>Spatial Database </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>..\model\gis\M02_002.gpkg </tt></font> <font color="green"><tt> ! Specify the location of the GeoPackage Spatial Database</tt></font> <br>
<font color="blue"><tt>Geometry Control File </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>..\model\M02_002.tgc </tt></font> <font color="green"><tt> ! Reference the TUFLOW Geometry Control File</tt></font><br>
<li>Save the TCF.
</ol>
Line 116 ⟶ 143:
== Check Files ==
While the model is running, review the added features are specified correctly:
:*<u>[[Tutorial_M02_002_Check_Files_QGIS | QGIS - SHP]]</u>
:*<u>[[Tutorial_M02_002_Check_Files_QGIS_GPKG | QGIS - GPKG]]</u>
 
== Results ==
Line 125 ⟶ 153:
<li>Create a new batch file '''_M02_asc_to_asc_Level_Difference.bat''' in the '''Module_02\TUFLOW\results\grids''' folder and open it in a text editor.
<li>Input the following (Note: Utility location may differ): <br>
<font color="blue"><tt>'''set''' </tt></font> <font color="black"><tt>asc_to_asc</tt></font><font color="red"><tt>=</tt></font><font color="black"><tt>"C:..\TUFLOW..\Utilities..\exe\asc_to_asc.2024-06-AF\asc_to_asc_w64.exe"</tt></font> <br>
<li>Use the -dif flag to call the difference function. The utility then expects two grid files, it subtracts the first grid from the second. Add the following syntax below the 'set asc_to_asc' command.<br>
<font color="orange"><tt>%asc_to_asc% </tt></font> <font color="black"><tt>-b -dif M02_5m_002_h_Max.flttif M02_5m_001_h_Max.flttif </tt></font> <br>
<li>Optional is to use the -out flag to specify the name of the output grids.<br>
<font color="orange"><tt>%asc_to_asc% </tt></font> <font color="black"><tt>-b -dif -out M02_Level_Difference M02_5m_002_h_Max.flttif M02_5m_001_h_Max.flttif </tt></font> <br>
<li>Save the batch file and double click it in file explorer to run the utility.
<li>The resulting difference grids appear in the same folder location, open these in a GIS software to see the effects of the topography changes on the flood levels.
*M02_Level_Difference.flttif = difference in maximum flood level.
*M02_Level_Difference_wd.flttif = change in flood extent, identifying cells that were once wet, now dry (-99) and once dry, now wet (99). <br>
<br>
 
[[File:M02 ImpactMapM02_ImpactMap_b.png]]<br></ol>
<br>
 
Line 143 ⟶ 171:
:*Check files were assessed to view the changes on the underlying topographic model.
:*Impact assessment was conducted using the asc_to_asc utility.
:*For further training opportunities see <u>[https://tuflow.com/training/training-course-catalogue/ TUFLOW Training Catalogue]</u> and/or contact <u>[mailto:training@tuflow.com training@tuflow.com]</u>. <br>
<br>
{{Tips Navigation