ansys fluent

ansys fluent

Introduction


Usage



module load ansys/2024R1
(version 241)
Old ones: module load ansys/v212 , module load ansys/v195 OR module load ansys/v202

To get a list of all versions: module avail ansys



Installation


Sample PBS script

# This is an example of PBS script file for ansys
#PBS -N FluentTest
#PBS -m e
#PBS -M yourEmail@griffith.edu.au
# specifies number of CPUs (ncpus) used in PBS
#PBS -l select=1:ncpus=1:mem=10g,walltime=24:00:00

# specifies the job name, input file and output file
jobname=MyAnsysRun
jobInput=/sw/ansys/2022R2/v222/ansys/data/models/casting.inp
###jobOutput=/export/home/s123456/pbs/output/ansysOUTput.txt
# specifies working directory
work_dir=/export/home/s123456/pbs/workdir
## sets up the anys environment
module load ansys/v202
module load intel/intelmpi
module list
# starts simulation
cd $work_dir
#Must be set to INTELMPI or OPENMPI
###ansys161 -b -p aa_r -j $jobname -I $jobInput -o $jobOutput -np 4
ansys161 -b -mpi=INTELMPI -p infiniband aa_r -j $jobname -I $jobInput  -np 4

Special Notes

We recommend using infiniband for interconnect and intel mpi. You may use the following options in the pbs script
module load intel/intelmpi
-p infiniband
-mpi=intel


Another sample pbs script

#!/bin/bash
#PBS -N floor01M1052
#PBS -m bea
#PBS -M YOUREMAILID@griffithuni.edu.au
# specifies number of CPUs (ncpus) used in PBS
#PBS -l select=1:ncpus=16:mem=48g,walltime=300:00:00
#######################################################
# setup variables for names
#######################################################
jobnam=$PBS_JOBNAME
jobloc=/lscratch/s123456/$jobnam
inputfile="${jobnam}.in"
casefile=${jobnam%??}
casefile1="${casefile}.cas.gz"
resulttext="${jobnam}.txt"
resultcas="${jobnam}result.cas.gz"
resultdat="${jobnam}result.dat.gz"
runfile="${jobnam}.run"
#######################################################
# Check if scratch dir exists and create if not
#######################################################
jobloc=/lscratch/s123456/$jobnam
if [ ! -d "jobloc" ]; then
        mkdir $jobloc
fi
#######################################################
# load modules
#######################################################
module load ansys/v202
module load intel/intelmpi
#######################################################
# copy case file and input file to scratch
#######################################################
cp $PBS_O_WORKDIR/$inputfile $jobloc
cp $PBS_O_WORKDIR/$casefile1 $jobloc
echo copy to scratch complete
#######################################################
# run fluent
#######################################################
echo running fluent
cd $jobloc
fluent 3ddp -t16 -cflush -pinfiniband -mpi=intel -g -i $inputfile > $runfile
cd $PBS_O_WORKDIR
#######################################################
# copy result files back to working directory
#######################################################
cp -r $jobloc/* $PBS_O_WORKDIR
#######################################################
# list output
#######################################################
echo $jobnam
echo $jobloc
echo $inputfile
echo $casefile
echo $resulttext
echo $resultcas
echo $resultdat
echo $runfile
echo job finished


Another sample pbs script

vi fluent.sub.griffith

#!/bin/bash

## FLUENT submission script for PBS on gowonda
## -----------------------------------------
##"FLUENT-sub2022v1"
##
## Follow the 6 steps below to configure your job
##
## STEP 1:
##
## Enter a job name after the -N on the line below:
##
#PBS -N MCB_cylinders
##
## STEP 2:
##
## Select the number of cpus/cores required by modifying the #PBS -l select line below
##
## Normally you select cpus in chunks of 16 cpus
## The Maximum value for ncpus is 64 and mpiprocs MUST be the same value as ncpus.
##
## If more than 32 cpus are required then select multiple chunks of 32
## e.g. 32 CPUs: select=1:ncpus=32:mpiprocs=32
## 64 CPUs: select=2:ncpus=32:mpiprocs=64
## ..etc..
##
#PBS -l select=1:ncpus=32:mpiprocs=32:mem=64g,walltime=100:10:00
##
## STEP 3:
## Select the correct queue by modifying the #PBS -q line below
##
## legacyq - 
## workq - 
## bigmem - large memory jobs
## long - 240 hours (by special arrangement)
##
#PBS -q legacyq
##
## STEP 4:
##
## Replace the hpc@cranfield.ac.uk email address
## with your Cranfield email address on the #PBS -M line below:
## Your email address is NOT your username
##
#PBS -m abe
#PBS -M MyEmail@griffithuni.edu.au
##
## ====================================
## DO NOT CHANGE THE LINES BETWEEN HERE
## ====================================
###PBS -l application=fluent
#PBS -j oe
#PBS -W sandbox=PRIVATE
#PBS -k n
ln -s $PWD $PBS_O_WORKDIR/$PBS_JOBID
## Change to working directory
cd $PBS_O_WORKDIR
## Calculate number of CPUs
export cpus=`cat $PBS_NODEFILE | wc -l`
## Create OpenMPI compatible host file
sort -u $PBS_NODEFILE -o fluent_nodes.$$
## ========
## AND HERE
## ========
##
## STEP 5:
## Load the production USE
####module use /apps/modules/all/
## Load the default application environment
##
module load ansys/2021R2
##module load mpi/openmpi/5.0.7
module load mpi/openmpi/4.0.2
##
## STEP 6:
##
## Put the correct parameters in the fluent execution line
## below to run the FLUENT solver
## Unless you are sure do not change the default parameters
##
## The main parameters to modify are dimensions (2d/3d)
## and the input filename - change input.jou to your own filename


fluent 3ddp -ssh -g -cflush -pib -mpi=openmpi -pib.ofed -t${cpus} -cnf=fluent_nodes.$$ -i 21.2-dual-rotor-45.jrn

## Tidy up the log directory
## DO NOT CHANGE THE LINE BELOW
## ============================
rm $PBS_O_WORKDIR/$PBS_JOBID





Check available license


/sw/ansys/2020R2/shared_files/licensing/linx64/ansysli_util -statli 2325@gc-prd-erslic.corp.griffith.edu.au

/sw/ansys/2020R2/shared_files/licensing/linx64/ansysli_util -checkout FLUENT_SOLVER


Reference

  1. https://www.cityu.edu.hk/acim/facilities/pbs_submit.htm
  2. https://www.sharcnet.ca/Software/Fluent6/html/ug/node1232.htm#tab-unix-platforms
  3. https://confluence.cornell.edu/display/SIMULATION/Home