#!/bin/sh cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ # settings # operand setups setups=" kEpsilon kOmegaSST " # operand minimum z height zMin=0 # Note: Benchmark data is available for the standard k-epsilon model from: # Hargreaves, D. M., & Wright, N. G. (2007). # On the use of the k–ε model in commercial CFD software # to model the neutral atmospheric boundary layer. # Journal of wind engineering and # industrial aerodynamics, 95(5), 355-369. # DOI:10.1016/j.jweia.2006.08.002 # Figure 6. #------------------------------------------------------------------------------ plot_ux_vs_znorm_upstream() { echo " # Plots the ground-normal flow speed profile (upstream)" endTime="$1" zMin="$2" benchmarkFile="$FOAM_TUTORIALS/resources/dataset/atm-HargreavesWright-2007/Ux-HW-RH-Fig6a" sampleFile="results/$setup/postProcessing/samples_u/$endTime" image="plots/$setup/ux_vs_znorm_upstream.png" gnuplot</dev/null || { echo "gnuplot 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 } #------------------------------------------------------------------------------ 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_ux_vs_znorm_upstream "$endTime" "$zMin" plot_ux_vs_znorm_middle "$endTime" "$zMin" plot_ux_vs_znorm_downstream "$endTime" "$zMin" if [ -d "results/$setup/postProcessing/samples_k" ] then plot_k_vs_znorm "$endTime" "$zMin" fi if [ -d "results/$setup/postProcessing/samples_epsilon" ] then plot_epsilon_vs_znorm "$endTime" "$zMin" fi if [ -d "results/$setup/postProcessing/samples_omega" ] then plot_omega_vs_znorm "$endTime" "$zMin" fi if [ -d "results/$setup/postProcessing/samples_nut" ] then plot_nut_vs_znorm "$endTime" "$zMin" fi done #------------------------------------------------------------------------------