Run TUFLOW From a Batch-file

From Tuflow
Revision as of 11:28, 29 September 2011 by tuflow>Par (Protected "Run TUFLOW From a Batch-file": High traffic page ([edit=sysop] (indefinite) [move=sysop] (indefinite)))
Jump to navigation Jump to search

TUFLOW simulations can also be started from a batch file. Batch files are text files which contain a series of commands. Batch files allow a large degree of flexibility in starting TUFLOW simulations, advanced batch files can be used to:

  • Run multiple simulations
  • Set CPU priority for TUFLOW simulations
  • Create a wait (e.g. start a simulation in 1 hour)
  • Test simulation input
  • Copy a TUFLOW model
  • Post process results after simulation has finished.

These advanced features are not covered at this stage in the TUFLOW tutorial model. To use a batch file, create a new text file in the TUFLOW\runs directory. The name is arbitrary but the file must have the extension ".bat". For example the file name could be _run_TUFLOW.bat.

Open this file in a text editor and add the following line.

"C:\TUFLOW\Releases\2010-10\w32\TUFLOW_iSP_w32.exe"  "M01_5m_001.tcf"

This is the simplest command line for starting TUFLOW, the line above contains only two arguments, the first is the path to the TUFLOW executable and the second argument "M01_5m_001.tcf" is the simulation file name. Depending on the location of the executable the above command line will need to be modified. The quotations around the TUFLOW executable and the .tcf file name are only required if there are spaces in the file names. However, it is recommended to include these to avoid problems.

TIP:
A second line with the text "pause" can be added, this will prompt the user to press a key at the end of the batch file. This is useful if the DOS window disappears from the screen, before you can read the output, the pause command will keep the window open.

"C:\TUFLOW\Releases\2010-10\w32\TUFLOW_iSP_w32.exe"  "M01_5m_001.tcf"
pause