#!/bin/sh #------------------------------------------------------------------------------ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | www.openfoam.com # \\/ M anipulation | #------------------------------------------------------------------------------- # Copyright (C) 2011-2016 OpenFOAM Foundation # Copyright (C) 2021 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, distributed under GPL-3.0-or-later. # # Script # plot # # Description # Creates .png graphs of OpenFOAM results vs experiment for the buoyant # cavity case # #------------------------------------------------------------------------------ cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ # settings # stop on first error set -e #------------------------------------------------------------------------------ plot_x_vs_T_U() { index="$1" sampleFile="$2" benchmarkDir="$3" gnuplot</dev/null || { echo "FOAM FATAL ERROR: gnuplot not found - skipping graph creation" 1>&2 exit 1 } SETSDIR="../postProcessing/sample" [ -d "$SETSDIR" ] || { echo "FOAM FATAL ERROR: result sets not available in directory $SETSDIR" 1>&2 exit 1 } #------------------------------------------------------------------------------ echo "" echo "# Plot:" echo "" # paths to data LATESTTIME=$(ls $SETSDIR) OFDATAROOT="$SETSDIR/$LATESTTIME" EXPTDATAROOT=./exptData # generate temperature and velocity profiles set="1 3 4 5 6 7 9" for i in $set do echo " processing temperature and velocity profiles at y/yMax of 0.$i" OF="$OFDATAROOT/y0.${i}_T_U.xy" plot_x_vs_T_U "$i" "$OF" "$EXPTDATAROOT" done echo "End" #------------------------------------------------------------------------------