|
[Sponsors] |
![]() |
![]() |
#1 |
Member
Join Date: Nov 2011
Posts: 44
Rep Power: 15 ![]() |
Hello
I use foamLog for the log-file that I have, which has several thousand time-steps, and each time-step has many iterations for different parameters. When i use foamLog, it gives me a logs folder output, however the usually just contain a single number. Rather confused, since I was expecting many thousands of values at least for each timestep with regards to residuals... Any ideas? F |
|
![]() |
![]() |
![]() |
![]() |
#2 |
New Member
Gilles De Neyer
Join Date: Nov 2011
Posts: 18
Rep Power: 15 ![]() |
Hello,
I got the same problem with foamLog. Finally, I did a small app(really poor programming ...) reading the log file as I wished. It's done to read the drag and lift coefficient but you can easily change it to plot the residuals. I put my code in attachment but if you find the solution for foamLog I would be happy to have further informations ;-) |
|
![]() |
![]() |
![]() |
![]() |
#3 |
Member
Join Date: Nov 2011
Posts: 44
Rep Power: 15 ![]() |
Hmm hello thank you for the script.
So if my time step was 0.01, and each time step looked like the thing below... what would i need to change? ![]() Thank you. Francesco -------------- Time = 0.01 Courant Number mean: 0 max: 0.136 Iteration No 1 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 2.99476e-08, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for p, Initial residual = 1, Final residual = 9.41218e-08, No Iterations 737 time step continuity errors : sum local = 7.34978e-12, global = -2.46208e-14, cumulative = -2.46208e-14 DICPCG: Solving for p, Initial residual = 3.59809e-05, Final residual = 9.55252e-08, No Iterations 604 time step continuity errors : sum local = 1.37508e-08, global = -2.92546e-11, cumulative = -2.92792e-11 DICPCG: Solving for p, Initial residual = 4.44746e-07, Final residual = 9.49638e-08, No Iterations 4 time step continuity errors : sum local = 1.29697e-08, global = 1.91066e-10, cumulative = 1.61787e-10 DICPCG: Solving for PotE, Initial residual = 0, Final residual = 0, No Iterations 0 Iteration No 2 DILUPBiCG: Solving for Ux, Initial residual = 0.00227304, Final residual = 1.46529e-07, No Iterations 2 DILUPBiCG: Solving for Uy, Initial residual = 0.00270324, Final residual = 2.49839e-07, No Iterations 2 DICPCG: Solving for p, Initial residual = 0.000117855, Final residual = 9.99383e-08, No Iterations 451 time step continuity errors : sum local = 1.32192e-08, global = -1.70539e-09, cumulative = -1.5436e-09 DICPCG: Solving for p, Initial residual = 1.19641e-05, Final residual = 9.84828e-08, No Iterations 400 time step continuity errors : sum local = 1.30281e-08, global = 1.83845e-11, cumulative = -1.52522e-09 DICPCG: Solving for p, Initial residual = 1.42252e-06, Final residual = 8.98636e-08, No Iterations 4 time step continuity errors : sum local = 1.1888e-08, global = 1.05161e-10, cumulative = -1.42006e-09 DICPCG: Solving for PotE, Initial residual = 0, Final residual = 0, No Iterations 0 Iteration No 3 DILUPBiCG: Solving for Ux, Initial residual = 1.68533e-05, Final residual = 4.37189e-07, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 2.16801e-05, Final residual = 5.83916e-07, No Iterations 1 DICPCG: Solving for p, Initial residual = 1.83766e-06, Final residual = 8.53894e-08, No Iterations 10 time step continuity errors : sum local = 1.12961e-08, global = 7.52266e-11, cumulative = -1.34483e-09 DICPCG: Solving for p, Initial residual = 2.3926e-07, Final residual = 9.16602e-08, No Iterations 1 time step continuity errors : sum local = 1.21256e-08, global = 7.26966e-11, cumulative = -1.27213e-09 DICPCG: Solving for p, Initial residual = 9.89624e-08, Final residual = 9.89624e-08, No Iterations 0 time step continuity errors : sum local = 1.30916e-08, global = 7.25284e-11, cumulative = -1.19961e-09 DICPCG: Solving for PotE, Initial residual = 0, Final residual = 0, No Iterations 0 ExecutionTime = 4.13 s ClockTime = 4 s |
|
![]() |
![]() |
![]() |
![]() |
#4 |
New Member
Gilles De Neyer
Join Date: Nov 2011
Posts: 18
Rep Power: 15 ![]() |
as you see I begin each block with a test condition to see if I get
- DragCoefficient - pressureDragCoefficient - viscDragCoefficient - liftCoefficient the code strstr(chaine,"DragCoefficient") returns 1 if DragCoefficient is into the line chaine and 0 if not. so if you want to plot the p final residual for example, you'll need to put the condition strstr(chaine,"Solving for p") which will be equal to 1 just for the good lines and then index = stristr(chaine,"Final residual ="); which will return the index of the letter "F" (first letter of the subchain) and finally index = index + 17; // index of the first number after Final residual char* souschaine; souschaine = strsub(chaine, index, index + 8); // souschaine is the substring token from chaine with first index given by "index" and final index given by "index+8" just don't make mistake with the initial if condition, as you have several times "Final residual", you need to put the condition well to be sure you're loading the good one |
|
![]() |
![]() |
![]() |
![]() |
#5 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
I'm not 100% sure which intermediate iteration data you need, but maybe pyFoamPlotWatcher.py with a right cutomRegexp and the --write-files-option might be what you want (it writes multiple files if the residual of that name is there multiple times during a timestep) Last edited by gschaider; April 9, 2012 at 18:58. Reason: Clarification |
||
![]() |
![]() |
![]() |
![]() |
#6 |
Member
Join Date: Nov 2011
Posts: 44
Rep Power: 15 ![]() |
Hi
I just installed pyFoam and am trying to use it on my old log files... Installation was very easy. Now I tried "pyFoamPlotWatcher.py proc4_out" but I get the following error: sh: gnuplot: command not found sh: gnuplot: command not found sh: gnuplot: command not found Traceback (most recent call last): File "/usr/local/bin/pyFoamPlotWatcher.py", line 5, in <module> PlotWatcher() File "/Library/Python/2.6/site-packages/PyFoam/Applications/PlotWatcher.py", line 35, in __init__ nr=1) File "/Library/Python/2.6/site-packages/PyFoam/Applications/PyFoamApplication.py", line 213, in __init__ result=self.run() File "/Library/Python/2.6/site-packages/PyFoam/Applications/PlotWatcher.py", line 132, in run run.start() File "/Library/Python/2.6/site-packages/PyFoam/Execution/BasicWatcher.py", line 73, in start self.lineHandle(line) File "/Library/Python/2.6/site-packages/PyFoam/Execution/AnalyzedCommon.py", line 75, in lineHandle self.analyzer.analyzeLine(line) File "/Library/Python/2.6/site-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 125, in analyzeLine self.analyzers[nm].doAnalysis(line) File "/Library/Python/2.6/site-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py", line 43, in doAnalysis self.notifyNewTime(m) File "/Library/Python/2.6/site-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py", line 32, in notifyNewTime self.notify(float(m.group(2))) File "/Library/Python/2.6/site-packages/PyFoam/LogAnalysis/LogLineAnalyzer.py", line 65, in notify f(*data) File "/Library/Python/2.6/site-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 71, in setTime listener.timeChanged() File "/Library/Python/2.6/site-packages/PyFoam/Execution/StepAnalyzedCommon.py", line 32, in timeChanged self.timeHandle() File "/Library/Python/2.6/site-packages/PyFoam/Execution/GnuplotRunner.py", line 271, in timeHandle self.plots[p].redo() File "/Library/Python/2.6/site-packages/PyFoam/Basics/GeneralPlotTimelines.py", line 112, in redo self.doReplot() File "/Library/Python/2.6/site-packages/PyFoam/Basics/GnuplotTimelines.py", line 115, in doReplot self.replot() File "/Library/Python/2.6/site-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 333, in replot self.refresh() File "/Library/Python/2.6/site-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 226, in refresh self(self.plotcmd + ' ' + string.join(plotcmds, ', ')) File "/Library/Python/2.6/site-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 210, in __call__ self.gnuplot(s) File "/Library/Python/2.6/site-packages/PyFoam/ThirdParty/Gnuplot/gp_macosx.py", line 144, in __call__ self.flush() IOError: [Errno 32] Broken pipe Ideas? I see you're one of the developers... awesome stuff!! F Last edited by fferroni; May 18, 2012 at 07:32. |
|
![]() |
![]() |
![]() |
![]() |
#7 |
Member
Join Date: Nov 2011
Posts: 44
Rep Power: 15 ![]() |
Dear Bernhard,
It appears to have done something if I use 'pyFoamStandardLogAnalyzer.py' I get separate files with continuity and many other variables that I was logging, in columns of time, local, global, and cumulative. Just to check, I get 9 separate files for i.e. pressure. Is that because it gives a separate file for each time in runs DICPGG (3 x 3 iterations)? Thank you, F |
|
![]() |
![]() |
![]() |
![]() |
#8 |
Retired Super Moderator
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128 ![]() ![]() ![]() ![]() ![]() ![]() |
Greetings to all!
Well, I would say the first few lines are self explanatory... you don't have "gnuplot" installed! Either that, or the gnuplot command is something like gnuplot44. I haven't got much experience (yet) with pyFoam, so I can't answer your latest post... Best regards, Bruno
__________________
|
|
![]() |
![]() |
![]() |
![]() |
#9 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
About your other problem: I agree with wyldcat: probably there is no gnuplot installed. Or under a different name |
||
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using foamLog | liamm | OpenFOAM Running, Solving & CFD | 17 | September 10, 2020 05:00 |
foamLog problem | Rickard.Solsjo | OpenFOAM Post-Processing | 11 | November 19, 2014 21:57 |
foamLog error in OpenFoam 2.0.1 | A.D.E | OpenFOAM Post-Processing | 3 | November 8, 2011 09:18 |
foamLog reading a vector | rubenparedes | OpenFOAM Post-Processing | 2 | May 28, 2010 00:25 |
FoamLog for my case | liugx212 | OpenFOAM Running, Solving & CFD | 9 | June 18, 2008 14:12 |