User Tools

Site Tools


howto:su2

Running the open-source code SU2 on the CHPC system

Introduction

Please refer to the SU2 home page for more information on SU2, an open-source code targeted at aerodynamics and adjoint shape development. The current version of the code is 4.1.0, and has been installed in '/apps/chpc/compmech/CFD/SU2'.

Sample PBS script

When running in an interactive environment, SU2 makes use of python scripting to automate tasks. For cluster running, it is necessary to qsub a PBS script. This example executes the classic Onera M6 transonic wing example from the TestCases/euler/oneram6 directory.

runSU2.qsub
#!/bin/bash 
# This example script requests 3 nodes of the cluster, each with 24 processor cores
#PBS -P projectid
#PBS -l select=3:ncpus=24:mpiprocs=24:mem=12GB:nodetype=haswell_reg
#PBS -q normal
#PBS -l walltime=01:00:00
#PBS -o /home/username/scratch/foamJobs/job01/stdout
#PBS -e /home/username/scratch/foamJobs/job01/stderr
#PBS -m abe
#PBS -M user@wherever.co.za
#### Setup environment for SU2
module add chpc/compmech/SU2/6.0 
# The -d option used with moab no longer works.  Set this environment variable explicitly.
export PBS_JOBDIR=/export/home/user/SU2/TestCases/euler/oneram6
# Explicitly change to the job directory
cd $PBS_JOBDIR
nproc=`cat $PBS_NODEFILE | wc -l`
### Run the SU2_CFD solver
mpirun -np $nproc -machinefile $PBS_NODEFILE SU2_CFD inv_ONERAM6_JST.cfg > SU2_CFD.out
### Check to see if the solution_flow.dat file exists.  If it does, 
###  use it to generate the necessary output files.  If it doesn't, 
###  copy the restart file to solution_flow.dat and generate the output.
### Make sure that these two file names are consistent with what you have 
###  used in the .cfg file for the run.
if [ ! -e solution_flow.dat ] ;
 then
  cp restart_flow.dat solution_flow.dat
fi
### Build the specified format output files
mpirun -np 1 -machinefile $PBS_NODEFILE SU2_SOL inv_ONERAM6_JST.cfg > SU2_SOL.out

Postprocesing

By default, the SU2 example cases write Tecplot format output files. CHPC does not have a license for Tecplot, although it is possible to read Tecplot files into Paraview. However, in the SU2 input file it is easy to specify Paraview format output files (VTK) directly. Refer to the instructions on Remote Visualization to obtain a graphics environment for post-processing with VirtualGL and Paraview or VisIt.

/var/www/wiki/data/pages/howto/su2.txt · Last modified: 2018/04/23 11:11 by agill