Ansys Fluent

Creating Journal file in Ansys Fluent

  1. File -> Write -> Start Journal

  2. Apply the necessary settings using the Text User Interface, run a few iterations of the simulation than save the results.

  3. File -> Write -> Stop Journal

  4. You can edit and modify the created Journal file using a text editor (eg. number of iterations, save location, etc.)

Creating a SLURM script

#!/bin/bash
#SBATCH --job-name=<job-name>
#SBATCH --output=%j.out
#SBATCH --error=%j.err
#SBATCH --partition=cpu
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=8
#SBATCH --time=00:10:00
#SBATCH --account=<project-name>

### NOTICE. DO NOT use flag "--cpus-per-task= "
### It will break job setting, so no MPI/OpenMP job

export SLURM_MPI_TYPE=pmi2
export OMP_NUM_THREADS=1
export SSH_SPAWN=0
export I_MPI_OFI_LIBRARY_INTERNAL=0
export INTELMPI_ROOT=/opt/software/packages/intel/mpi/2021.9.0/
export SLURM_CPU_BIND=none

if [ $SLURM_JOB_NUM_NODES -eq 1 ]
then
export I_MPI_FABRICS=shm
fi

rm -rf fluentHostfile
FLUENTNODES="$(scontrol show hostnames)"
echo $FLUENTNODES > fluentHostfile

export ANSYSLMD_LICENSE_FILE=1056@license.komondor.hpc.einfra.hu

/opt/software/packages/ansys/2023r1/ansys_inc/v231/fluent/bin/fluent 3ddp -g -t $SLURM_NTASKS -mpi=intel -mpiopt="-genv FI_PROVIDER cxi -genv I_MPI_PIN 1 -genv I_MPI_PIN_CELL core -genv FI_PROVIDER_PATH /opt/cray/libfabric/1.15.2.0/lib64/"  -i  <journal-file> -cnf=fluentHostfile -scheduler_tight_coupling -pcheck=0

Change the parts marked as <$variable> according to your own preferences. If it is necessary, change the parameters below:

2d  2D, single-precison solver
3d  3D, single-precision solver
2ddp  2D, double-precision solver
3ddp  3D, double-precison solver
-g  run without GUI and graphics
-i <journal> - reading in a Journal file

Other commands: Ansys Fluent User’s Guide (2023/R2) / 4.1.5. Command Line Startup Options

Note

You can issue TUI commands directly after opening Fluent. In this case, the Journal file is unnecessary.

Running a job

  1. Upload the necessary files to the directory you want to use (eg. using WinSCP).

  2. Login to the server via SSH.

  3. Use the following commands:

cd <working_directory>
sbatch <script_name>.sbatch
  1. You can monitor your submitted jobs with the following command:

squeue -u <user-name>