#!/bin/bash cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ # settings # operand setups setups=" kEpsilon kOmegaSST kL " #------------------------------------------------------------------------------ plot_u_vs_z() { echo " # Plots for the ground-normal streamwise flow speed profile" setup="$1" endTime="$2" benchmarkFile="resources/dataset/u-z-Leipzig.dat" sampleFile="results/$setup/postProcessing/sampleLines/$endTime/lineZ1_U.xy" image="plots/$setup/u_z.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 } #------------------------------------------------------------------------------ for setup in $setups do echo "" echo "# Plots for the setup: $setup" echo "" [ -d "results/$setup" ] || { echo "No results/$setup directory found - skipping graph creation" 1>&2 continue } dirPlots="plots/$setup" [ -d "$dirPlots" ] || mkdir -p "$dirPlots" endTime=$(\ foamDictionary results/$setup/system/controlDict \ -disableFunctionEntries -entry endTime -value \ ) plot_u_vs_z "$setup" "$endTime" plot_v_vs_z "$setup" "$endTime" done #------------------------------------------------------------------------------