13.2 Simulation Management
TUFLOW incorporates powerful functionality for managing the simulation of multiple events and scenarios. These features allow many simulations to be initiated from a single .tcf file (see Section 4.1.5), rather than duplicating model inputs and control files (e.g. *.tcf, *.tgc, *.ecf, *.tbc, *.trfc, BC Database, etc.) for every model variation. In many cases, one set of control files can be used.
Event and scenario simulation management can support an unlimited number of simulations. For example, the TUFLOW Insights Library includes a case study where a single set of control files was used to run 328,886 combinations of model domains, events and scenarios collectively covering the country of Scotland.
There are numerous examples (with associated data downloads) which demonstrate these powerful features:
- eLearning - Bulk Simulation Management Scenarios, Events and Variables
- TUFLOW Tutorial Module 8 - Scenario Management
- TUFLOW Tutorial Module 9 - Event Management
- TUFLOW Example Models - Scenarios, Events and Variables
The following sections of the manual discuss the available options.
13.2.1 Events
TUFLOW’s Events feature enables the design of a single model setup that can be used to simulate multiple events without duplicating any input control files. This not only makes management of the model easier, but it also ensures consistency between the simulations and supports better project quality control.
Most hydraulic modelling studies require the simulation of multiple different historic and design events. For example, a flood study may assess:
- Numerous historic calibration/validation events
- Multiple Annual Exceedance Probability (AEP) events (e.g. 50%, 20%, 10%, 5%, 2%, 1%, 0.5%, 0.2%)
- Multiple rainfall event durations
- Various event temporal pattern options
- Alternative downstream boundary conditions (e.g. storm tides)
- Future climate change scenarios
The total number of simulations to accommodate for the range of event combinations can sum to hundreds, if not thousands.
Multiple events are set up through a TUFLOW Event File (.tef) using the
The
All defined events are automatically available as variables and can be referenced in control files. See Section 13.2.3.
13.2.1.1 Event Groups
Up to nine different event groups (e1 to e9) can be specified for a single simulation. Each group can contain an unlimited number of events. Also, If Event blocks can be nested up to 10 levels, see Example 3 below (Section 13.2.1.4). Event groups typically represent independent parameters such as:
- Flood event magnitude: 50%, 20%, 10%, 5%, 2%, 1%, 0.5%, 0.2% AEP
- Storm duration: 1h, 2h, 3h, 4h, 6h, 9h, 12h
- Design event temporal pattern: TP01, TP02, TP03, TP04, TP05, TP06, TP07, TP08, TP09, TP10
- Downstream boundary condition: LAT, HAT, 5 year, 10 year
- Climate change time horizon: 2025, 2050, 2100
The .tef file (see Section 4.1.10) generally lists all available event options and can therefore function as a database of all event options. This is useful for model peer review purposes.
13.2.1.2 Event Naming
When events are defined in a model, the event names are automatically appended to the base .tcf filename to form the output filenames. They are appended in the order they are defined at run time. For example, if the .tcf is
- If event 1 =
01AEP and event 2 =12h , then output filename =MODEL_EXG_001_01AEP_12h - If event 2 =
02AEP and event 2 =24h , then output filename =MODEL_EXG_001_02AEP_24h
To control where event name(s) are inserted within the output filename, include ~e~ or ~e<x>~ (where <x> is from 1 to 9) into the .tcf filename. The placeholder is replaced with the corresponding event name when the simulation is run. This naming method is recommended to ensure consistent naming conventions across simulations.
Note: ~e~ is effectively the same as ~e1~ and is typically used if there is only one event type being varied.
For example, if the .tcf is
- If e1 =
01AEP and e2 =12h , then output filename =MODEL_01AEP_12h_EXG_001 - If e1 =
02AEP and e2 =24h , then output filename =MODEL_02AEP_24h_EXG_001
13.2.1.3 Simulating Events
Two options are available to define the event(s) for a model simulation:
- Command line options:
-eor-e<x>(Table 13.1). This option is best suited for executing bulk simulations. For example:-e1 01AEP -e2 12h - Using the
Model Events command in the .tcf: Events are manually specified within the .tcf. This option is suitable for quick “what-if” testing or sensitivity simulations. It is not practical for bulk simulations. Note that if using the-eor-e<x>option, this will override any events defined usingModel Events .
13.2.1.4 Event Examples
The following examples demonstrate different ways to structure and apply events.
Events Example 1: Single Event Group
Each AEP/duration combination is defined as a separate event.
BC Database (Section 8.5):
TUFLOW Control File (.tcf):
Include ~e~ in the .tcf filename, for example “
TUFLOW Event File (.tef):
Note that ~e~ has been used as an automatic variable in the output location paths. See Section 13.2.3 for details on this feature.
Refer to Section 13.4.2 for details on how to execute TUFLOW simulations.
Below is an example Windows batch file that could be used to execute the above example:
set TUFLOWEXE=..\path\to\TUFLOW_executable\TUFLOW_iSP_w64.exe
set RUN=start "TUFLOW" /wait "%TUFLOWEXE%" -b
%RUN% –e1 05AEP_01h Nile_~e~.tcf
%RUN% –e1 05AEP_02h Nile_~e~.tcf
%RUN% –e1 02AEP_01h Nile_~e~.tcf
%RUN% –e1 02AEP_02h Nile_~e~.tcf
Events Example 2: Two Event Groups
AEP and duration are separated into independent event groups (e1 and e2). This is a more concise structure, reducing repetition.
BC Database (Section 8.5):
TUFLOW Control File (.tcf):
Include ~e1~ and ~e2~ in the .tcf filename, for example “Nile_~e1~_~e2~.tcf”, and add the following line at the bottom of the .tcf file to reference the TUFLOW Event file (.tef):
TUFLOW Event File (.tef):
Note that ~e1~ has been used as an automatic variable in the output location paths. See Section 13.2.3 for details on this feature.
Refer to Section 13.4.2 for details on how to execute TUFLOW simulations.
Below is an example Windows batch file that could be used to execute the above example:
set TUFLOWEXE=..\path\to\TUFLOW_executable\TUFLOW_iSP_w64.exe
set RUN=start "TUFLOW" /wait "%TUFLOWEXE%" -b
%RUN% –e1 05AEP -e2 01h Nile_~e1~_~e2~.tcf
%RUN% –e1 05AEP -e2 02h Nile_~e1~_~e2~.tcf
%RUN% –e1 02AEP -e2 01h Nile_~e1~_~e2~.tcf
%RUN% –e1 05AEP -e2 02h Nile_~e1~_~e2~.tcf
Events Example 3: Nested Events
This example varies check file outputs by event. This is useful as it can reduce simulation time.
TUFLOW Control File (.tcf):
Models using events are provided in the TUFLOW Tutorial Module 9 and the Bulk Simulation Management Example Model Dataset on the TUFLOW Wiki.
13.2.2 Scenarios
TUFLOW’s Scenarios feature enables the design of a single model setup that can be used to simulate multiple scenarios without duplicating any input control files. This not only makes management of the model easier, but it also ensures consistency between the simulations and supports better project quality control.
The
Scenarios can be implemented in most of TUFLOW’s control files where model inputs or parameters may vary by scenario. Scenario logic is not supported in the TUFLOW External Stress File (Section 4.1.13), Advection Control File (Section 4.1.14) and within a
All defined scenarios are automatically available as variables and can be referenced in control files. See Section 13.2.3.
13.2.2.1 Scenario Naming
When scenarios are defined in a model, the scenario names are automatically appended to the base .tcf filename to form the output filenames. They are appended in the order they are defined at run time. For example, if the .tcf is
- If scenario 1 =
5m and scenario 2 =opA , then output filename =MODEL_EXG_001_5m_opA - If scenario 2 =
10m and scenario 2 =opB , then output filename =MODEL_EXG_001_10m_opB
To control where scenario name(s) are inserted within the output filename, include ~s~ or ~s<x>~ (where <x> is from 1 to 9) into the .tcf filename. The placeholder is replaced with the corresponding scenario name when the simulation is run. This naming method is recommended to ensure consistent naming conventions across simulations.
Note: ~s~ is effectively the same as ~s1~ and is typically used if there is only one scenario type being varied.
For example, if the .tcf is
- If s1 =
5m and s2 =opA , then output filename =MODEL_5m_opA_EXG_001 - If s1 =
10m and s2 =opB , then output filename =MODEL_10m_opB_EXG_001
13.2.2.2 Simulating Scenarios
Two options are available to define the scenario(s) for a model simulation:
- Command line options:
-sor-s<x>(Table 13.1). This option is best suited for executing bulk simulations. For example:-s1 5m -s2 opA - Using the
Model Scenarios command in the .tcf: Scenarios are manually specified within the .tcf. This option is suitable for quick “what-if” testing or sensitivity simulations. It is not practical for bulk simulations. Note that if using the-sor-s<x>option, this will override any scenarios defined usingModel Scenarios .
13.2.2.3 Scenario Examples
The following examples demonstrate how
Scenarios Example 1: Simple Design Option
A scenario block is added into a TUFLOW Geometry Control File (.tgc) to vary materials. For further details on land use and materials, see Section 7.2.7.
TUFLOW execution logic:
- Default Material ID of 1 is set over the entire 2D domain
- Existing land use materials are applied via the
2d_mat_existing.shp layer - If
opA is selected (via-s1 opAorModel Scenarios == opA ):2d_mat_opA.shp is processed and overrides the existing Material ID’s already assigned with the2d_mat_existing.shp where they overlap
- If
opA is not selected, the2d_mat_opA.shp is ignored
Scenarios Example 2: Hierarchical Options
Scenario blocks are added into a TUFLOW Geometry Control File (.tgc) to vary materials. For further details on land use and materials, see Section 7.2.7.
TUFLOW execution logic:
opA : Base scenario- Only
2d_mat_opA.shp will be read
- Only
opB : Extension ofopA 2d_mat_opA.shp and2d_mat_opB.shp will be read
opC : Alternative scenario toopA andopB - Only
2d_mat_opC.shp will be read
- Only
Note: Including a
Refer to Section 13.4.2 for details on how to execute TUFLOW simulations.
Below is an example Windows batch file that could be used to execute the above example:
set TUFLOWEXE=..\path\to\TUFLOW_executable\TUFLOW_iSP_w64.exe
set RUN=start "TUFLOW" /wait "%TUFLOWEXE%" -b
%RUN% –s1 opA Nile_~s1~.tcf
%RUN% –s1 opB Nile_~s1~.tcf
%RUN% –s1 opC Nile_~s1~.tcf
Scenarios Example 3: Nested Scenarios
Nested scenario blocks are added to the TUFLOW Control File (.tcf) to vary model parameters.
Models using scenarios are provided in the TUFLOW Tutorial Module 8 and the Bulk Simulation Management Example Model Dataset on the TUFLOW Wiki.
13.2.3 Variables
The
Variables can be defined in:
- TUFLOW Control Files (.tcf): See Section 4.1.5
- TUFLOW Event Files (.tef): See Section 4.1.6
- Read Files (.trd): See Section 4.1.16
- Override Files: See Section 4.1.17
Read and override files are extensions of the control file into which they are read. Therefore, variables defined within a read or override file are only valid if that file is read into a .tcf or .tef.
Note that all defined events (Section 13.2.1) and scenarios (Section 13.2.2) are automatically available as variables.
Once a variable has been defined, it can be referenced in any control file (*.tcf, *.tgc, *.ecf, *.tbc, etc.). The variables are referenced within control files by <<variable>>. For example:
13.2.3.1 Variable Examples
The following examples show some helpful uses of variables.
Variables Example 1: Defining Variables in Logic Blocks
In the example below, variables associated with different cell sizes are defined in the .tcf within a single logic block.
These variables can then be used across multiple control files:
- TUFLOW Control File (.tcf):
Timestep == <<2D_TIMESTEP>> - TUFLOW Control File (.tcf):
Grid Output Cell Size == <<2D_CELL_SIZE>> - TUFLOW Geometry Control File (.tgc):
Cell Size == <<2D_CELL_SIZE>>
This structure ensures all cell size and timestep commands remain consistent across the model for each scenario.
Variables Example 2: Events and Scenarios as Variables
As mentioned above, all defined events and scenarios are automatically available as variables. This allows them to be referenced directly within control files. For example, to direct results to scenario specific folders:
If ~s1~ is set to
Also, event and scenario variables can be combined:
If ~e1~ is ~s1~ is
Models using variables are provided in the Bulk Simulation Management Example Model Dataset on the TUFLOW Wiki.