![Diff](/lib/images/diff.png)
Approvals: 0/1
This is an old revision of the document!
ANSYS-Fluent (CFD)
Module
Check available versions of Ansys:
module avail 2>&1 | grep -i Ansys
Load the correct version of Ansys, e.g.,
module load *your preferred module*
available modules on VSC-4:
- ANSYS/2019R3
- ANSYS/2020R2
- ANSYS/2021R1
General Workflow
Pre- & postprocessing on local machine and computation on VSC
The subsequent figure shows an overview of the general workflow if you use Fluent on your local machine for pre- and postprocessing and the cluster for solving your case, respectively.
For this workflow a graphical connection isn't necessary.
All files needed for this testcase are provided here: fluent_testcase.zip
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:
# ----------------------------------------------------------- # 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 *.dat file every 10 iterations.
But preferably do this settings in the GUI as shown in subsequent graphic.
Keep in mind to set the appropriate path for the cluster. Here the files will be saved in the same directory as the journal file is located. It could be better for the sake of clarity to create a additional directory for this backupfiles, i.e.
./Autosave/*your_filename*.gz
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 --ntasks-per-node=24 #SBATCH --threads-per-core=1 #SBATCH --time=04:00:00 module purge module load *your preferred module* 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
This job script allows a variable definition of desired configuration. You can manipulate the number of compute nodes very easily and the job script generates the appropriate command to start the calculation with Fluent.
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
Submit job
sbatch fluent_run.sh
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 solve/init/initialize-flow solve/iterate 500 file/write-data "MyCase.dat.gz" exit yes