Mechanical / MAPDL


Ansys Mechanical is a finite element analysis (FEA) tool that enables you to analyse complex product architectures and solve difficult mechanical problems. You can use Ansys Mechanical to simulate real world behavior of components and sub-systems, and customize it to test design variations quickly and accurately. ANSYS Mechanical has interfaces to other pre and post processing packages supplied by ANSYS and can make use of built in MPI to utilize multiple cross node CPU and can scale to hundreds of cores.

Caution

ANSYS users can now use a maximum of 400 concurrent cores, across all devices on campus, including personal machines and HPC clusters, and regardless of the number of ANSYS applications they have open. Please see ANSYS license restrictions for more detail.


Module loading

After connecting to Stanage (see Establishing a SSH connection), you can start an interactive session or submit a batch job using ANSYS programs activating them and making them available with one of the module load commands below:

module load ANSYS/19.2
module load ANSYS/2022R2
module load ANSYS/2023R1
module load ANSYS/2023R2

Interactive jobs

You can load an ANSYS module above and then start the ANSYS mechanical launcher program by running the launcher command.

If desired, the ANSYS Workbench GUI executable can be launched with the runwb2 command. To use more than a single core, you should write a batch job script and ANSYS mechanical APDL script file for submission to the batch queues.


Batch jobs

MAPDL is capable of running in both MPI and SMP parallel environments but will use its in-build MPI communications for both.

Sample SMP MAPDL Scheduler Job Script

Mapdl mechanical: the following is an example batch submission script, mech_job.sh, to run the mechanical executable mapdl with input file CrankSlot_Flexible.inp, and carry out a mechanical simulation. The script requests 2 cores using the SMP parallel environment with a runtime of 60 mins and 2 GB of real memory per core.

Hint

  • The argument $SLURM_NTASKS is a SLURM scheduler variable which will return the requested number of tasks.

#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=2
#SBATCH --mem=4000
#SBATCH --job-name=ansys_mech-test
#SBATCH --output=output_ansys_mech_test
#SBATCH --time=01:00:00
#SBATCH --mail-user=a.person@sheffield.ac.uk
#SBATCH --mail-type=ALL

module load ANSYS/2023R2
mapdl -smp -dir $(pwd) -b -np $SLURM_NTASKS -j solution -i CrankSlot_Flexible.inp

The job is submitted to the queue by typing:

sbatch mech_job.sh

Sample MPI MAPDL Scheduler Job Script

Mapdl mechanical: the following is an example batch submission script, mech_job.sh, to run the mechanical executable mapdl with input file CrankSlot_Flexible.inp, and carry out a mechanical simulation. The script requests 2 cores using the MPI parallel environment with a runtime of 60 mins and 2 GB of real memory per core.

Hint

  • The argument $SLURM_NTASKS is a SLURM scheduler variable which will return the requested number of tasks.

#!/bin/bash
#SBATCH --nodes=2
#SBATCH --ntasks-per-node=1
#SBATCH --mem=2000
#SBATCH --job-name=ansys_mech-test
#SBATCH --output=output_ansys_mech_test
#SBATCH --time=01:00:00
#SBATCH --mail-user=a.person@sheffield.ac.uk
#SBATCH --mail-type=ALL

module load ANSYS/2023R2
# Create a hosts file with the allocated nodes
echo ===========================
echo List of machines supplied to Ansys Mech
machinelist=$(scontrol show hostname $SLURM_JOB_NODELIST | awk -v cpus=$SLURM_NTASKS_PER_NODE '{printf "%s:%d:", $0, cpus}' | sed 's/:$//')
echo $machinelist
echo ===========================
mapdl -dis -mpi INTELMPI -machines $machinelist -b -scheduler_tight_coupling -pib.infinipath -i CrankSlot_Flexible.inp

The job is submitted to the queue by typing:

sbatch mech_job.sh

ANSYS Mechnical training and help resources

Important

Academic support requests should be directed to the IT Services’ Research and Innovation team or the ANSYS Learning Forum (ensure you register with your University email for priority support).

ANSYS provides numerous academic training and help resources including tutorials, video lectures and examples for structural and mechnical products. A short list of the resources ANSYS maintains is summarised below: