ANSYS/FLUENT

ANSYS/FLUENT

Ansys/FLUENT is a software package for computational fluid dynamics from Ansys Inc. The Ansys Academic Teaching Introductory license is purchased for HPC usage (up to 4 processors/job) and includes the following capabilities:

Important Notes

Installed Versions

All the available versions of Fluent/Ansys for use can be viewed by issuing the following command. This applies for other applications as well.

module avail ansys

output:

---------------------- /usr/local/modules/all -------------------------

ansys/21.1 ansys/22.2 (D) 

The default version is identified by "(D)" behind the module name and can be loaded as:

module load ansys

The other versions of Fluent/Ansys can be loaded as:

module load ansys/<version>

Running Interactive Fluent/Ansys Jobs

Ansys/Fluent is a full GUI application, so refer to HPC Visual Access to get quicker response. 

Serial Job

Reserve a compute node to run Ansys/Fluent interactively by typing:

 srun --x11 --pty bash

You will be assigned one of the compute nodes. To use Ansys, you must modify your environment in the compute node using the following shell command:

module load ansys

Copy the file flow.msh from /usr/local/doc/ANSYS

cp /usr/local/doc/ANSYS/flow.msh ./

Open the workbench by typing:

fluent

(Note: Some menus and buttons are different between versions)

Parallel Job

Depending on the number of processors (n) that you want to request, type:

srun --x11 -N 1 -n 2 --pty bash

(Note: the example uses n=2)

Remote Access

If you want to use the remote access the ANSYS license via your ANSYS installed in your Windows machine, you can configure the environment as showed:

Running Batch Fluent/Ansys Jobs

Serial Job

Copy the content in the file, flowinput-serial.in. If you have not created a .cas file using the interactive job, copy the flow-serial.cas file from /usr/local/doc/ANSYS.

; Read case file

rc flow-serial.cas

; Initialize the solution

/solve/initialize/initialize-flow

; Calculate 50 iterations

it 50

; Write data file

wd example50.dat

; Calculate another 50 iterations

it 50

; Write another data file

wd example100.dat

; Exit FLUENT

exit

yes

(Note: rc => /read/case;  wd->/file/write-data; it=>/solve/iterate are the aliases for ANSYS commands; make sure the aliases exist else use the complete command; /solve/initialize/initialize-flow; ; is a comment)

Copy the content in fluent-serial.slurm file

#SBATCH --time=2:10:00

#SBATCH -N 1 -n 1

module load ansys

cp flowinput-serial.in flow-serial.cas $PFSDIR

cd $PFSDIR

#Run fluent

fluent 2ddp -g < flowinput-serial.in

cp -ru * $SLURM_SUBMIT_DIR

Submit the serial job

sbatch fluent-serial.slurm

Parallel Job

Follow the same procedures as in Serial Job, except choosing Processing Option as Parallel and Number of Processor as n (e.g 2). Also name the journal file as flow-parallel.cas to separate it from serial one. Copy the content of the file, flowinput-parallel.in (same as the serial version).

; Read case file

rc flow-parallel.cas

; Initialize the solution

/solve/initialize/initialize-flow

; Calculate 50 iterations

it 50

; Write data file

wd example50.dat

; Calculate another 50 iterations

it 50

; Write another data file

wd example100.dat

; Exit FLUENT

exit

yes

Copy the content in fluent-parallel.slurm file

#SBATCH --time=2:10:00

#SBATCH -N 1 -n 2

module load ansys

NPROCS=$(( $SLURM_NNODES * $SLURM_CPUS_PER_TASK ))

PBS_NODEFILE=`generate_pbs_nodefile`

cp flowinput-parallel.in flow-parallel.cas $PFSDIR

cd $PFSDIR

#Run fluent

fluent 2ddp -t${NPROCS} -p -cnf=$PBS_NODEFILE -g < flowinput-parallel.in

cp * $PBS_O_WORKDIR

cd $PBS_O_WORKDIR

(Note:  In this script, #SBATCH -n 1 -n 2 indicates that you have requested 2 processors; the same number used while creating .cas file interactively)

Submit Parallel job

sbatch fluent-parallel.slurm

Licensing

Refer to HPC Licences Guide for ANSYS licenses.

Output: Info about the packages, number of licenses, and checked out licenses:

...

Users of aa_mcad:  (Total of 26 licenses issued;  Total of 0 licenses in use)

Users of aa_t_i:  (Total of 25 licenses issued;  Total of 0 licenses in use)

Users of aa_ds:  (Total of 25 licenses issued;  Total of 0 licenses in use)

Performance

Some investigation has shown that improved FLUENT performance can be gained for parallel jobs, at least in some cases, by minimizing the number of nodes used through the use of multicore processors. Prior to extensive use of FLUENT for a large number of similar long-running jobs, some experimentation should be carried out to determine the best type of node(s) to use.

Troubleshooting/Improving Graphical Performance

If you are running blocking steps of Icemcfd, the performance is many times faster if one goes to Settings > Display > Uncheck "Use Native Display List" 

That might be worth adding to the ANSYS/Fluent basic instructions page whenever it happens to be updated. With that change the speed is very good and works for the interactive blocking steps.

Refer to HPC Guide to Finite Element Methods & Analysis and HPC Software Guide for more information.

References: