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/)
-   -   pyFoam gives unexpected output (http://www.cfd-online.com/Forums/openfoam-post-processing/109601-pyfoam-gives-unexpected-output.html)

Flor November 21, 2012 12:39

pyFoam gives unexpected output
 
Hi All,

I want to use pyFoam for getting some plots like timeStep and Courant number. When I type

Code:

pyFoamPlotWatcher.py --progress out.dat
I get a plot of the residuals and that's it. When I close the plot of the residuals I am stuck in the command line with the time output. On control-c some more windows pop up for a moment. In the folder out.dat.analyzed I only have a file pickledPlots, but no other data files. I am using Python 2.6.2.

Any idea how to solve this?

Best regards,
Florian

gschaider November 21, 2012 15:04

Quote:

Originally Posted by Flor (Post 393488)
Hi All,

I want to use pyFoam for getting some plots like timeStep and Courant number. When I type

Code:

pyFoamPlotWatcher.py --progress out.dat
I get a plot of the residuals and that's it. When I close the plot of the residuals I am stuck in the command line with the time output. On control-c some more windows pop up for a moment. In the folder out.dat.analyzed I only have a file pickledPlots, but no other data files. I am using Python 2.6.2.

Any idea how to solve this?

Best regards,
Florian

The behaviour (only Control-C stops the watcher) is perfectly normal and desirable (the simulation writing that file still might be running). The windows that pop up when terminating usually are a sign for datasets where data only exist for one time-step (pyFoam only starts plotting when at least data for two timesteps is in a set and only replots datasets where during a timestep new data has been added ... if the simulation is sufficiently large. If it isn't then only every X seconds the plots are redone. The reason for this is that otherwise the plotting would "eat" the whole CPU and leave no time for the simulation.

All this behaviour (and also the writing of datafiles) can be controlled by options: the --help-option is your friend and will tell you all there is to know about these (I can't stress enough that the documentation of the PyFoam-utilities is "hidden in plain sight" with that option: if you think a utility "should be able to do this" check there first)

Flor November 28, 2012 05:24

Ok, thank you for the quick reply. The --with-all option did the job.

By the way, is there a size limit for log files? I have a log file with 1.3GB and pyFoamPlotWatcher gets stuck after 28% of it. Same command works perfectly fine for a log file with 66MB.

Regards,
Florian

gschaider November 28, 2012 06:11

Quote:

Originally Posted by Flor (Post 394594)
Ok, thank you for the quick reply. The --with-all option did the job.

By the way, is there a size limit for log files? I have a log file with 1.3GB and pyFoamPlotWatcher gets stuck after 28% of it. Same command works perfectly fine for a log file with 66MB.

Regards,
Florian

No. There is no limit that I know of. Maybe you ran out of memory/disk quota/etc. Check with top or so for the memory usage (if it is excessive I'll consider it a bug)

Did 1Gig logs some time ago with the watcher. The experience lead to the development of a new feature: pyFoamRunner.py (and other utils) writes in the *.analyzed-directory a file called pickledPlots. This contains all the data collected during the run. With the utility pyFoamRedoPlots.py you can produce the plots in an instance (this only works for plots that were defined during the running: the stuff you get with --with-all and customRegexp. If you add stuff to customRegexp AFTER the run you've got to rerun the watcher)

Anyway: Because of this feature I don't have experience with current versions of PyFoam+large logs+pyFoamWatcher.py

Flor November 28, 2012 06:32

I don't observe any excessive memory usage, and disk space is also still available. But I will resort to the pyFoamRunner and pyFoamRedoPlots process in the future.

Thanks again for your help and the useful pyFoam-toolbox!

Regards,
Florian

gschaider November 28, 2012 07:54

Quote:

Originally Posted by Flor (Post 394608)
I don't observe any excessive memory usage, and disk space is also still available. But I will resort to the pyFoamRunner and pyFoamRedoPlots process in the future.

Thanks again for your help and the useful pyFoam-toolbox!

Regards,
Florian

Just make sure that before you go into production that pyFoamRunner.py doesn't show a similar behaviour with the run that produced the 1.3Gig log. Although the only thing that could be a problem with pyFoam is a counter variable for the lines, but that is a long so it shouldn't be a problem ... I think


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