ANSYS Fluent is a Computational Fluid Dynamics (CFD) code for modelling fluid flow, heat transfer, mass transfer and chemical reactions. Fluent has interfaces to other pre and post processing packages supplied by ANSYS such as ICEMCFD or Ensight and can incorporate user developed models via user defined functions. Fluent can make use of built in MPI to utilize multiple cross node CPU and can scale to hundreds of cores.
After connecting to Bessemer (see Establishing a SSH connection), you can start an interactive graphical session or submit a batch job using ANSYS programs activating them and making them available with one of the module load commands below:
module load ANSYS/19.4 module load ANSYS/20.1/binary module load ANSYS/20.2/binary module load ANSYS/21.1/binary module load ANSYS/21.2/binary
While using a X11 GUI forwarding supported SSH client, an interactive session can be started on Bessemer with the
srun --pty bash -i command which supports graphical applications.
You can load an ANSYS module above and then start the fluent program by running the
If desired, the ANSYS Workbench GUI executable can be launched with the
To use more than a single core, you should write a batch job script and fluent journal file for submission to the batch queues.
To submit Fluent jobs with larger resources a batch job must be submitted to the scheduler. A Fluent batch job is composed of a Fluent journal file which tells Fluent what to do and submission script which tells the scheduler how much resource to request and how to start Fluent.
A Fluent journal file is effectively a sequence of TUI and/or Scheme commands that you’ll supply to Fluent instead of using the GUI / TUI. A more thorough explanation and tutorial on how to make a Fluent journal file can be found on the following page: Writing Fluent journal files.
It is critical that you consult with the Fluent journal syntax documentation linked above in order to ensure features such as autosaving and intermediate save states are turned on and functioning correctly!
Fluent is capable of running in both MPI and SMP parallel environments but will use its in-build MPI communications for both.
On Bessemer, cross node jobs are not permitted and there is no
mpi-rsh parallel environment.
This necessitates the use of the default SMP OpenMP parallel environment (up to 40 cores on a single node only).
The lack of other options compared to Fluent on ShARC is as a result of execution on a single node not requiring these options.
The following is an example batch submission script,
cfd_job.sh, to run the executable
fluent with input journal file
subjou.jou, and carry out a 2D double precision CFD simulation.
The script requests 4 cores using the OpenMP parallel environment with a runtime of 60 mins and 2 GB of real memory per core.
Sample SMP Fluent Scheduler Job Script¶
2ddpargument is used to specify a 2D double precision simulation. Valid values include:
$SLURM_NTASKSis a SLURM scheduler variable which will return the requested number of tasks.
-driver nullinstruct Fluent that it will be running with no GUI to avoid errors caused by plot / figure export.
#!/bin/bash #SBATCH --nodes=1 #SBATCH --ntasks-per-node=4 #SBATCH --mem=8000 #SBATCH --job-name=name_fluent_smp_4 #SBATCH --output=output_fluent_smp_4 #SBATCH --time=01:00:00 #SBATCH --firstname.lastname@example.org #SBATCH --mail-type=ALL module load ANSYS/20.2 fluent 2ddp -i test.jou -gu -t$SLURM_NTASKS -driver null
The job is submitted to the queue by typing:
While in a batch job you cannot call a display of a window / figure / animation as Fluent has nowhere to direct this output (there is no available display.)
To avoid this issue while attempting to export images from a batch job you should ensure the fluent command in your submission script has the
-driver null arguments.
i.e. for a ShARC batch job:
fluent 2ddp -i test.jou -gu -t$NSLOTS -rsh -mpi=intel -pib.infinipath -driver null
for a Bessemer batch job:
fluent 2ddp -i test.jou -gu -t$SLURM_NTASKS -driver null
You can setup your plots / graphs either in your journal file or interactively via the GUI and saving the case file.
You can then instruct Fluent to make a hard copy after each figure/animation in the you journal file with:
Ensure that you select the correct file format as some file types will not support animations.
For an example of the journal file commands see below:
/display set-window xx ;(xx -> window number) /display set contours surface yy ;(surface id = yy) /display set contours filled-contours yes /display contour zz vof 0 1 ;(contour of volume fraction field (vof) of zz phase, min = 0, max = 1) /display hard-copy "vof-%t.jpg" ;(save the image file in .jpg format)