CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Residual plotting

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 2, 2002, 06:23
Default Often I have to filter some d
  #1
Mattijs Janssens (Mattijs)
Guest
 
Posts: n/a
Often I have to filter some data out of a Foam log file. Foam2.1 comes with a script, foamLog, which extracts data from the log file in an x-y format suitable for plotting.

foamLog root case logFile

will create a root/case/logs directory with in there all variable residuals split into separate files.

foamLog -h for more info.
  Reply With Quote

Old   September 8, 2005, 04:08
Default I would just like to add that
  #2
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 204
Rep Power: 18
hani is on a distinguished road
I would just like to add that xmgrace can plot the logs files easily. Use: Data/Import/ASCII. Choose the logs directory and remove '.dat' from the filter. Then you can plot whatever you like in the logs directory.

Håkan.
lth and mernomive like this.
hani is offline   Reply With Quote

Old   September 8, 2005, 20:50
Default Hi Hakan, Just to whet your
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Hi Hakan,

Just to whet your apetite: I've played around with it a bit and now it's runnign smoothly, about 90s per iteration on my laptop (which is no great shakes). I've got 50-ish iterations so far and it looks just fine :-) The pressure is still flapping about a bit but it's too early to really tell if that is a problem.



I'll pass over the case back to you when I get bored.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   September 9, 2005, 03:52
Default Lets's hope that it doesn't st
  #4
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 204
Rep Power: 18
hani is on a distinguished road
Lets's hope that it doesn't stop converging too soon, that the pressure also converges and that the results are steady!

Do you also use xmgrace for residual plotting, or do you have a better suggestion?

Please don't get bored. I'm not!

I was just discussing the case with other people that are also very interested in getting a solution for this case with OpenFoam, so I am not alone.

Thanks,
Håkan.
hani is offline   Reply With Quote

Old   September 9, 2005, 09:12
Default Sorry, I seem to have ended up
  #5
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Sorry, I seem to have ended up in the wrong thread...

It run over night and the residual went straight down (bored now). I'll try to set one up with the proper inlet b.c. (I was running plug flow), but if you want the case back, please E-mail me and you can have a go yourself.

The changes were minor: Gamma scheme instead of limited linear and bounded laplacian on the k-e + the AMG solver to speed things up a bit. BTW, your mesh is way too nice to need non-orthogonal correctors for SIMPLE, and it runs just fine without them.



Have fun,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   September 12, 2005, 03:16
Default To Hrvoje. We're already in
  #6
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 204
Rep Power: 18
hani is on a distinguished road
To Hrvoje.

We're already in the wrong thread, so let's continue being so. That is the problem with gathering FAQ this way - it becomes extremely unstructured.

I hope that you had a go with the correct boundary conditions, plug flow is much easier to converge (I think that even I have succeeded). In the case of plug flow I don't think that you get the same problems with unsteadiness. Do you consider the results converged with reiduals at 0.001 as you show in the plot? I am not yet really sure how OpenFoam defines the residuals.

Let's see if non-orthogonal correctors are needed when I compare with experiments. When I started doing these computations I noticed that the static pressure distribution was completely wrong (compared both to experiments and other computations). When I turned on non-orthogonal correctors the results were similar to the measurements. In that case they are really needed, but let's see.

Please have a go with the correct bc:s, and then hand back the case to me. Unfortunately you are not able to upload the files to me, so you will have to send them to me another way. Since it is only the setup files that are changed, you could perhaps paste the changes into the discussion forum, or I can give you my e-mail address. Then also tell me if you had any particular way of performing the computations (start with potentialFoam, then use simpleFoam with underrelaxation factors ??? for ??? iterations ...)

Thanks,
Håkan.
hani is offline   Reply With Quote

Old   September 12, 2005, 03:59
Default Hi, - I have sorted out the
  #7
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Hi,

