Skip to content

ANSYS

ANSYS is a commercial package for engineering simulations (CFD, structural analysis, electromagnetics ...). Fluent is one of the ANSYS modules for computational fluid dynamics (CFD).

Note: Bring Your Own License ANSYS on HPC Vega runs under the Bring Your Own License principle. Users must have their own ANSYS license (license server) and specify its address when launching a job.

1. Load the module

Load ANSYS 2024R2 and the Mesa dependency (required for the graphical component).

module use /ceph/hpc/software/ebmodules/modulefiles/all/
module --ignore-cache load ANSYS/2024R2
module load Mesa

2. Set up the license

Before running, you need to set two variables for access to your license server:

export ANSYSLI_SERVERS=<port>@<license-server-IP>
export ANSYSLMD_LICENSE_FILE=<port>@<license-server-IP>

Replace <port> and <license-server-IP> with your license server's details.

3. Prepare the input file

Fluent in batch mode is run with a .jou file (journal file), which contains the commands for the simulation.

4. Run via SLURM

Run ANSYS/Fluent exclusively through a SLURM job, not on the login node.

SBATCH example

#!/bin/bash
#SBATCH -n 128 # Cores
#SBATCH -N 2  # Allocate 4 nodes for the job
#SBATCH -J test_job # Job name
#SBATCH -p cpu # select partition
#SBATCH --threads-per-core=1
#SBATCH --time=01:00:00
#SBATCH -output=%j.out # output file
#SBATCH -error=%j.err # error file

module use /ceph/hpc/software/ebmodules/modulefiles/all/
module --ignore-cache load ANSYS/2024R2 
module load Mesa

export OMP_NUM_THREADS=1
export OMP_PROC_BIND=true

export FLUENT_GUI=off
export ANSYSLI_SERVERS=<port>@<license-server-IP>
export ANSYSLMD_LICENSE_FILE=<port>@<license-server-IP>

if [ -z "$SLURM_NPROCS" ]; then
  N=$(( $(echo $SLURM_TASKS_PER_NODE | sed -r 's/([0-9]+)\(x([0-9]+)\)/\1 * \2/') ))
else
  N=$SLURM_NPROCS
fi

echo -e "N: $N\n";

export MPIRUN_OPTIONS="--oversubscribe"

# run fluent in batch on the allocated node(s)
fluent 3ddp -g -slurm -t$N -mpi=openmpi -i input.jou

The script reads the number of allocated processes ($SLURM_NPROCS or $SLURM_TASKS_PER_NODE) and passes this number to Fluent as -t$N.

Submitting the job:

sbatch my_job.sh

Where to find the results:

Standard output and errors are written to <job_id>.out and <job_id>.err. Fluent writes the simulation results themselves to the directory the job was submitted from, or as specified in the .jou file.

Documentation and references