Files
OpenFOAM-12/tutorials/modules/multiphaseEuler/hydrofoil/validation/createGraph
Will Bainbridge 9fa8b85056 tutorials: multiphaseEuler: Added hydrofoil tutorial
This serves as an example of cavitation modelling with the
multiphaseEuler module. This case also contains validation of the
pressure profile along the hydrofoil against experimental data.

Based on a case contributed by Petteri Peltonen, VTT.
2022-11-16 21:36:35 +00:00

49 lines
1.0 KiB
Bash
Executable File

#!/bin/sh
if ! which gnuplot > /dev/null 2>&1
then
echo 'gnuplot not found - skipping graph creation' >&2
exit 1
fi
lowerFile=postProcessing/hydrofoilPressure/$(foamListTimes -latestTime)/lower.xy
upperFile=postProcessing/hydrofoilPressure/$(foamListTimes -latestTime)/upper.xy
gnuplot<<EOF
\$experiment << end
0.05 -1.416
0.10 -1.400
0.20 -1.375
0.30 -1.148
0.40 -0.744
0.50 -0.695
0.60 -0.582
0.70 -0.520
0.80 -0.341
0.90 -0.108
0.50 0.040
end
set terminal postscript eps size 8,9 color enhanced font "Helvetica,20"
set output "./validation/$(basename "$PWD").eps"
set grid
c = 0.15
UInf = 5.33
pInf = 1e5
rhoInf = 998.4
set xlabel 'x/L'
set ylabel 'Cp'
plot [0:1] \
'$lowerFile' u (\$1/0.15):(2*(\$4-pInf)/(rhoInf*UInf*UInf)) w l lt 1 t 'Simulation Lower', \
'$upperFile' u (\$1/0.15):(2*(\$4-pInf)/(rhoInf*UInf*UInf)) w l lt 2 t 'Simulation Upper', \
'\$experiment' u 1:2 w p lt rgb "black" pt 4 t 'Experiment'
EOF
#------------------------------------------------------------------------------