Updated 2021-05-17

Ansys

Run Ansys Batch Mode

Overview

  • Ansys consists of many different products as well as many ways to run those products using batch mode. This guide will focus on:
    • Running the Ansys Mechanical APDL
    • Using the Mechanical APDL Launcher to run batch script

PBS Script

  • The beginning of the PBS script can be used as a template.
  • The computation part of the script (non #PBS lines) will differ
#PBS -N anyName
#PBS -A [Account]
#PBS -l nodes=1:ppn=8
#PBS -l pmem=4gb
#PBS -l walltime=1:00:00
#PBS -q inferno
#PBS -j oe
#PBS -o ansys.out

cd <dir that holds input files>

module load ansys/17.0 #or any other version

<where the ansys run lines go, differing based on what you want to run>
  • The #PBS directives are standard, requesting just 1 minute of walltime and 1 node with 4 cores. More on #PBS directives can be found in the PBS guide
  • After, the computation portion begins. You must enter the directory where you store your input files, so that ansys knows what to run
  • module load ansys/17.0 loads ansys 17.0. You can find different versions to load with module avail ansys
  • The last line is the line to run the ansys product, and will differ with what product you are running.

Ansys Mechanical APDL

  • launcher170 -runbatch - np x -dis will run .dat files in the directory specified
  • nohup ansys170 -b -p -np x -dis productvar < inputname > outputname 2>&1 &: another option to run the solver, nohup stands for no hangups and will make the job less prone to interuptions
  • For both, you must include -np x where x is the num of processors you requested in your PBS script

Using the Ansys Mechanical APDL Launcher

  • The launcher is a gui tool that allows you to put all your inputs in, and then it will run the job or generate a command for you.
  • RECOMMENDED WORKFLOW: Open launcher interactively, input all preferences including simulation environment and number of processors, then copy the command it generates and paste that in your PBS script.
  • To make it create the command, after you input your parameters, click tools > Display Command line

Screenshot

Further Resources

  • Ansys has many different option flags when running in Batch Mode
  • A good resource to get an idea of all these options can be found here
  • Also, Ansys documentation on batch runs can be found here

Run Ansys Interactively on Cluster

Overview

  • Ansys has many different options for running interactively:
    • Ansys Workbench
    • polyflow
    • cfx
    • and more
  • This guide will focus on Ansys Workbench, but will also detail how to launch some of the other products.

Screenshot

Set up Interactive (VNC) Session

  • Please see the VNC guide for instructions on how to set up the Interactive VNC session

Load Ansys

  • Open terminal in the vnc window by clicking top left Applications > System Tools > scroll down to terminal
  • All commands here on will be typed in terminal in VNC
  • To see available versions of Ansys run
module avail ansys # lists availble ansys versions
module load ansys/17.0 # loads ansys 17.0

Screenshot

Launch Ansys Products

  • To launch any Ansys product, you must have ansys loaded
  • Anytime you see the number 170 in a command, replace it with the number of whatever version you have loaded (170 corresponds to 17.0)
  • Ansys Workbench

    • runwb2: launches Ansys Workbench
    • Can use -B to run in batch mode , useful for non-interactive job
  • Mechanical APDL Solver

    • ansys170: launches Ansys Solver in the terminal
  • Mechanical APDL Launcher

    • launcher170: loads the Mechanical Apdl Launcher. The launcher allows you to set parameters and run the script using a GUI. Parameters set include number of processors, which you must set to the number you requested in the qsubturbovncserver line when you submitted the interactive job.
  • Ansys Research and CFD Utility Menu

    • launcher170 -runae: launches Research and CFD Utility menu
  • LS-DYNA Solver

    • launcher170 -rundyna will launch the LS-DYNA solver in terminal
  • Launch additional Ansys Products

    • cfdpost: launches cfdpost gui
    • cfx5: launches cfx5 gui
    • fluent: Launches fluent. Fluent guide here
    • autodyn170: must provide an input file. More likely to be used in batch mode