Skip to main content
Version: FCP 25.11

Fluent

parameters:
- name: version
display: Version
type: enum
required: true
option:
enum:
- value: 2021
display: 2021
- value: 2023
display: 2023
- name: input_file
display: Input Control File (`*.jou`)
type: path
required: true
- name: include_file
display: Input Model File (`*.cas`)
type: path
required: true
- name: resolve_type
display: Solver Type
type: enum
required: true
option:
enum:
- value: 2d
display: 2d
- value: 3d
display: 3d
- value: 2ddp
display: 2ddp
- value: 3ddp
display: 3ddp
- name: np
display: Number of Tasks
type: int
required: true
usage: SCHEDULER
schedPrefix: -n
outputs:
- path: taskout.log
type: TEXT
script: |-
#!/bin/bash

set -ex

# Set the license environment variable
export ANSYSLMD_LICENSE_FILE=27005@10.105.1.10

# Absolute path of the application command
NODELIST=/fastone/softwares/nodelist
LOGFILE=taskout.log

case {{ version }} in

2020)
AppFolder=""
;;
2021)
AppFolder="/fastone/softwares/ansys/ansys/2021/ansys_inc/v211/fluent/bin"
;;
2022)
AppFolder=""
;;
2023)
AppFolder="/fastone/softwares/ansys/ansys/2023/ansys_inc/v232/fluent/bin"
;;
*)
echo "ERROR: Unsupported versions"
exit 1
;;
esac


if [ -z {{ input_file }} ]; then
echo "ERROR: missing input"
exit 1
else
cp {{ input_file }} .
INPUT=$(basename {{ input_file }})
fi

if [ -z {{ resolve_type }} ]; then
echo "ERROR: missing resolver"
exit 1
fi

if [ -n {{ include_file }} ];then
cp {{ include_file }} .
fi

# run in MPP mode with machines
{{ "TOTAL_NPROC=$(expr $(${NODELIST} --delim ' + ' --format '{{.Cpu}}'))" }}

# override home directory
export HOME=$PWD

HOSTFILE=.mpihosts

{{ "${NODELIST} -delim '\n' -format '{{.Host}}:{{.Cpu}}' > $HOSTFILE" }}

echo | ${AppFolder}/fluent -ssh -mpi=intel -cnf=${HOSTFILE} -t${TOTAL_NPROC} -gu {{ resolve_type }} -i ${INPUT} $* >> ${LOGFILE}