Skip to content

Ansys

What is Ansys?

Ansys is a comprehensive finite element analysis (FEA) and computational fluid dynamics (CFD) software suite for engineering simulation. It provides tools for structural mechanics, thermal analysis, fluid dynamics, electromagnetics, and multiphysics problems across various industries.

Base Environment

Ansys is provided via the environment modules system.

Available Tools

Tool Description
MAPDL Mechanical APDL - structural FEA solver with CPU and GPU support
CFX CFD solver for fluid dynamics (CPU only)
Workbench Unified GUI interface for all Ansys tools
LS-DYNA Explicit dynamics for crash and impact simulation
Aqwa Marine and offshore hydrodynamics analysis
Autodyn Explicit dynamics solver
ACP Composite materials analysis

Typical HPC Workflow

Ansys simulations on HPC follow a three-stage workflow:

  1. Pre-processing (Local workstation recommended)

    • Create geometry
    • Generate mesh
    • Define physics and boundary conditions
    • Export solver input files (.inp, .def, etc.)
  2. Solving (HPC cluster)

    • Upload input files to PERUN
    • Submit batch jobs to CPU or GPU partitions
    • Let solvers run on high-performance hardware
  3. Post-processing (Local workstation recommended)

    • Download result files from HPC
    • Visualize and analyze in appropriate post-processor

Why Local GUI?

Using Ansys GUI locally provides:

  • Better performance (no network lag)
  • No internet connection required
  • Full graphics acceleration
  • Easier file management

Only the computationally expensive solver stage runs on HPC.

GUI Access via Workbench

Alternative: Remote GUI

You can use Workbench GUI on PERUN with X11 forwarding, but this is not recommended for regular use.

Launch Workbench (requires X11)

module load ansys/2025R2
runwb2

X11 Setup

  • Windows: Use MobaXterm (X11 automatic)
  • macOS: ssh -X username@login01.perun.tuke.sk (requires XQuartz)
  • Linux: ssh -X username@login01.perun.tuke.sk

Loading Ansys

Load module

module load ansys/2025R2

Available executables

After loading, these commands become available:

mapdl        # Mechanical APDL - structural FEA solver
cfx5solve    # CFX solver
cfx5pre      # CFX pre-processor
cfx5post     # CFX post-processor
fluent       # Fluent CFD solver
lsdyna       # LS-DYNA explicit dynamics
runwb2       # Workbench GUI
lsprepost    # LS-DYNA pre/post-processor

Getting Help for Solvers

Command-line help

Most Ansys solvers provide help through the -h or --help flag:

mapdl -h
cfx5solve -help
fluent -help

Common MAPDL parameters

Key parameters for MAPDL:

  • -b : Batch mode (no GUI)
  • -i <file> : Input file
  • -o <file> : Output file
  • -np <N> : Number of processors (must match SLURM --ntasks)
  • -acc nvidia : Enable GPU acceleration
  • -na <N> : Number of GPUs to use

Example: MAPDL Structural Analysis

Input File

simple_test.inp

Simple structural analysis

/BATCH
/PREP7
ET,1,SOLID185
MP,EX,1,2e11
MP,PRXY,1,0.3
BLOCK,0,1,0,1,0,1
ESIZE,0.5
VMESH,ALL
NSEL,S,LOC,X,0
D,ALL,ALL,0
NSEL,ALL
/SOLU
ANTYPE,STATIC
SOLVE
FINISH
/EOF

SLURM Job Script (CPU)

mapdl_cpu.sh

CPU parallel execution

#!/bin/bash
#SBATCH --job-name=mapdl_analysis
#SBATCH --partition=CPU
#SBATCH --nodes=1
#SBATCH --ntasks=8
#SBATCH --time=01:00:00
#SBATCH --output=mapdl_%j.out

module load ansys/2025R2

mapdl -b -i simple_test.inp -o output.txt -np 8

Critical: Match ntasks and -np

The -np value must exactly match --ntasks:

#SBATCH --ntasks=8
mapdl ... -np 8    # Must be the same!

Submit job

sbatch mapdl_cpu.sh

SLURM Job Script (GPU)

mapdl_gpu.sh

GPU accelerated execution

#!/bin/bash
#SBATCH --job-name=mapdl_gpu
#SBATCH --partition=GPU
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --gres=gpu:1
#SBATCH --time=01:00:00
#SBATCH --output=mapdl_gpu_%j.out

module load ansys/2025R2

mapdl -b -i simple_test.inp -o output.txt -np 1 -acc nvidia -na 1

Submit job

sbatch mapdl_gpu.sh

Output Files

Solver-dependent output

Output file formats and names depend on the solver used. The files listed below are specific to MAPDL.

File Description
*.rst Results file - contains solution data
*.db Database file - contains model definition
*.full Full file - complete model and results
*.log Log file - execution details

File Transfer

Using WinSCP (Windows)

Use WinSCP to transfer files with a graphical interface:

  1. Connect to PERUN
  2. Drag and drop files between local and remote

Using command line

Upload input files:

scp simple_test.inp username@login01.perun.tuke.sk:~/work/

Download results:

scp username@login01.perun.tuke.sk:~/work/output.rst .

More Information

Documentation

Official Ansys documentation:

https://ansyshelp.ansys.com/public