#!/bin/bash cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ # Turbulence closure models models=('kOmegaSST' 'SpalartAllmaras' 'kEpsilonPhitF') # Note: CFL3D data available from: # https://turbmodels.larc.nasa.gov/bump_sa.html # The CFL3D-SpalartAllmaras datasets of Cf and Cp: # Cf = https://turbmodels.larc.nasa.gov/Bump/SA/cf_bump.dat # Cp = https://turbmodels.larc.nasa.gov/Bump/SA/cp_bump.dat #------------------------------------------------------------------------------ plotCf() { declare -a resultSet=("${!1}") declare -a modelSet=("${!2}") graphNameCf="bump2D_cf.png" echo "Creating skin friction coefficient graph to $graphNameCf" gnuplot</dev/null || { echo "gnuplot not found - skipping graph creation" 1>&2 exit 1 } # Require awk command -v awk >/dev/null || { echo "awk not found - skipping graph creation" 1>&2 exit 1 } modelResults=() n=0 for model in "${models[@]}" do modelResults[$n]="${model}/profiles.dat" n=$(($n+1)) done plotCp modelResults[@] models[@] plotCf modelResults[@] models[@] fi # ------------------------------------------------------------------------------