Files
OpenFOAM-12/tutorials/multiphaseEuler/bubblePipe/validation/createGraphs
Will Bainbridge 303e3d1f60 tutorials: Consistency of All* scripts
Various minor changes to tutorial scripts. In particular, ensuring that
they all change to the containing directory so that batches of tutorials
can be run easily from the root of the installation.
2024-06-28 14:31:05 +01:00

51 lines
1.6 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
time=$(foamListTimes -case .. -latestTime)
graphFile=../postProcessing/graph/$time/line.xy
gnuplot<<EOF
set terminal postscript eps color enhanced font "Helvetica,20"
set output '../void_fraction.eps'
set xlabel 'r (mm)'
set ylabel '{/Symbol a} (-)'
plot "$graphFile" u (\$1*1000):4 w l lw 3 lc rgb 'black' t 'total',\
"$graphFile" u (\$1*1000):2 w l lw 2 lc rgb 'green' t 'd < 5.5mm',\
"$graphFile" u (\$1*1000):3 w l lw 2 lc rgb 'red' t 'd > 5.5mm'
set output '../nonDragForces.eps'
set ylabel 'F_{r} (N/m^3)'
plot "$graphFile" u (\$1*1000):(-\$5) w l lw 2 t 'Lift',\
"$graphFile" u (\$1*1000):(-\$8) w l lw 2 t 'Wall lubrication',\
"$graphFile" u (\$1*1000):(-\$11) w l lw 2 t 'Turbulent dispersion'
EOF
injectionFile=../postProcessing/probabilityDensity.injection/$time/probabilityDensity.injection.xy
outletFile=../postProcessing/probabilityDensity.outlet/$time/probabilityDensity.outlet.xy
gnuplot<<EOF
set terminal postscript eps color enhanced font "Helvetica,20"
set output '../volumeDensity.eps'
set xlabel 'd (mm)'
set ylabel '({/Symbol a}/{/Symbol a}_{tot})/{/Symbol D}d (mm^{-1})'
set xtics 1
plot "$injectionFile" u (\$1/1e-3):(\$2/1e3) w histeps lw 3 lc rgb 'green' t 'injection',\
"$outletFile" u (\$1/1e-3):(\$2/1e3) w histeps lw 3 lc rgb 'red' t 'outlet'
EOF
#------------------------------------------------------------------------------