- I have sorted out the boundary conditions
- initialization with potentialFoam is not needed: runs fine with normal start-up
- non-orthogonal correctors are not needed, the mesh is OK
- the convergence behaviour is fine: the residual intialilly goes straight down as expected and then...
- you have a low-frequency instability in the flow, something like a shifting recirculation on the outlet boundary or a moving (secondary?) recirculation somewhere in there. I am pretty sure this is physics rather than numerical problems. In order to investigate it further, you should run turbFoam with a reasonable time-step etc and you'll see precisely what's going on. My latest residual curve is below, note the slow and regular behaviour of residual curves at the end.



- I can kill the instability if I put crap discretisation in, which will give you a converged but dubious solution. However, my morals don't allow me to do that :-) The actual result is much more interesting and I bet if you dig into the experimental results properly, you will find something similar.

I now need my machine for other stuff so please click on my name here (to get my E-mail) and I'll hand the case back to you.

This was quite fun, I hope it was useful.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   September 12, 2005, 04:14
Default I'm glad that you enjoyed it!
  #8
Senior Member
 
Håkan Nilsson
Join Date: Mar 2009
Location: Gothenburg, Sweden
Posts: 204
Rep Power: 18
hani is on a distinguished road
I'm glad that you enjoyed it! It was very useful. I might however get back to you when I have made more tests.

I know that the physical flow is likely to be unsteady. However, I also know that many other people have produced steady results for this case, although I think that it is better if the solver shows that there is no steady solution - so it's a healthy sign of OpenFoam.

I guess that you mean that the behaviour of the residuals is more important than the absolute values? I will have to dig more into the residuals definitions later on.

I will send you an e-mail so that you can hand over the files.

Thanks,
Håkan.
hani is offline   Reply With Quote

Old   July 25, 2008, 16:42
Default Does anyone know if I can cont
  #9
Member
 
