CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Plotting residual in OpenFoam (http://www.cfd-online.com/Forums/openfoam-post-processing/113841-plotting-residual-openfoam.html)

andrei.cimpoeru February 27, 2013 14:20

Plotting residual in OpenFoam
 
Has anyone any idea how to plot the residuals in OpenFoam from a >.log file ?

Many thanks

Andrei

cutter February 27, 2013 15:58

Hi,

you could try pyFoamPlotWatcher.py from the PyFoam utilities.

cutter

sasanghomi February 27, 2013 16:18

Hi ,

Copy the code in a txt file and set it in the case directory,
Code:

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

gnuplot Residuals -

Now type (in the terminal):
Code:

gnuplot residual
It needs gnuplot ...

Sasan.

Bernhard February 28, 2013 07:08

Quote:

Originally Posted by andrei.cimpoeru (Post 410519)
Has anyone any idea how to plot the residuals in OpenFoam from a >.log file ?

The foamLog utility is designed for it. It will extract the residuals and put them in different files.

andrei.cimpoeru February 28, 2013 07:13

I used the foamLog and I have the files I used excel package which comes with ubuntu 11.10 but i want to something which is automatically ........

Bernhard February 28, 2013 07:15

Then you should dig into the first answer you got.

wyldckat February 28, 2013 08:24

Quick answer: http://www.cfd-online.com/Forums/ope...residuals.html

wernsen March 1, 2013 08:00

pyFoamPlot... is the best to do this job ad its simple too!

Jackie Chen October 24, 2013 06:31

Quote:

Originally Posted by wernsen (Post 410874)
pyFoamPlot... is the best to do this job ad its simple too!

no command found. is this a valid command?thanks

eysteinn October 24, 2013 06:45

Quote:

Originally Posted by Jackie Chen (Post 458743)
no command found. is this a valid command?thanks

You need to install pyFoam:
http://openfoamwiki.net/index.php/Contrib_PyFoam


All times are GMT -4. The time now is 04:45.