Tute M06 QGIS Mod Files Archive
Modify Simulation Control Files and Set-up a TUFLOW Scenario
Now that we have made all of the necessary changes to the GIS layers, we need to update our control files to include the option of modelling the replacement bridge.
TGC File
There have been a number of changes to the geometry to allow for the three bridge modelling approaches:
- We have created a 2D zshape layer to revise the road crest elevation.
- We have modified the existing 1D/2D boundary conditions layer
- We have created 2D zshape layers to remove the road embankment in the area of the new bridge.
- We have created a 2D layered flow constriction (2d_lfcsh) to model the bridge within the floodplain.
Introduced in Module 5, we are going to use a series of TUFLOW model scenarios to model the new bridge. Section 4.12.2 of the 2010 TUFLOW manual gives a full description of the If Scenario command. In summary, it permits control over which commands are to be applied to the model simulation depending on the scenario or combination of scenarios specified by the user. This permits the user to simulate multiple simulations using a single .tgc and .tcf. For this tutorial we will write the control files such that both the existing 'EXG' scenario and each bridge modelling method can be simulated with the same control files.
Open the M05_5m_001.tgc in your text editor or navigate to the correct tab. Save the .tgc file as M06_5m_001.tgc and ensure this .tgc file is open in your text editor. (Ultraedit will automatically open the newly saved file.)
We will insert an If Scenario block of commands to differentiate how the active and inactive areas of the model have been defined between the scenarios. Replace the Read GIS Code == gis\2d_code_M04_null_creek_001_R.shp command with the following:
If Scenario == EXG | DEV | FINB1 | FINB3
- Read GIS Code == gis\2d_code_M04_null_creek_001_R.shp
Else If Scenario == FINB2
- Read GIS Code == gis\2d_code_M06_null_creek_001_R.shp
Else
- Pause == Scenario not recognised
End If
Within the existing If Scenario block for the 'DEV' scenario, we will place a command to regrade the road. We will also expand the If Scenario logic block to include commands specific to the 'FINB1', 'FINB2' ad 'FINB3' scenarios that we have created for this module. The entire If Scenario logic block for modifying the topography is as follows:
If Scenario == DEV
- Read GIS Z Shape == gis\2d_zsh_M06_Rd_Crest_001_L.shp
- Read GIS Z Shape == gis\2d_zsh_M05_development_001.shp
Else If Scenario == FINB2
- Read GIS Z HX Line MAX == gis\2d_bc_M06_HX_001_L.shp | gis\2d_bc_M06_HX_001_P.shp
Else If Scenario == FINB3
- Read GIS Z Shape == gis\2d_zsh_M06_NorthRd_001_R.shp | gis\2d_zsh_M06_NorthRd_001_P.shp
- Read GIS Layered FC Shape == gis\2d_zsh_M06_NorthRd_001_R.shp | gis\2d_zsh_M06_NorthRd_001_P.shp
Else If Scenario == EXG | FINB1
Else
- Pause == Scenario not recognised
End If
In the above set of commands, if a scenario other than "DEV", "FINB1", "FINB2", "FINB3" or "EXG" is specified, the Pause command will pause the simulation and output the message Scenario not recognised. Although an optional step, including these commands will ensure that any errors in defining scenarios is captured.
This is highly recommended when using nested If Scenario command blocks.
Save the file. The geometry file is now ready to be used.
TBC File
To facilitate the differing bridge modelling approaches, we have modified the 1d/2d boundary conditions for bridge modelling approach 2 'FINB2'. Again, we will use scenarios to ensure the correct 1d_2d bc layers are applied.
Open M04_5m_001.tbc in your text editor or navigate to the correct tab. Save the .bc file as M06_5m_001.tbc and ensure this .tbc file is open in your text editor. (Ultraedit will automatically open the newly saved file.)
Delete the line Read GIS BC == gis\2d_bc_M04_HX_001.shp from the file.
Add an If/Else If Scenario command block with the following statements:
If Scenario == EXG | DEV | FINB1 | FINB3 !Commands specific to the 'EXG', 'DEV', Bridge Options 1 and 3
- Read GIS BC == gis\2d_bc_M04_HX_001_L.shp
Else If Scenario == FINB2 ! Commands specific to Bridge Option 2 Scenario
- Read GIS BC == gis\2d_bc_M06_HX_001_L.shp
Else
- Pause == Scenario not recognised
End If
(Does it matter where the If statement gets put in a TBC file?)
In the above set of commands, if a scenario other than "DEV", "FINB1", "FINB2", "FINB3" or "EXG" is specified, the Pause command will pause the simulation and output the message Scenario not recognised. Although an optional step, including these commands will ensure that any errors in defining scenarios is captured.
This is highly recommended when using nested If Scenario command blocks.
Save the file. The boundary conditions file is now ready to be used.
ECF File
There have been multiple changes to the 1D control file:
- We have created a new 1d_nwk layer to model the culverts located elsewhere in the model area that are not at the location of the new bridge.
- We have created a new 1d_nwk layer to model the 1D domain replacement bridge.
- We have created a new 1d_nwk layer to model the 1D domain weir.
- We have created two new 1d_bg layers to read in the bridge/weir cross section and the bridge loss coefficient with height table.
Again we are going to place the new commands specific to the new bridge scenario within an If Scenario command block. Open the M04_1d_001.ecf in your text editor or navigate to the correct tab. Save the .ecf file as M06_1d_001.ecf and ensure this .ecf file is open in your text editor.
Delete or comment out the Read GIS Network == gis\1d_nwk_M04_culverts_001_L.SHP command.
Insert an If Scenario command block between the Read GIS Table Links == xs\1d_xs_M04_creek_001.SHP and Read GIS BC == gis\1d_bc_M04_001.SHP commands as follows:
If Scenario == FINB1
- Read GIS Network == gis\1d_nwk_M06_culverts_001_L.SHP
- Read GIS Network == gis\1d_nwk_M06_bridge_001_L.SHP
- Read GIS Table Links == bg\1d_bg_M06_bridge_001_L.SHP
Else If Scenario == FINB2
- Read GIS Network == gis\1d_nwk_M06_culverts_001_L.SHP
- Read GIS Network == gis\1d_nwk_M06_bridge_001_L.SHP
- Read GIS Network == gis\1d_nwk_M06_weir_001_L.SHP
- Read GIS Table Links == bg\1d_bg_M06_bridge_001_L.SHP
- Read GIS Table Links == bg\1d_bg_M06_weir_001_L.SHP
Else If Scenario == FINB3
- Read GIS Network == gis\1d_nwk_M06_culverts_001_L.SHP
Else If Scenario == EXG | DEV
- Read GIS Network == gis\1d_nwk_M04_culverts_001_L.SHP
Else
- Pause == Scenario not recognised
End If
Save the file. The 1D control file is now ready to be used.
TCF File
We need to save a new .tcf file that includes the option to include scenarios in the simulation and incorporate new .tgc and .ecf files.
The s1 switch permits simulation of one scenario and s1 will be replaced by the scenario name in all output files (for example, specifying FINB1 will simulate our Bridge Option 1 scenario. Alternatively, specifying EXG will simulate our existing scenario).
Tip: There are two methods for including scenarios in your simulation .tcf control file. Refer to Section 4.12.2 of the TUFLOW 2010 manual for details.
Conclusion
You have now setup your run files are are ready to run the model. Please return to the main page of module 6.