ANSYS

Description

ANSYS is a suite of computational simulation programs for engineering, including fluid simulation (CFD), structural analysis, heat transfer, electromagnetism and more.

Available Versions

  • ansys/2025R2/fluids (default)

  • ansys/2025R2/structures

Components

  • fluids: ANSYS Fluent, CFX for computational fluid dynamics

  • structures: ANSYS Mechanical, APDL for structural analysis

Environment Setup

When loading the module, the following variables are defined:

module load ansys/2025R2/fluids
echo $ANSYS_ROOT      # Installation directory
echo $KMP_AFFINITY    # Disabled to ensure CPU affinity

Job Submission with ANSYS Fluent (MPI)

submit_fluent_mpi.sh
#!/bin/bash
#SBATCH -J fluent
#SBATCH -N 4
#SBATCH --ntasks-per-node=28
#SBATCH -t 72:00:00
#SBATCH --mem-per-cpu=4G

export INPUT="case.cas data.dat"
export OUTPUT="results/"

module load ansys/2025R2/fluids

# Total number of processes
NP=$SLURM_NTASKS

job-nanny $ANSYS_ROOT/v252/fluent/bin/fluent 3ddp -g -t$NP -i journal.jou > fluent.out

Example Journal File for Fluent

journal.jou
; Read case and data
rc case.cas
rd data.dat

; Initialize and iterate
/solve/initialize/initialize-flow
/solve/iterate 1000

; Write results
wcd results.cas
wcd results.dat

; Exit
exit yes

Job Submission with ANSYS Mechanical (APDL)

submit_mechanical.sh
#!/bin/bash
#SBATCH -J mechanical
#SBATCH -N 2
#SBATCH --ntasks-per-node=28
#SBATCH -t 48:00:00
#SBATCH --mem-per-cpu=4G

export INPUT="input.dat"
export OUTPUT="output.out"

module load ansys/2025R2/structures

NP=$SLURM_NTASKS

job-nanny $ANSYS_ROOT/v252/ansys/bin/ansys252 -b -dis -p ansys -np $NP -dir $PWD -j job_name -s read -l en-us -b -i input.dat -o output.out

Example APDL Input File

input.dat
/BATCH
/TITLE, Structural Analysis

! Parameters
length = 10
height = 1
thickness = 0.1
load = 1000

! Pre-processing
/PREP7
ET,1,BEAM188
MP,EX,1,2.1e11
MP,PRXY,1,0.3
SECTYPE,1,BEAM,RECT
SECDATA,height,thickness

! Geometry
K,1,0,0,0
K,2,length,0,0
L,1,2

! Mesh
LESIZE,ALL,,,10
LMESH,ALL

! Boundary conditions
DK,1,UX,0
DK,1,UY,0
DK,1,UZ,0
DK,1,ROTX,0
DK,1,ROTY,0
DK,1,ROTZ,0

! Apply load
FK,2,FY,-load

! Solution
/SOLU
ANTYPE,STATIC
SOLVE
FINISH

! Post-processing
/POST1
PRDISP
PRRSOL
FINISH

Job Submission with CFX

submit_cfx.sh
#!/bin/bash
#SBATCH -J cfx
#SBATCH -N 2
#SBATCH --ntasks-per-node=28
#SBATCH -t 48:00:00
#SBATCH --mem-per-cpu=4G

export INPUT="case.def"
export OUTPUT="result.res"

module load ansys/2025R2/fluids

NP=$SLURM_NTASKS

job-nanny $ANSYS_ROOT/v252/CFX/bin/cfx5solve -def case.def -part $NP -double > cfx.out

References

See also