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:
Ansys Workbench (general workflow manager)
Ansys Fluent (Main, NOx, Continuous Fiber Module, MHD, and Population Balance except Fuel Cell Module and Polyflow)
Ansys CFX (CFX-Pre, CFX-Solver Manager, CFD-Post, except Turbo Grid)
Ansys CFD-Post is the post-processor for CFX and Fluent
ICEM CFD (Meshing, Export) - ensure that you are using Teaching Advanced license (check the license using "lic 1055@smaster")
Important Notes
Ansys/Fluent is a licensed Software. To request for the license, email hpc-supportATcase.edu
For license quota and package information, visit Licensing section
For Academic License, there is a menu option under Tools -> License Preferences, where you can select the priority on which license to use. Move up the "Teaching Advanced" to the top - press apply/ok
Go through the ANSYS/FLUENT documentation carefully, you may get into segmentation fault if not properly implemented
X-Forwarding is necessary to get the graphics interface. For intensive GUI application, refer to HPC Visual Access to get quicker response time
There seems to be a conflict using XQuartz for MAC users. Use OnDemand Interactive App described at HPC Guide to OpenOnDemand
If you are unable to start the Geometry Editor, please execute unset SLURM_GTIDS first
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)
Choose Dimension 2D and Processing Options as Serial; press "Start"
In the GUI page, click on File Menu ->Read->Mesh… and choose flow.msh from the Files list and Ok. Under General, click on the Display. You will see the pipe diagram in the display window
You may want to set different configuration, but in this example, we have chosen the default settings
Click on Solution->Initialization and click on Initialize button (again you may want to change initial values)
Click on Solution->Run Calculation and then click on Calculate button
You will see the calculation complete dialog box; click OK
Click on File->write->Case… and name the file flow-serial.cas.hd5 and click OK
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:
During the installation, the software would prompt for the license location, please use port 1055 with server: smaster.case.edu
Once the installation is completed, please reboot the computer
Add the environment variable by: Right-click My Computer, select Properties
Click Advanced System Settings -> Environment Variables
In the User variables tab, add the following:
Variable Name: LM_LICENSE_FILE
Variable Value: 1055@smaster.case.edu
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:
Tutorial: Please find the example tutorial here