File size: 1,133 Bytes
5a600cf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #!/bin/sh
if ! which gnuplot > /dev/null 2>&1
then
echo "gnuplot not found - skipping graph creation" >&2
exit 1
fi
inletFlowRate=postProcessing/inletFlowRate/0/surfaceFieldValue.dat
lowerOutletFlowRate=postProcessing/lowerOutletFlowRate/0/surfaceFieldValue.dat
upperOutletFlowRate=postProcessing/upperOutletFlowRate/0/surfaceFieldValue.dat
gnuplot << EOF
set terminal postscript eps color enhanced
set output "flowRate.eps"
set xlabel "Time (s)"
set ylabel "Flow Rate (m^3/s)"
plot \
"$inletFlowRate" us 1:(-\$2) every 10 w p t "Inlet", \
"$lowerOutletFlowRate" us 1:2 w l t "Lower Outlet", \
"$upperOutletFlowRate" us 1:2 w l t "Upper Outlet", \
"< paste $lowerOutletFlowRate $upperOutletFlowRate" \
us 1:(\$2+\$4) w l t "Total Outlet"
EOF
gnuplot << EOF
set terminal postscript eps color enhanced
set output "error.eps"
set xlabel "Time (s)"
set ylabel "Inlet-Outlet Conservation Error (%)"
plot \
"< paste $inletFlowRate $lowerOutletFlowRate $upperOutletFlowRate" \
us 1:(100*(\$2+\$4+\$6)/\$2) w l t ''
EOF
#------------------------------------------------------------------------------
|