#!/bin/sh cd "${0%/*}" || exit # Run from this directory #------------------------------------------------------------------------------ # settings # operand setups setups=" DFSEM " #------------------------------------------------------------------------------ plot_R_vs_y() { setup="$1" endTime="$2" # benchmarkFile="ReTau-395/dataset/chan395.reystress" n=0 m=0 for l in {1..11} do m=$(($m+5)) sampleFiles[$n]="results/$setup/postProcessing/sample/$endTime/l${m}_columnAverage:columnAverage(UPrime2Mean).xy" n=$(($n+1)) done image="plots/$setup/Ruu_vs_y.png" gnuplot< [m^2/s^2]" set offset .05, .05 set output "$image" set title "Reynolds stresses on patch" # Benchmark - DNS # benchmark = "$benchmarkFile" # Samples - OpenFOAM samples="$sampleFile" plot \ samples u 1:2 t "" w l lw 2 lc rgb "#009E73", \ samples u 1:5 t "" w l lw 2 lc rgb "#F0E440", \ samples u 1:7 t "" w l lw 2 lc rgb "#0072B2", \ samples u 1:3 t "" w l lw 2 lc rgb "#D55E00" #benchmark u 1:3 t "_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \ #benchmark u 1:4 t "_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \ #benchmark u 1:5 t "_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \ #benchmark u 1:6 t "_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00" PLT_R_PATCH } plot_R_cell() { setup="$1" endTime="$2" # benchmarkFile="ReTau-395/dataset/chan395.reystress" sampleFile="results/$setup/postProcessing/sample/$endTime/inletCell_columnAverage:columnAverage(UPrime2Mean).xy" image="plots/$setup/R_cell.png" gnuplot< [m^2/s^2]" set offset .05, .05 set output "$image" set title "Reynolds stresses on cell" # Benchmark - DNS # benchmark = "$benchmarkFile" # Samples - OpenFOAM samples="$sampleFile" plot \ samples u 1:2 t "" w l lw 2 lc rgb "#009E73", \ samples u 1:5 t "" w l lw 2 lc rgb "#F0E440", \ samples u 1:7 t "" w l lw 2 lc rgb "#0072B2", \ samples u 1:3 t "" w l lw 2 lc rgb "#D55E00" #benchmark u 1:3 t "_{DNS}" w l lw 2 dt 2 lc rgb "#009E73", \ #benchmark u 1:4 t "_{DNS}" w l lw 2 dt 2 lc rgb "#F0E440", \ #benchmark u 1:5 t "_{DNS}" w l lw 2 dt 2 lc rgb "#0072B2", \ #benchmark u 1:6 t "_{DNS}" w l lw 2 dt 2 lc rgb "#D55E00" PLT_R_CELL } #------------------------------------------------------------------------------ # Require gnuplot command -v gnuplot >/dev/null || { echo "gnuplot not found - skipping graph creation" 1>&2 exit 1 } # Check directory: "results" [ -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" # few manipulations endTime=$(foamDictionary results/$setup/settings/controlDict -entry endTime -value) nu=$(foamDictionary results/$setup/settings/transportProperties -entry nu | sed 's|^.*\s\(.*\);|\1|g') plot_yPlus_vs_u "$setup" "$endTime" "$nu" plot_yPlus_vs_R_patch "$setup" "$endTime" "$nu" plot_yPlus_vs_R_cell "$setup" "$endTime" "$nu" plot_R_patch "$setup" "$endTime" plot_R_cell "$setup" "$endTime" plot_R_vs_y "$setup" "$endTime" plot_U_vs_y "$setup" "$endTime" plot_x_vs_cf "$setup" "$endTime" done #------------------------------------------------------------------------------