Run TUFLOW From a Batch-file

From Tuflow
Revision as of 19:40, 10 August 2011 by tuflow>Par (Created page with '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 star...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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 "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, this will keep it open.

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