How to calculate Nusselt number and Residual plots(convergence criteria)
Title
Question
I am using buoyantBoussinesqSimpleFoam solver for natural convection problem. i got few results please help me to draw residual plots(convergence criteria and How to calculate Nusselt number ?
OpenFOAM Simulating-flow-in-a-Lid-Driven-Cavity 08-09 min 20-30 sec
Answers:
Hi Vnarayana,
There is no readymade utility for calculating Nusselt number in OpenFOAM. You would need to write out a user defined utility eg, calculateNu for calculating the Nusselt number. So you need to know the basics of how a code is written in OpenFOAM.
You can also write out a script for plotting Residuals (below). You can use Gnuplot or any other plotting software of your choice for plotting this. You need to write your solver output to a log file and then run this script ( In the same user directory ) using :
gnuplot Residuals<font face="Courier New">-
# name the script file as Residuals
</font>set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\\\\\\\\
"< cat log | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\\\\\\\\
"< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\\\\\\\\
"< cat log | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines,\\\\\\\\
"< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\\\\\\\\
"< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines
pause 1
reread
Regards
There is no readymade utility for calculating Nusselt number in OpenFOAM. You would need to write out a user defined utility eg, calculateNu for calculating the Nusselt number. So you need to know the basics of how a code is written in OpenFOAM.
You can also write out a script for plotting Residuals (below). You can use Gnuplot or any other plotting software of your choice for plotting this. You need to write your solver output to a log file and then run this script ( In the same user directory ) using :
gnuplot Residuals<font face="Courier New">-
# name the script file as Residuals
</font>set logscale y
set title "Residuals"
set ylabel 'Residual'
set xlabel 'Iteration'
plot "< cat log | grep 'Solving for Ux' | cut -d' ' -f9 | tr -d ','" title 'Ux' with lines,\\\\\\\\
"< cat log | grep 'Solving for Uy' | cut -d' ' -f9 | tr -d ','" title 'Uy' with lines,\\\\\\\\
"< cat log | grep 'Solving for Uz' | cut -d' ' -f9 | tr -d ','" title 'Uz' with lines,\\\\\\\\
"< cat log | grep 'Solving for omega' | cut -d' ' -f9 | tr -d ','" title 'omega' with lines,\\\\\\\\
"< cat log | grep 'Solving for k' | cut -d' ' -f9 | tr -d ','" title 'k' with lines,\\\\\\\\
"< cat log | grep 'Solving for p' | cut -d' ' -f9 | tr -d ','" title 'p' with lines
pause 1
reread
Regards
Login to add comment