#!/bin/bash cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ # settings # operand setups setups=" kEpsilon-neutral-stability kOmegaSST-neutral-stability " #------------------------------------------------------------------------------ plot_u_vs_z() { echo " # Plots for the ground-normal streamwise flow speed profile" setup="$1" endTime="$2" benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-Koblitz-2013/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 "" dirPlots="plots/$setup" [ -d "$dirPlots" ] || mkdir -p "$dirPlots" endTime=$(\ foamDictionary results/$setup/settings/controlDict \ -disableFunctionEntries -entry endTime -value \ ) plot_u_vs_z "$setup" "$endTime" plot_v_vs_z "$setup" "$endTime" done #------------------------------------------------------------------------------