|
[Sponsors] |
December 6, 2012, 10:57 |
plot of residuals
|
#1 |
Member
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14 |
Hi
I am solving a set of equations which are coupled with he (U, V) momentum. The equations are solved in an implicit manner, i.e. in each time step all the equations are solved couple of times (~ 18). So, as you might expect, for each time step my final log file includes residuals at all the the iterations (~18 residual for each time step). Do you have any idea how I can filter this file to get the final residuals at each time step? |
|
December 6, 2012, 14:01 |
|
#2 |
Member
M Mallikarjuna Reddy
Join Date: Jul 2012
Posts: 91
Rep Power: 14 |
Hi,
Just Follow the steps: step1. start calculation and make it write out a log-file. e.g: icoFoam > log & step2: If desired you can open a new console window of the main case folder (when your case is runniong) and Follow the text -output by the command tail -f log To stop reading the file constantly just use ctrl-c step3: By using gnuplot with in the main case folder you have to put a text file with a name "Residuals" having 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- then you can get residuals plot. Cheers Mallikarjuna |
|
December 6, 2012, 18:09 |
|
#3 |
Member
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14 |
mmkr825
Thanks for your answer, but I have already tried it. It gives me a plot of all the residuals and not the plot of final residual (residual of the final iteration) at each time step. |
|
December 7, 2012, 07:51 |
|
#4 |
Senior Member
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 23 |
Dear Mahdi,
You can run $ foamLog log which creates a new directory 'logs' in which you can find all residuals (initial, final, etc.) in separate files for all variables. You can make a plot of the residuals in function of the iteration number or in function of the simulated time. Suppose you want to make a plot of the final residual of Ux, the gnuplot command will look like: * In function of the simulated time: Code:
plot 'UxFinalRes_0' u 1:2 w l Code:
plot 'UxFinalRes_0' u 0:2 w l Kind regards, L |
|
December 7, 2012, 08:54 |
|
#5 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
You can also use pyFoam: http://openfoamwiki.net/index.php/Co...mPlotRunner.py
|
|
December 7, 2012, 10:05 |
|
#6 |
Member
,...
Join Date: Apr 2011
Posts: 92
Rep Power: 14 |
Dear Lieven
Thanks for your wonderful comments. I will try it very soon. The reason that I want to see this plot is that, in my final velocity contours, I have some flow into the wall, which I defiantly because of relatively low residuals (Right???). So, I want to see these plots to make sure my solution has acceptable level of convergence. If you have better ideas, i would love to hear. Mahdi, |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Tutorials] Tutorial of how to plot residuals ! | wolle1982 | OpenFOAM Community Contributions | 172 | December 6, 2024 07:20 |
plot residuals in multiregion solver | val46 | OpenFOAM | 4 | December 12, 2016 07:06 |
Residuals Plot | kamalipour | FLUENT | 2 | December 15, 2011 04:44 |
URGENT: plot residuals for complete simulation?? | Khan | FLUENT | 1 | February 1, 2007 13:35 |
residuals | Karl | CFX | 2 | June 25, 2003 00:13 |