#!/bin/bash cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ # settings # operand setups setups=" kOmegaSST SpalartAllmaras kEpsilonPhitF " # reference velocity scale Uref="69.44" # 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 #------------------------------------------------------------------------------ plot_x_vs_Cf() { Uref="$1" shift 1 setups=$@ n=0 for setup in $setups do sampleFiles[$n]="results/$setup/profiles.dat" n=$(($n+1)) done image="plots/x_vs_Cf.png" gnuplot</dev/null || { echo "gnuplot not found - skipping graph creation" 1>&2 exit 1 } # Requires awk command -v awk >/dev/null || { echo "awk not found - skipping graph creation" 1>&2 exit 1 } # Check "results" directory [ -d "results" ] || { echo "No results directory found - skipping graph creation" 1>&2 exit 1 } #------------------------------------------------------------------------------ dirPlots="plots" [ -d "$dirPlots" ] || mkdir -p "$dirPlots" echo "" echo "# Plots for the skin friction coefficient" echo "" plot_x_vs_Cf "$Uref" $setups echo "" echo "# Plots for the pressure coefficient" echo "" plot_x_vs_Cp "$Uref" $setups # ------------------------------------------------------------------------------