Files
OpenFOAM-12/tutorials/modules/CHT/wallBoiling/validation/createGraphs
Henry Weller 4d900cfae3 tutorials/modules/CHT/wallBoiling: CHT version of the Euler-Euler wall-boiling case
Supersedes and replaces the tutorials/modules/multiphaseEuler/wallBoiling case
as it is more physical and representative of a real case.

Patch contributed by Juho Peltola, VTT.
2022-11-16 18:40:28 +00:00

74 lines
2.4 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
graphFile=$(foamListTimes -latestTime)/line.xy
surfaceFile=$(cd postProcessing/fluid/inflow && ls -1tr */* | tail -n 1)
gnuplot<<EOF
set terminal postscript eps size 8,9 color enhanced font "Helvetica,20"
set output "./validation/$(basename "$PWD").eps"
set multiplot layout 2,2
set decimalsign '.'
set grid
A = 0.000586423
q = 73890
set key at graph 0.65,0.95
set xlabel 'Radial coordinate, r/R (-)'
set xrange [0:1]
set ylabel 'Void fraction (-)'
plot \
"postProcessing/fluid/graph/$graphFile" \
u (\$1/0.0096):2 w lp lt 1 t 'Simulation', \
'./validation/exptData/vof_deb1.txt' \
u 1:2 w p lt rgb "black" pt 4 t 'Experiment'
set ylabel 'Liquid temperature (K)'
plot \
"postProcessing/fluid/graph/$graphFile" \
u (\$1/0.0096):3 w lp lt 1 t 'Simulation', \
'./validation/exptData/T_deb1.txt' \
u 1:2 w p lt rgb "black" pt 4 t 'Experiment'
set key at graph 0.99,0.95
set xlabel 'Time (s)'
set xrange [0.5:10]
set ylabel 'Mass in- and outflow (kg/s)'
set yrange [0.5:0.8]
plot \
'./postProcessing/fluid/inflow/$surfaceFile' \
every ::4::20000 u 1:(-1*360*\$3) w l lt 1 t 'liquid inflow', \
'./postProcessing/fluid/outflow/$surfaceFile' \
every ::4::20000 u 1:(360*\$3) w l lt 3 t 'liquid outflow', \
'./postProcessing/fluid/outflow/$surfaceFile' \
every ::4::20000 u 1:(360*\$2+360*\$3) w l lt 4 t 'liquid + vapor outflow'
set ylabel 'Enthalpy in- and outflow (J/s)'
set yrange [1.5e5:2.0e5]
plot \
'./postProcessing/fluid/inletLiquid/$surfaceFile' \
every ::4::20000 u 1:(-1*360*\$2) w l lt 1 t 'liquid inflow', \
'./postProcessing/fluid/inletLiquid/$surfaceFile' \
every ::4::20000 u 1:(-1*360*\$2+360*A*q) w l lt 8 t 'liquid inflow + wall heat flux', \
'./postProcessing/fluid/outletLiquid/$surfaceFile' \
every ::4::20000 u 1:(360*\$2) w l lt 3 t 'liquid outflow', \
"<paste \
./postProcessing/fluid/outletLiquid/$surfaceFile \
./postProcessing/fluid/outletGas/$surfaceFile" \
every ::4::20000 u 1:(360*\$2+360*\$4) w l lt 4 t 'liquid + vapor outflow'
unset multiplot
EOF
#------------------------------------------------------------------------------