ANSYS - Fluent¶
Is always recommended to check which parameters are available in Fluent and adapt the below example according to your needs.
For that, run fluent -help for getting a list of options. However, as when running Fluent one must specify one of the
following flags:
- 2d: This is a 2D solver with single point precision.
- 3d: This is a 3D solver with single point precision.
- 2dpp: This is a 2D solver with double point precision.
- 3dpp: This is a 3D solver with double point precision.
Running Fluent jobs¶
PModules¶
Is strongly recommended the use of the latest ANSYS software available in PModules.
In addition, for Slingshot (Merlin7's interconnect) compatibility, loading any
of the libfabric modules is necessary for inter-node communication, when using
more than one node. In general, try to update a recent version of it.
module purge
module use unstable
module load ANSYS/2025R2
# Load the libfabric module
module load libfabric/2.5.1-oss
Interactive: RSM from remote PSI Workstations¶
Is possible to run Fluent through RSM from remote PSI (Linux or Windows) Workstation having a local installation of ANSYS Fluent and RSM client. For that, please refer to the ANSYS RSM in the Merlin documentation for further information of how to setup a RSM client for submitting jobs to Merlin.
Warning
Slingshot compatibility for RSM-based submitted workflows is not guaranteed.
For proper interconnect compatibility, please submit regular batch jobs instead with sbatch.
Non-interactive: sbatch¶
Running jobs with sbatch is always the recommended method. This makes the use
of the resources more efficient. For running it as a job, one needs to run in
no graphical mode (-g option).
Serial example¶
This example shows a very basic serial job.
#!/bin/bash
#SBATCH --job-name=flu-serial
#SBATCH --cluster=merlin7
#SBATCH --partition=hourly
#SBATCH --time=00:50:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --hint=nomultithread
#SBATCH --output=slurm-%j.out
#SBATCH --error=slurm-%j.err
# Load the proper ANSYS version
module purge
module use unstable
module load ANSYS/2025R2
# Load libfabric module
module load libfabric/2.5.1-oss
# [Optional:BEGIN] Specify your license server if this is not 'lic-ansys.psi.ch'
# LICENSE_SERVER=<your_license_server>
# export ANSYSLMD_LICENSE_FILE=1055@$LICENSE_SERVER
# export ANSYSLI_SERVERS=2325@$LICENSE_SERVER
# [Optional:END]
JOURNAL_FILE=fluent.jou
fluent 3ddp -g -i ${JOURNAL_FILE}
MPI-based example¶
An example for running Fluent using a Slurm batch script is the following:
#!/bin/bash
#SBATCH --job-name=flu-mpi
#SBATCH --cluster=merlin7
#SBATCH --partition=hourly
#SBATCH --time=00:50:00
#SBATCH --nodes=2
#SBATCH --ntasks=256
#SBATCH --ntasks-per-node=128
#SBATCH --output=slurm-%j.out
#SBATCH --error=slurm-%j.err
# Load the proper ANSYS version
module purge
module use unstable
module load ANSYS/2025R2
# Load libfabric module
module load libfabric/2.5.1-oss
# Export libfabric library location to Intel MPI
export I_MPI_OFI_LIBRARY=${LIBFABRIC_HOME}/lib64/libfabric.so.1
# [Optional:BEGIN] Specify your license server if this is not 'lic-ansys.psi.ch'
# LICENSE_SERVER=<your_license_server>
# export ANSYSLMD_LICENSE_FILE=1055@$LICENSE_SERVER
# export ANSYSLI_SERVERS=2325@$LICENSE_SERVER
# [Optional:END]
scontrol show node ${SLURM_JOB_NODELIST} | awk '/NodeName=/ {print $1}' | cut -f2 -d= | paste -sd '\n' - > hosts.txt
JOURNAL_FILE=fluent.jou
fluent 3ddp -g -t ${SLURM_NTASKS} -mpi=intel -i ${JOURNAL_FILE} -cnf=hosts.txt -mpiopt=" -genv I_MPI_FABRICS ofi -genv I_MPI_DEBUG 10 -genv I_MPI_OFI_LIBRARY ${I_MPI_OFI_LIBRARY} -genv I_MPI_OFI_PROVIDER cxi"
In general, no hyperthreading is recommended for MPI based jobs. Also, one can combine it with --exclusive when necessary, and add --mem=0 if the memory is not entirely available.
Interactive: salloc¶
Running Fluent interactively is strongly not recommended and one should
whenever possible use sbatch. However, sometimes interactive runs are
needed. For jobs requiring only few CPUs (e.g. 2 CPUs) and for a
short period of time, one can use the login nodes. Otherwise, one must use the
Slurm batch system using allocations, ideally by using Slurm interactive sessions.
For multi-node allocations, please remember to load the libfabric module.
Requirements¶
SSH Keys¶
Running Fluent interactively requires the use of SSH Keys. This is the way of
communication between the GUI and the different nodes. For doing that, one must
have a passphrase protected SSH Key. If the user does not have SSH Keys yet
(simply run ls $HOME/.ssh/ to check whether id_rsa files exist or
not). For deploying SSH Keys for running Fluent interactively, one should
follow this documentation: Configuring SSH Keys