How to Submit an Ansys Fluent Job

To schedule a job, you will need to write a script file (typically with the extension .sh, .sbatch, or .bash) with a series of commands to be executed by SLURM when resources are available. See the example below to run Ansys Fluent in serial or parallel mode.

Example Ansys Fluent Batch Script:

#!/bin/bash
#
#SBATCH –ntasks=4
#SBATCH –job-name=fluent-test
#SBATCH –output=output.%j.fluent-test
#SBATCH –time=00:10:00

####SLURM4 processor Ansys Fluent test to run for 10 minutes.

module purge
module add fluent/v182

time fluent 3ddp -t4 -g -i fluent-test.jou

NOTES:

1. The first line of this example names the execution environment (in this case “bash” which stands for “bourne again shell”) for the subsequent commands.

2. Lines that start with one # are comments for bash. Lines that start with two or more #’s are comments for both bash and SLURM.

3. Lines that start with #SBATCH are SLURM job control directives. These need to come before the executable lines at the bottom (which will be executed when SLURM determines resources are available).

–ntasks=4 sets the number of tasks (or processors) to be launched. Use 1 to execute in serial mode and more than 1 to execute in parallel mode.

–job-name= fluent-test sets the name for your job that will be shown in queue.

–output=output.%j.fluent-test sets the file name for any output that would otherwise be sent to the screen where the %j will be replaced by the job number. This file can be viewed while your job is still running to monitor progress.

–time=0:10:00 sets the maximum time for execution.

4. The “module” lines configure the execution environment by purging the environment (variables, paths, etc.) and then setting up the current version of Ansys Fluent on the server.

5. The final line starts Ansys Fluent. At the beginning of the line is “time” which is a bash command that adds lines to the end of the output file indicating execution time. The 3ddp option starts Ansys Fluent in three-dimensional, double precision mode, -t4 sets the number of processors (which can be the same or less than the number set above), -g suppresses graphics, and -i specifies the Ansys Fluent input file. The most common input file will be a Ansys Fluent journal file that contains a list of TUI (text user interface) commands.

6. Save your file to your current directory and execute it using the following command:

[user@Head ~]$ sbatch ./jobname.sh