Ivan Lau
Join Date: Mar 2009
Location: Hong Kong
Posts: 56
Rep Power: 17
ivanwhlau is on a distinguished road
Does anyone know if I can continuously monitor the residual using xmgrace or other methods? At this moment, I do... foamLog and then xmgrace (kill data and then re-import" once a while. It is ok to do this way. The only problem is that foamLog takes a while to generate the "logs" folder. Any ideas?
Thanks,
IL
ivanwhlau is offline   Reply With Quote

Old   July 29, 2008, 06:35
Default Hi Ivan! Beware! (Advertism
  #10
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Ivan!

Beware! (Advertisment): The pyFoamPlotRunner.py from http://openfoamwiki.net/index.php/Contrib_PyFoam does such a thing.
Currently does not work with 1.5 (only 1.4.1)

Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 29, 2008, 07:34
Default Hi, Bernhard, Unfortunat
  #11
Member
 
Ivan Lau
Join Date: Mar 2009
Location: Hong Kong
Posts: 56
Rep Power: 17
ivanwhlau is on a distinguished road
Hi, Bernhard,
Unfortunately, I am currently working with Version 1.5, and I don't plan to "downgrade" to 1.4.1.
Btw, I thought ver 1.5 shares most of same codes as ver 1.4.1 (I only know that they movie some directories, add new tools and now users need to operate under case directory). Why does this not work for version 1.5?
I guess I will wait till the working version for 1.5. Anyway, thanks for your reply.
Ivan
ivanwhlau is offline   Reply With Quote

Old   July 29, 2008, 08:18
Default Hi Ivan The problem is that p
  #12
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Hi Ivan
The problem is that pyFoam relies on the "old" way of specifying the case ("dot casename") and I've got to rewrite it in a way that takes the used version into account (so that it doesn't break everything for old 1.4.x). It's not that difficult, but I've got some other stuff I've got to finish before I do that
Bernhard
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request
gschaider is offline   Reply With Quote

Old   July 29, 2008, 08:43
Default Hi, Bernhard, That's ex
  #13
Member
 
Ivan Lau
Join Date: Mar 2009
Location: Hong Kong
Posts: 56
Rep Power: 17
ivanwhlau is on a distinguished road
Hi, Bernhard,
That's exactly what I thought.
No rush at all. Please kindly advise if this tools is available.
thanks,
Ivan
ivanwhlau is offline   Reply With Quote

Old   July 29, 2008, 11:00
Default Hi Ivan, I am using Bernhar
  #14
Senior Member
 
santos's Avatar
 
Jose Luis Santos
Join Date: Mar 2009
Location: Portugal
Posts: 215
Rep Power: 18
santos is on a distinguished road
Send a message via Skype™ to santos
Hi Ivan,

I am using Bernhard PyFoam tools to monitor the residuals in OpenFOAM 1.5 as follows:

simpleFoam > log &
pyFoamPlotWatcher.py log

Regards,
Jose Santos
santos is offline   Reply With Quote

Old   September 16, 2008, 16:02
Default Hi, Bernhard, Jose, or others,
  #15
Member
 
Ivan Lau
Join Date: Mar 2009
Location: Hong Kong
Posts: 56
Rep Power: 17
ivanwhlau is on a distinguished road
Hi, Bernhard, Jose, or others,

I tried to use pyFoamPlotWatcher, but I got an error of gnuplot, Do you know how to solve this problem?
The complete error is as the follows:

Starting time loop

Time = 1

DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 0.0571514, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 1, Final residual = 0.0917252, No Iterations 1
sh: gnuplot: command not found
sh: gnuplot: command not found
DICPCG: Solving for p, Initial residual = 1, Final residual = 0.00945253, No Iterations 514
DICPCG: Solving for p, Initial residual = 6.54853e-05, Final residual = 9.78431e-07, No Iterations 193
time step continuity errors : sum local = 1.21402e-06, global = -3.04686e-09, cumulative = -3.04686e-09
DILUPBiCG: Solving for epsilon, Initial residual = 0.608184, Final residual = 0.0248181, No Iterations 1
DILUPBiCG: Solving for k, Initial residual = 1, Final residual = 0.0301132, No Iterations 1
ExecutionTime = 21.77 s ClockTime = 22 s

Time = 2
Traceback (most recent call last):
File "/usr/local/bin/pyFoamPlotWatcher.py", line 5, in <module>
PlotWatcher()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/PlotWatcher.py", line 28, in __init__
PyFoamApplication.__init__(self,args=args,descript ion=description,usage="%prog [options] <logfile>",interspersed=True,nr=1)
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/PyFoamApplication. py", line 26, in __init__
self.run()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/PlotWatcher.py", line 87, in run
run.start()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/BasicWatcher.py", line 60, in start
self.lineHandle(line)
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/AnalyzedCommon.py", line 45, in lineHandle
self.analyzer.analyzeLine(line)
File "/usr/local/lib64/python2.5/site-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py" , line 80, in analyzeLine
self.analyzers[nm].doAnalysis(line)
File "/usr/local/lib64/python2.5/site-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py ", line 31, in doAnalysis
self.notify(float(m.group(1)))
File "/usr/local/lib64/python2.5/site-packages/PyFoam/LogAnalysis/LogLineAnalyzer.py" , line 60, in notify
f(*data)
File "/usr/local/lib64/python2.5/site-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py" , line 44, in setTime
listener.timeChanged()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/StepAnalyzedCommon.py ", line 24, in timeChanged
self.timeHandle()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/GnuplotRunner.py", line 101, in timeHandle
self.plot.redo()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/Basics/GnuplotTimelines.py", line 89, in redo
self.replot()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py" , line 333, in replot
self.refresh()
File "/usr/local/lib64/python2.5/site-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py" , line 226, in refresh
self(self.plotcmd + ' ' + string.join(plotcmds, ', '))
File "/usr/local/lib64/python2.5/site-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py" , line 210, in __call__
self.gnuplot(s)
File "/usr/local/lib64/python2.5/site-packages/PyFoam/ThirdParty/Gnuplot/gp_unix.py", line 210, in __call__
self.flush()
IOError: [Errno 32] Broken pipe

Please kindly advise.

Regards,
iL
ivanwhlau is offline   Reply With Quote

Old   September 16, 2008, 16:46
Default Hi, all, I solved my own pr
  #16
Member
 
Ivan Lau
Join Date: Mar 2009
Location: Hong Kong
Posts: 56
Rep Power: 17
ivanwhlau is on a distinguished road
Hi, all,

I solved my own problem now by reinstalling gnuplot.

Thanks,
iL
ivanwhlau is offline   Reply With Quote

Old   September 16, 2008, 16:56
Default Hi, Sorry for sending anoth
  #17
Member
 
Ivan Lau
Join Date: Mar 2009
Location: Hong Kong
Posts: 56
Rep Power: 17
ivanwhlau is on a distinguished road
Hi,

Sorry for sending another message.
But, I got another error with pyPlotWatcher.py log

Here is an example when trying with simpleFoam:

Time = 20
Warning: empty x range [1:1], adjusting to [0.99:1.01]
Warning: empty y range [-3.04686e-09:-3.04686e-09], adjusting to [-3.01639e-09:-3.07733e-09]
Warning: empty y2 range [-3.04686e-09:-3.04686e-09], adjusting to [-3.01639e-09:-3.07733e-09]

DILUPBiCG: Solving for Ux, Initial residual = 0.0122534, Final residual = 0.000895386, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 0.0150332, Final residual = 0.00111655, No Iterations 2
DICPCG: Solving for p, Initial residual = 0.407735, Final residual = 0.00402762, No Iterations 539
DICPCG: Solving for p, Initial residual = 0.000405376, Final residual = 4.02599e-06, No Iterations 204
time step continuity errors : sum local = 1.83833e-07, global = -1.24031e-09, cumulative = 3.64998e-08
DILUPBiCG: Solving for epsilon, Initial residual = 0.0435693, Final residual = 0.000439403, No Iterations 2
DILUPBiCG: Solving for k, Initial residual = 0.0505866, Final residual = 0.00268979, No Iterations 1
ExecutionTime = 414.23 s ClockTime = 415 s

Please kindly comment and advise.
Regards, iL
ivanwhlau is offline   Reply With Quote

Old   September 18, 2008, 06:46
Default hello, can some one please ad
  #18
Member
 
davey david
Join Date: Mar 2009
Posts: 54
Rep Power: 17
suredross is on a distinguished road
hello,
can some one please advise whether foamlog is still available in openfoam 1.4 and the correct synthax for it?i tried
[cfd@sm-pc16-linux ~]$ foamLog OpenFOAM/OpenFOAM-1.4.1/tutorials/junctionFoam/rectCyo/ log
,
but could not get any results.also does it only monitor a run or can be used for saved log files?

thank you
suredross is offline   Reply With Quote

Old   September 18, 2008, 07:18
Default Its a post processing utility
  #19
New Member
 
Ryan Middleton
Join Date: Mar 2009
Posts: 17
Rep Power: 17
ryan_m is on a distinguished road
Its a post processing utility so it will only work for a saved log file. Try the following syntax:

foamLog <root> <case> <case>/<logfile>
ryan_m is offline   Reply With Quote

Old   October 28, 2008, 05:54
Default Hi all, I got the same erro
  #20
Member
 
Matthias Walter
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 63
Rep Power: 17
matthias is on a distinguished road
Hi all,

I got the same error like Ivan when I start pyPlotWatcher.py ! (No lines were plotted)

...
Warning: empty x range [1:1], adjusting to ...
Warning: empty y range ...
...


The OF case seems to be OK. Maybe a bug in the plot tool?

Best regards,

Matthias
matthias is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Plotting residual in paraFoam booz ParaView 3 August 12, 2008 06:35
Real-time residual and results plotting simone Marras Main CFD Forum 6 January 29, 2007 07:57
X-Y plotting Babu FLUENT 1 March 25, 2005 05:45
residual plotting in Prostar Ossi Siemens 15 March 14, 2003 07:54
plotting the value of y-plus Dennis CFX 3 May 16, 2002 13:43


All times are GMT -4. The time now is 03:59.