|
[Sponsors] |
November 17, 2009, 00:18 |
Plotting Residuals
|
#1 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi foamers
I have some problem with residual plotting in OF. I don't know how can I plot residuals that I have saved in log file? Can any one help me? Thanks Ata |
|
November 17, 2009, 01:27 |
Plotting Residuals
|
#2 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi
Thanks I got it. Ata |
|
November 17, 2009, 09:18 |
|
#3 |
Senior Member
Suresh kumar Kannan
Join Date: Mar 2009
Location: Luxembourg, Luxembourg, Luxembourg
Posts: 129
Rep Power: 17 |
Hello ,
to plot the residuals you have to first run the foamLog script on your log file, if you are using OF-1.5 just run FoamLog logfile it will produce a directory of name logs/. This will contain all the files you need for plotting. Use simple gnuplot script to plot the values. If you are running a unsteady calculation then you can plot the final residuals files against the times to verify if your equation is converged at all time steps. bye hope this helps K.Suresh kumar |
|
November 17, 2009, 10:52 |
|
#4 |
Senior Member
|
you can use pyfoam for a couple of nice features like plotting residuals
http://openfoamwiki.net/index.php/Co...mPlotRunner.py grettings elvis |
|
November 29, 2009, 02:20 |
Plotting Residuals
|
#5 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi every one
When I try to plot residuals with gnuplot I got this error: 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 ^ "Residuals", line 10: warning: Skipping data file with no valid points 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 ^ "Residuals", line 10: warning: Skipping data file with no valid points 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 ^ "Residuals", line 10: warning: Skipping data file with no valid points 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 Can any body help me? Regards Ata |
|
November 29, 2009, 02:22 |
Plotting Residuals
|
#6 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Elvis
Thank you Can you send me some tutorial. Thanks Ata |
|
November 29, 2009, 12:55 |
|
#7 |
Member
Marta Lazzarin
Join Date: Jun 2009
Location: Italy
Posts: 71
Rep Power: 17 |
Hi ata,
I found this piece of advice last month when i needed to find out how to plot the residuals of a simulation. It is taken from another section of this forum, I followed this steps and I managed to plot the residuals, so I think it can help you too. Tutorial on "How to plot the residuals (and forces) graphically on screen on-the-fly" Step 1: Start the calculation and make it write out a log-file. for example turbFoam >log"log" is the name of the log-file to be output. It is written into the main-case-folder. Step 2: If desired you can open a new console-window of the main-case-folder and follow the text-output by the command tail -f log"log" is the name of the log-file to be read in. To stop reading the file constantly just use Crtl+C Step 3: To plot the residuals graphically on the screen you can use gnuplot that is delivered with linux already. Within the main-case-folder you have to put a text file with a name e.g. "Residuals" (also see attachments). The file should contain the following gnuplot properties: set logscale yThe pause-command sets the seconds till reload. Deletion makes it faster in some cases. Execute the command gnuplot Residuals -in the main-case-folder. This way I did not have any errors by gnu plot, maybe it could help you too. Marta |
|
November 29, 2009, 14:05 |
|
#8 |
Senior Member
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 323
Rep Power: 18 |
Hi Marta
Thank you very much but I already have seen this tutorial and when I try it I got that error. Best regards Ata |
|
October 29, 2010, 21:10 |
Fix for "FinalResiduals", line 8: warning:
|
#9 |
Member
|
Hi Foamers,
Using output& folder to monitor jobs and FinalResidual was giving similar errors. ------------------------------------ "FinalResiduals", line 8: warning: Skipping data file with no valid points openfoam "Final Residuals", line 8: x range is invalid ----------------------------------- By quick switch of names in the FinalResidual code to "< cat output | ... from "< cat log | ... has it working fine. Best, Lori |
|
November 23, 2010, 13:07 |
|
#10 |
New Member
Bertrand Delvaux
Join Date: Apr 2010
Posts: 29
Rep Power: 16 |
Hello Marta,
Thanks a lot for posting this kind of tutorial : makes OF life much easier! ;-) As I am not really familiar with gnuplot syntax, I was wondering what exactly we need to change in Residuals.txt in order to plot the Courant Number mean and max? Best regards, Bertrand |
|
November 23, 2010, 13:23 |
|
#11 |
New Member
Bertrand Delvaux
Join Date: Apr 2010
Posts: 29
Rep Power: 16 |
OK,
Sorry for the silly question, I'm new to Linux as well, but I just found how to deal with the syntax... |
|
July 7, 2011, 07:44 |
|
#12 | |
Member
Tibo
Join Date: Jun 2011
Posts: 68
Rep Power: 15 |
Quote:
This happens if the Residuals-file contains more terms to look for than there are in the log file (e.g. k or epsilon). Either delete the "reread" command at the end of the Residuals-file (ugly solution) or delete the lines that make gnu look for parameters that it is never going to find. Tibo |
||
July 8, 2011, 02:50 |
|
#13 | |
New Member
Joel Lehikoinen
Join Date: Jun 2011
Posts: 26
Rep Power: 15 |
Quote:
Code:
cat log | grep 'Solving for Ux' | cut -d' ' -f9 Also, if you are running some other model than k-omega the script will be unable to plot omega (naturally). And if you are running a solver with buoancy, then you need to grep p_rgh instead of p. This script is very handy, it just requires some Unix-fu to get it working. |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Tutorials] Tutorial of how to plot residuals ! | wolle1982 | OpenFOAM Community Contributions | 171 | February 20, 2024 02:55 |
what to monitor besides residuals? | franzdrs | FLUENT | 5 | March 21, 2013 03:59 |
Plotting lift and drag coefficient residuals | Tunc | Siemens | 0 | February 6, 2006 10:25 |
Convergence - scaled vs unscaled residuals | HS | FLUENT | 1 | November 7, 2005 05:45 |
Plotting residuals for solid | Julie | Siemens | 1 | October 29, 2004 06:24 |