Cygwin therefore OpenFOAM for Windows supports only files in Unix format (i.e. with \n for newlines as opposed to the DOS/Windows \r \n newline). If there is a problem with running script writeResiduals.sh add following line into your script just after the #! line
(set -o igncr) 2>/dev/null && set -o igncr; # this comment is required
Create new file e.g. residuals.gp:
# Gnuplot script file for plotting data from file "log"
set title "Convergence process"
set xlabel "Iterations"
set ylabel "Reziduals"
set logscale y
plot 'residualsUx.dat' title 'u', \
'residualsUy.dat' title 'v', \
'residualsUz.dat' title 'w'
pause mouse
Run writeResiduals.sh, which creates data files with residuals # bash writeResiduals.sh
Run residuals.gp, by opening the script file in gnuplot program
Figure: OpenFOAM tutorial motor bike. Velocity residuals during computation.