Tutorial M08: Difference between revisions
Content deleted Content added
| (5 intermediate revisions by 2 users not shown) | |||
Line 2:
In this module, scenario management is introduced. This is a powerful functionality running different simulations using a single set of control files rather than creating a new set of control files for every simulation. This makes the management of the model easier, ensures consistency between the simulations and better quality control. Without implementing scenario management, six TCFs and six TGC files are required to run this module, using scenario management, only one each is needed:<br>
<br>
[[File:M08 ScenarioManagement 02.png]]<br>Scenarios are set up using an if scenario logic block - <font color="blue"><tt>If Scenario</tt></font> command followed by <font color="blue"><tt>Else If Scenario</tt></font> commands adding on different scenarios and terminated by <font color="blue"><tt>End If</tt></font>.
<br>▼
Note: Scenarios can be added to most of TUFLOW’s control files. The only control files that do not support scenarios are the TUFLOW Rainfall Control File (.trcf), TUFLOW External Stress File (.tesf), Advection Control File (.adcf), or within a Define Control command inside a TUFLOW Operational Control (.toc) file.
▲Scenarios are set up using an if scenario logic block - <font color="blue"><tt>If Scenario</tt></font> command followed by <font color="blue"><tt>Else If Scenario</tt></font> commands adding on different scenarios and terminated by <font color="blue"><tt>End If</tt></font>.<br>
The tutorial demonstrates two ways of using scenarios:
:*Part 1: Single Scenario - cell size.
:*Part 2: Multiple Scenarios - cell size and topography updates.
Line 15:
<li>2d_mat: A layer used to define the land use (material) types within the developmental area.</ol></ol>
'''Module 8 builds from the model created in <u>[[Tutorial_M02 | Module 2]]</u>. The completed Module 2 model is provided in the Module_08\TUFLOW folder.'''
=Part 1 - Single Scenario=
Line 37 ⟶ 36:
<ol><font color="blue"><tt>Pause </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>Error: Scenario Name Not Valid </tt></font> <font color="green"><tt> ! Displays specified text if different scenario name is called </tt></font> <br></ol>
<font color="blue"><tt>End If </tt></font> <font color="green"><tt> ! End of if statement</tt></font> <br>
<li>Save the TGC.
</ol>
Line 59 ⟶ 62:
<ol><font color="blue"><tt>Pause </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>Error: Scenario Name Not Valid </tt></font> <font color="green"><tt> ! Displays specified text if different scenario name is called </tt></font> <br></ol>
<font color="blue"><tt>End If </tt></font> <font color="green"><tt> ! End of if statement</tt></font> <br>
<li>Save the TCF.
</ol>
Line 140 ⟶ 147:
<ol><font color="blue"><tt>Pause </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>Error: Scenario Name Not Valid </tt></font> <font color="green"><tt> ! Displays specified text if different scenario name is called </tt></font> <br></ol>
<font color="blue"><tt>End If </tt></font> <font color="green"><tt> ! End of if statement</tt></font> <br>
<li>Include the following if scenario logic block for existing and developed case after the '<font color="blue"><tt>Read GIS Mat</tt></font>' command:<br>
Line 160 ⟶ 171:
<ol><font color="blue"><tt>Pause </tt></font> <font color="red"><tt>== </tt></font> <font color="black"><tt>Error: Scenario Name Not Valid </tt></font> <font color="green"><tt> ! Displays specified text if different scenario name is called </tt></font> <br></ol>
<font color="blue"><tt>End If </tt></font> <font color="green"><tt> ! End of if statement</tt></font> <br>
<li>Save the TGC.
Line 207 ⟶ 222:
:*Single and multiple scenarios were set up and run with a range of cell sizes and designs.
:*Check files were assessed to view the changes based on each scenario.
:*Multiple scenario results were viewed using the TUFLOW Viewer.
:*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>.
:*Alternatively, see the <u>[[TUFLOW_Example_Models#Example_Model_Catalogue | TUFLOW Example Models]]</u> to explore the full list of TUFLOW features.
=Looping Batch File (Optional)=
Looping batch file is a powerful tool running large number of simulations with the least amount of batch file text:
Line 229 ⟶ 244:
</ol>)<br>
Note: The 'CSZ' and 'DES' are user defined batch file variables. The 'CSZ' refers to a cell size and 'DES' refers to a design scenario. <br>
<li>Save the batch file and double click it in file explorer to run the simulation.
</ol
= Variables (Optional) =
Variables provide a way to define values once and reuse them across control files, which helps manage models with multiple scenarios and events.
Scenarios and events are automatically available as variables. Variables can also be defined using the <font color="blue"><tt>Set Variable </tt></font>command as described in Section 13.2.3 Variables of the [https://docs.tuflow.com/classic-hpc/manual/latest/ <u>TUFLOW manual</u>]. They are referenced by enclosing the variable name within << and >>.
Note: The <font color="blue"><tt>Set Variable </tt></font>command can only be specified in the .tcf or within a read file (.trd) referenced from the .tcf. The variables can then be used in all control files (.tcf, .tgc, .tbc, .ecf, etc).
Example models using variables are provided in the [[TUFLOW Example Models#Bulk Simulation Management|<u>Bulk Simulation Management Example Model Dataset</u>]] on the TUFLOW Wiki.
▲<br>
{{Tips Navigation
| |||