#!/bin/sh cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ plotCellR() { timeDir=$1 echo " Plotting the normal and Reynolds stresses on cell." outName="stress-cell.png" gnuplot< [m2/s2]" set offset .05, .05 set output "$outName" set title "Normal and Reynolds stresses on cell" input = "$timeDir/inletCell_UPrime2Mean.xy" bench = "constant/pointsRdata" plot \ input u 1:2 t "" w l lw 2 lc rgb "#009E73", \ input u 1:5 t "" w l lw 2 lc rgb "#F0E440", \ input u 1:7 t "" w l lw 2 lc rgb "#0072B2", \ input u 1:3 t "" w l lw 2 lc rgb "#D55E00", \ bench u 2:4 t "_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \ bench u 2:7 t "_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \ bench u 2:9 t "_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \ bench u 2:5 t "_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00" PLT_CELL_R } plotPatchR() { timeDir=$1 echo " Plotting the normal and Reynolds stresses on inlet patch faces." outName="stress-patch.png" gnuplot< [m2/s2]" set offset .05, .05 set output "$outName" set title "Normal and Reynolds stresses on patch" input = "$timeDir/inletPatch_UPrime2Mean.xy" bench = "constant/pointsRdata" plot \ input u 1:2 t "" w l lw 2 lc rgb "#009E73", \ input u 1:5 t "" w l lw 2 lc rgb "#F0E440", \ input u 1:7 t "" w l lw 2 lc rgb "#0072B2", \ input u 1:3 t "" w l lw 2 lc rgb "#D55E00", \ bench u 2:4 t "_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \ bench u 2:7 t "_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \ bench u 2:9 t "_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \ bench u 2:5 t "_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00" PLT_PATCH_R } plotPatchUMean() { timeDir=$1 echo " Plotting the streamwise mean flow speed on inlet patch faces." outName="u-patch.png" gnuplot</dev/null || { echo "gnuplot not found - skipping graph creation" 1>&2 exit 1 } # Prepare the benchmark data cp -f constant/boundaryData/inlet/0/R constant/R cp -f constant/boundaryData/inlet/points constant/points cp -f constant/boundaryData/inlet.DFM/0/UMean constant/UMean cat constant/R | tr -d '()' > constant/Rdata cat constant/points | tr -d '()' > constant/pointsData cat constant/UMean | tr -d '()' > constant/UMeanData paste constant/pointsData constant/Rdata > constant/pointsRdata paste constant/pointsData constant/UMeanData > constant/pointsUMeanData # The latestTime in postProcessing/sampling1 timeDir=$(foamListTimes -case postProcessing/sampling1 -latestTime 2>/dev/null) [ -n "$timeDir" ] || { echo "No postProcessing/sampling1 found - skipping graph creation" 1>&2 exit 1 } timeDir="postProcessing/sampling1/$timeDir" plotCellR "$timeDir" plotPatchR "$timeDir" plotPatchUMean "$timeDir" #------------------------------------------------------------------------------