Ansys-fluent¶
Ansys Fluent is a computational fluid dynamics (CFD) software package.
How to use Ansys Fluent on Arrhenius¶
In order to use Ansys Fluent on Arrhenius you need to:
- Have an account on Arrhenius
- Get permission to run Ansys Fluent from the Ansys license owner at your department
Use the command
to list all available versions and make sure that the correct version is loaded in the job script.To load a specific version of the Ansys module, the following command can be used
where<version> is replaced by the actual version, as displayed when using the module avail command.
For more details about Ansys software, see the Ansys web page: http://www.ansys.com/
Ansys License¶
To connect to the license server, Ansys needs the environment variables:
export ANSYSLI_SERVERS=port@servername
export ANSYSLMD_LICENSE_FILE=port@servername
The servername and port are provided by the IT department that runs the license server.
Fluent Wrapper¶
Fluent should be started using the NAISS Fluent wrapper. The wrapper uses the preferred MPI library and the correct network settings, so you do not have to take care of them.
$NAISS_FLUENT_WRAPPER <options>
How to pass MPI environment variables¶
Several MPI environment variables can be passed to Fluent via the environment variable FLUENT_MPIRUN_FLAGS. It is set in the following way:
export FLUENT_MPIRUN_FLAGS="-genv VAR1_NAME VAR1_VALUE -genv VAR2_NAME VAR2_VALUE"
For example, to set Intel MPI debugging information:
export FLUENT_MPIRUN_FLAGS="-genv I_MPI_DEBUG 5"
Running Fluent interactively¶
For interactive work with the Fluent graphical interface, connect to Arrhenius with ThinLinc. Open a terminal in the ThinLinc session and request a compute node, for example with 16 cores:
interactive -p cpu -A <allocation> -n 16
When the compute node has been allocated, set the license server, load the Ansys module and start Fluent using the Fluent wrapper:
export ANSYSLMD_LICENSE_FILE=port@servername
export ANSYSLI_SERVERS=port@servername
module load Ansys/2026R1
$NAISS_FLUENT_WRAPPER
This opens the Fluent Launcher, where you can select the settings.
Submitting a Fluent job on Arrhenius¶
To run Fluent in batch mode, it has to be submitted via a SLURM batch script, as the following example illustrates:
#!/bin/bash
# Name of your job
#SBATCH -J my_test
# Your account name
#SBATCH -A <allocation>
# Requested wall-clock time
#SBATCH -t 10:00:00
# Number of CPU cores
#SBATCH -n 64
# Set the partition for your job, CPU partition
#SBATCH -p cpu
#SBATCH -e error_file.e%J
#-----------------------------------------------
# Set the license server information
export ANSYSLMD_LICENSE_FILE=port@servername
export ANSYSLI_SERVERS=port@servername
# load Ansys module
module load Ansys/2026R1
# The Journal file
JOURNALFILE=journalfile.jou
# Start Fluent using the Fluent wrapper
$NAISS_FLUENT_WRAPPER -gu 3ddp -i $JOURNALFILE
Then you can submit your job using sbatch
Common Fluent Options¶
| Option | Description |
|---|---|
-gu |
run Fluent without graphical interface. |
-i <JOURNALFILE> |
read the specified Fluent Journal File |
2ddp |
2D simulation, using double precision |
3ddp |
3D simulation, using double precision |
2d |
2D simulation, using single precision |
3d |
3D simulation, using single precision |
Hints in case of problems¶
Different results in batch and interactive runs¶
Make sure that batch and interactive runs use the same precision. The option 3ddp in the job script runs Fluent in double precision, while in the Fluent Launcher the "Double Precision" box may be unchecked by default.
Saving images in batch mode¶
To save images in batch mode, Fluent must be started with -gu. With -g, all graphics functions are disabled and graphics commands fail with the error "No graphics functions are available".
In addition, the journal file must contain the following lines before an image is saved:
(ti-menu-load-string (format #f "/display/set-window 1 \n"))
(ti-menu-load-string (format #f "/display/set/picture/driver png \n"))
Without /display/set-window 1, saving an image in batch mode fails with the error "No active window".
Source repository