跳到主要内容
版本:FCP 24.11

Fluent

parameters:
- name: version
display: 版本
type: enum
required: true
option:
enum:
- value: 2021
display: 2021
- value: 2023
display: 2023
- name: input_file
display: 输入控制文件(*.jou)
type: path
required: true
- name: include_file
display: 输入模型文件(*.cas)
type: path
required: true
- name: resolve_type
display: 求解类型
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: 任务并发数并发数
type: int
required: true
usage: SCHEDULER
schedPrefix: -n
outputs:
- path: taskout.log
type: TEXT
script: |-
#!/bin/bash

set -ex

# 设置license环境变量
export ANSYSLMD_LICENSE_FILE=27005@10.105.1.10

# 应用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}