#!/bin/sh cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions #------------------------------------------------------------------------------ # Postprocess according to the existence of "epsilon" or "omega" baseEpsilonOrOmega="epsilon" # options: "epsilon", "omega". # 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. #------------------------------------------------------------------------------ plotUxUpstream() { timeDir=$1 zMin=$2 echo " Plotting the ground-normal flow speed profile (upstream)." outName="plots/Ux_upstream.png" gnuplot</dev/null || { echo "gnuplot not found - skipping graph creation" 1>&2 exit 1 } # The latestTime in postProcessing/samples timeDir=$(foamListTimes -case postProcessing/samples -latestTime 2>/dev/null) [ -n "$timeDir" ] || { echo "No postProcessing/samples found - skipping graph creation" 1>&2 exit 2 } timeDir="postProcessing/samples/$timeDir" zMin=0 mkdir -p plots # Postprocess flow speed plotUxUpstream $timeDir $zMin plotUxMid $timeDir $zMin plotUxDownstream $timeDir $zMin # Postprocess turbulence quantities if [ $baseEpsilonOrOmega == "epsilon" ] then items="epsilon_k_nut" plotEpsilon $timeDir $items $zMin plotK $timeDir $items 3 $zMin plotMut $timeDir $items 4 $zMin elif [ $baseEpsilonOrOmega == "omega" ] then items="k_nut_omega" plotK $timeDir $items 2 $zMin plotMut $timeDir $items 3 $zMin plotOmega $timeDir $items $zMin else echo "Chosen turbulence model is neither epsilon nor omega based." 1>&2 exit 2 fi #------------------------------------------------------------------------------