To run ANSYS Fluent in the background in a C-shell (csh) on a Linux system, type a command of the following form at the system-level prompt:
fluent 2d -g < inputfile > & outputfile &
or in a Bourne/Korn-shell, type:
fluent 2d -g < inputfile > outputfile 2>&1 &
In these examples,
fluent is the command you
type to run ANSYS Fluent interactively.
-g indicates that the program
is to be run without the GUI or graphics (see Starting ANSYS Fluent).
inputfile is a file of ANSYS Fluent commands that are identical to those that you would type interactively.
outputfile is a file that
the background job will create, which will contain the output that ANSYS Fluent would normally print to the screen (for example, the menu
prompts and residual reports).
& tells the Linux system
to perform this task in background and to send all standard system
errors (if any) to outputfile.
The file inputfile can be a journal
file created in an earlier ANSYS Fluent session, or it can be a file
that you have created using a text editor. In either case, the file
must consist only of text interface commands (since the GUI is disabled
during batch execution). A typical inputfile is shown below:
; Read case file rc example.cas ; Initialize the solution /solve/initialize/initialize-flow ; Calculate 50 iterations it 50 ; Write data file wd example50.dat ; Calculate another 50 iterations it 50 ; Write another data file wd example100.dat ; Exit Fluent exit yes
This example file reads a case file example.cas, initializes the solution, and performs 100 iterations in two groups
of 50, saving a new data file after each 50 iterations. The final
line of the file terminates the session. Note that the example input
file makes use of the standard aliases for reading and writing case
and data files and for iterating. (it is
the alias for /solve/iterate, rc is the alias for /file/read-case, wd is the alias for /file/write-data, etc.) These predefined aliases allow you to execute commonly used
commands without entering the text menu in which they are found. In
general, ANSYS Fluent assumes that input beginning with a / starts in the top-level text menu, so if you use any
text commands for which aliases do not exist, you must be sure to
type in the complete name of the command (for example, /solve/initialize/initialize-flow). Note also that you
can include comments in the file. As in the example above, comment
lines must begin with a ; (semicolon).
An alternate strategy for submitting your batch run, as follows,
has the advantage that the outputfile will
contain a record of the commands in the inputfile. In this approach, you would submit the batch job in a C-shell using:
fluent 2d -g -i inputfile >& outputfile &
or in a Bourne/Korn-shell using:
fluent 2d -g -i inputfile > outputfile 2>&1 &