Updated 2019-08-29

Run Ansys Batch Mode


  • Ansys consists of many different products as well as many ways to run those products usin 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 -l nodes=1:ppn=8
#PBS -l pmem=4gb
#PBS -l walltime=1:00:00
#PBS -q force-6
#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


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