Jump to content

Recommended Posts


How do I set up a run for two different independent variables? I have a tributary and a main channel and I would like to instigate the joint probability of a range of events occurring in both channels.




Using a TUFLOW event file you can set multiple sets of events, in this case we will set M_<event> for the main channel and T_<event> for the tributary.

This will set the event magnitude of the main channel  and tributary separately. See the example excerpt from a tef file below.  The event file (.tef) is read into the .tcf with the command “Event File == <.tef>”


# MAIN CHANNEL definition

Define Event == M_Q005

      BC Event Source == __Main__ | Q001

End Define


Define Event == M_Q010

      BC Event Source == __Main__ | Q010

End Define


Define Event == M_Q100

      BC Event Source == __Main__ | Q10

End Define


# TRIBUTARY definition

Define Event == T_Q005

      BC Event Source == __Trib__ | Q005

End Define


Define Event == T_Q010

      BC Event Source == __Trib__ | Q010

End Define


Define Event == T_Q100

      BC Event Source == __Trib__ | Q100

End Define


In the bc_dbase, we will use these BC event sources (_Main_ and _Trib_) as wildcards. Refer to the below example, assuming that the boundaries in your model are called Main_Flow and Trib_Flow


Name          Source                        Column 1          Column 2

Main_Flow   Main__Main_.csv         Time                   Flow

Trib_Flow    Trib__Trib_.csv            Time                   Flow


The events in the .tef are set separately so that at the run start you can specify which one to use.   If running from a batch file the –e (event) inputs can be used.  For example, in your batch file:

Start “TUFLOW” "C:\TUFLOW\Releases\2013-12\w64\TUFLOW_iSP_w64.exe" -e1  M_Q010 -e2 T_Q100 example_~e1~_~e2~_001.tcf

The above would run a Q10 in the main channel (-e1 M_Q010) and a Q100 in the tributary (-e2 T_Q010), referencing flows from Main_Q010.csv and Trib_Q100.csv


This can also be done by setting the “Model Events” command in the .tcf.  To run the Q010 Main channel and Q100 Tributary (as above).  The following would be needed in the .tcf.

Model Events == M_Q010 | T_Q100

Note the use of the vertical bar (|) used to separate the two events.


Specifying the events within the .tcf, would require modifying and saving the .tcf for each event you wish to run.  This is a bit cumbersome and batch files become very powerful when running multiple events. For example if you wanted to run all combinations of events you could use a looped batch file, see here for more info:



### Start Batch file

@echo off


:: This sets the variables as local, so you can use another batch file with A and B variables



:: set up variables

set A=M_Q001 M_Q002 M_Q005 M_Q010 M_Q020 M_Q050 M_Q100 M_Q200

set B=T_Q001 T_Q002 T_Q005 T_Q010 T_Q020 T_Q050 T_Q100 T_Q200


:: Loop Through

FOR %%a in (%A%) do (

    FOR %%b in (%B%) DO (

        Start “TUFLOW” "C:\TUFLOW\Releases\2013-12\w64\TUFLOW_iSP_w64.exe" -e1  %%a  -e2 %%b example_~e1~_~e2~_001.tcf




### End Batch file


If you wanted to also set the event durations as well as the magnitudes you could use 4 events (two for the event magnitudes and two for the event durations).








TUFLOW Support

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...