User Tools

Site Tools


doku:cfd

Computational Fluid Dynamics

ANSYS CFD

ANSYS CFD

Module

Check available Fluent versions:

module avail 2>&1 |grep Fluent

Load the correct version of fluent, e.g.,

module load ANSYS-Fluent/2019R3

ANSYS CFD

Input file

Create a journal file (fluent.jou) which is written in a dialect of Lisp called Scheme and contains all the instructions that are to be executed during the run. A basic form of this file, is as follows:

/opt/ohpc/pub/examples/slurm/mul/ansys

# -----------------------------------------------------------
# SAMPLE JOURNAL FILE
#
# read case file (*.cas.gz) that had previously been prepared
file/read-case "tubench1p4b.cas.gz"
file/autosave/data-frequency 10
solve/init/initialize-flow
solve/iterate 500
file/write-data "tubench1p4b.dat.gz"
exit yes

The autosave/data-frequency setting will save a data file every 10 iterations.


ANSYS CFD

ANSYS 17: Job script

A script for running Ansys/Fluent called fluent_run.sh is shown below.

#!/bin/sh
#SBATCH -J fluent
#SBATCH -N 2
#SBATCH -o job.%j.out
#SBATCH -p E5-2690v4
#SBATCH -q E5-2690v4-batch
#SBATCH --ntasks-per-node=28
#SBATCH --threads-per-core=1
#SBATCH --time=04:00:00
#SBATCH --mem=16G

module purge
module load ANSYS-Fluent/17.1

JOURNALFILE=fluent.jou

if [ $SLURM_NNODES -eq 1 ]; then
    # Single node with shared memory
    fluent 3ddp -g -t $SLURM_NTASKS -i $JOURNALFILE > fluent.log 
else
    # Multi-node
    fluent 3ddp  \                # call fluent with 3D double precision solver
    -g \                          # run without GUI
    -slurm -t $SLURM_NTASKS \     # run via SLURM with NTASKS
    -pinfiniband \                # use Infiniband interconnect
    -mpi=openmpi \                # use IntelMPI
    -i $JOURNALFILE > fluent.log  #input file
fi

ANSYS CFD

ANSYS 18: Job script

There are slightly different command line switch in version 18:

#!/bin/sh
#SBATCH -J fluent
#SBATCH -N 2
#SBATCH -o job.%j.out
#SBATCH -p E5-2690v4
#SBATCH -q E5-2690v4-batch
#SBATCH --ntasks-per-node=28
#SBATCH --threads-per-core=1
#SBATCH --time=04:00:00
#SBATCH --mem=16G

module purge
module load ANSYS-Fluent/18.1

JOURNALFILE=fluent.jou

if [ $SLURM_NNODES -eq 1 ]; then
    # Single node with shared memory
    fluent 3ddp -g -t $SLURM_NTASKS -i $JOURNALFILE > fluent.log
else
    # Multi-node
    fluent 3ddp  \                # call fluent with 3D double precision solver
    -g \                          # run without GUI
    -slurm -t $SLURM_NTASKS \     # run via SLURM with NTASKS
    -pib \                        # use Infiniband interconnect
    -platform=intel \             # run on Intel processors
    -mpi=openmpi \                # use OpenMPI
    -i $JOURNALFILE > fluent.log  #input file
fi

ANSYS CFD

License server settings

These variables are defined when loading the fluent module file:

setenv       ANSYSLI_SERVERS 2325@LICENSE.SERVER
setenv       ANSYSLMD_LICENSE_FILE 1055@LICENSE.SERVER

ANSYS CFD

Submit job

sbatch fluent_run.sh

ANSYS CFD

Restarting a calculation

To restart a fluent job, you can read in the latest data file:

# read case file (*.cas.gz) that had previously been prepared
file/read-case "MyCaseFile.cas.gz"
file/read-data "MyCase_-1-00050.dat.gz"   # read latest data file and continue calculation
file/autosave/data-frequency 10
solve/init/initialize-flow
solve/iterate 500
file/write-data "MyCase.dat.gz"
exit yes

ABAQUS

ABAQUS 2016

Sample job script

/opt/ohpc/pub/examples/slurm/mul/abaqus

#!/bin/bash
#
#SBATCH -J abaqus
#SBATCH -N 2
#SBATCH -o job.%j.out
#SBATCH -p E5-2690v4
#SBATCH -q E5-2690v4-batch
#SBATCH --ntasks-per-node=8
#SBATCH --mem=16G

module purge
module load Abaqus/2016

export LM_LICENSE_FILE=<license_port>@license_server>:$LM_LICENSE_FILE

# specify some variables:
JOBNAME=My_job_name
INPUT=My_Abaqus_input.inp
SCRATCHDIR="/scratch"

# MODE can be 'mpi' or 'threads':
#MODE="threads"
MODE="mpi"

scontrol show hostname $SLURM_NODELIST | paste -d -s > hostlist
cpu=`expr $SLURM_NTASKS / $SLURM_JOB_NUM_NODES`
echo $cpu

mp_host_list="("
for i in $(cat hostlist)
do
  mp_host_list="${mp_host_list}('$i',$cpu),"
done

mp_host_list=`echo ${mp_host_list} | sed -e "s/,$/,)/"`

echo "mp_host_list=${mp_host_list}" >> abaqus_v6.env

abaqus interactive job=$JOBNAME cpus=$SLURM_NTASKS mp_mode=$MODE scratch=$SCRATCHDIR input=$INPUT

ABAQUS 2016

Checkpointing and restart

Users sometimes find that their jobs take longer than the maximaum runtime permitted by the scheduler to complete. Providing that your model does not automatically re-mesh (for example, after a fracture), you may be able to make use of Abaqus’ built-in checkpointing function.

This will create a restart file (.res file extension) from which a job that is killed can be restarted.

  1. Activate the restart feature by adding the line:
*restart, write

at the top of your input file and run your job as normal. It should produce a restart file with a .res file extension.

  1. Run the restart analysis with

abaqus job=jobName oldjob=oldjobName ...

where oldJobName is the initial input file and newJobName is a file which contains only the line:

*restart, read

ABAQUS 2016

Checkpointing and restart

Example:

INPUT: dynam.inp

JOB SCRIPT: job.sh

INPUT FOR RESTART: dynamr.inp


doku/cfd.txt · Last modified: 2020/11/06 10:03 by ir