|
[Sponsors] |
[PyFoam] First discussion thread about PyFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 18, 2010, 10:08 |
|
#181 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
BoundaryDict is a convenience-class around ParsedBoundaryDict (which takes the absolute path to the file) that uses a SolutionDirectory as a parameter and uses the boundaryDict-method of that class to get the actual filename. The problem is that obviously BoundaryDict does not accept a time-parameter and therefor can't pass that to SolutionDirectory. One solution would be to use the ParsedBoundaryDict-class directly, but that doesn't have the patches-method you're using. The other fix would be to add the time-parameter to the BoundaryDict-constructor and pass it. I will do this one of these days if I remember it (Bug-report might help) Bernhard |
||
January 21, 2010, 09:23 |
|
#182 | |
Senior Member
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20 |
Quote:
Bernhard, we updated to matplotlib 0.99. Using pyFoamPlotWatcher I get no error but also no rendering live window. I have not yet tried saving hardcopies. Regards |
||
January 21, 2010, 10:20 |
|
#183 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
The only systems I have access to are - MacOS X: live-plotting works, but I don't use it - CentOS 5: in order to get live-plotting to work I'd have to rebuild essential parts of the system and I have no intention of doing that (I don't have access to Ubuntu or Suse-systems) If somebody comes up with a patch that makes live-plotting possible on a wider range of systems I will gladly include it, but I don't intend to work on it myself. Sorry. Bernhard |
||
January 30, 2010, 09:57 |
|
#184 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
Hi Bernhard,
When I tried to use pyFoam and run pyFoamRunner.py --clear icoFoam -case cavity in OF-1.6.x, I got the error information: Traceback (most recent call last): File "/usr/local/bin/pyFoamPlotRunner.py", line 3, in <module> from PyFoam.Applications.PlotRunner import PlotRunner File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PlotRunner.py", line 8, in <module> from PyFoam.Execution.GnuplotRunner import GnuplotRunner File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/GnuplotRunner.py", line 4, in <module> from StepAnalyzedCommon import StepAnalyzedCommon File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/StepAnalyzedCommon.py", line 4, in <module> from AnalyzedCommon import AnalyzedCommon File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/AnalyzedCommon.py", line 6, in <module> from PyFoam.Basics.PlotTimelinesFactory import createPlotTimelines,createPlotTimelinesDirect File "/usr/local/lib/python2.6/dist-packages/PyFoam/Basics/PlotTimelinesFactory.py", line 4, in <module> from GnuplotTimelines import GnuplotTimelines File "/usr/local/lib/python2.6/dist-packages/PyFoam/Basics/GnuplotTimelines.py", line 4, in <module> from PyFoam.ThirdParty.Gnuplot import Gnuplot,Data File "/usr/local/lib/python2.6/dist-packages/PyFoam/ThirdParty/Gnuplot/__init__.py", line 166, in <module> from PlotItems import PlotItem, Func, File, Data, GridData File "/usr/local/lib/python2.6/dist-packages/PyFoam/ThirdParty/Gnuplot/PlotItems.py", line 27, in <module> import Numeric as numpy ImportError: No module named Numeric Do you know the reason? Thanks. |
|
January 30, 2010, 14:38 |
|
#185 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Use the pyFoamVersion.py-utility to check for prerequisites Bernhard |
||
January 30, 2010, 20:15 |
|
#186 | |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
Quote:
pyFoamVersion.py It gave the error information as follows: PYTHONPATH: Traceback (most recent call last): File "/usr/local/bin/pyFoamVersion.py", line 11, in <module> print "PYTHONPATH:", os.environ["PYTHONPATH"] File "/usr/lib/python2.6/UserDict.py", line 22, in __getitem__ raise KeyError(key) KeyError: 'PYTHONPATH' What's the matter, you think? Thanks. In order to fix up above error, I follow up to type: export PYTHONPATH=/usr/local/lib/python-2.6/site-packages:$PYTHONPATH export PATH=/usr/local/bin:$PATH and type again: pyFoamVersion.py It gave the informations as follows: PYTHONPATH: /usr/local/lib/python-2.6/site-packages: OpenFOAM (1, 6, 'x') of the installed versions ['1.6.x'] pyFoam-Version: 0.5.3 Installed libraries: Gnuplot : No Not a problem. Version from ThirdParty is used ply : No Not a problem. Version from ThirdParty is used Numeric : No Not a problem if numpy is present numpy : No Not a problem if Numeric is present matplotlib : No Only Gnuplot-plotting possible psyco : No Not a problem. Acceleration not possible hotshot : Yes profile : No Not a problem. Can't profile using this library cProfile : Yes What is it? I knew little about it. Please help me out. Thanks. Last edited by sandy; January 30, 2010 at 20:31. |
||
January 31, 2010, 08:48 |
|
#187 | ||
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Quote:
Bernhard |
|||
January 31, 2010, 10:26 |
|
#188 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
Hi Bernhard,
I installed those package by the code line: sudo apt-get install python-gnuplot sudo apt-get install python-ply ..... except profile package. Do you know how to install it? Further, I tried to type pyFoamPlotWather.py in the case, pyFoamPlotWather.py cavity.log It gave some new error informations: gnuplot: /home/jinweiwei/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libwx_baseu-2.8.so.0) gnuplot: /home/jinweiwei/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libwx_baseu-2.8.so.0) gnuplot: /home/jinweiwei/OpenFOAM/ThirdParty-1.6.x/gcc-4.3.3/platforms/linux/lib/libstdc++.so.6: version `GLIBCXX_3.4.11' not found (required by /usr/lib/libwx_baseu-2.8.so.0) Traceback (most recent call last): File "/usr/local/bin/pyFoamPlotWatcher.py", line 5, in <module> PlotWatcher() File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PlotWatcher.py", line 35, in __init__ nr=1) File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PyFoamApplication.py", line 138, in __init__ self.run() File "/usr/local/lib/python2.6/dist-packages/PyFoam/Applications/PlotWatcher.py", line 117, in run run.start() File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/BasicWatcher.py", line 67, in start self.lineHandle(line) File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/AnalyzedCommon.py", line 55, in lineHandle self.analyzer.analyzeLine(line) File "/usr/local/lib/python2.6/dist-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 84, in analyzeLine self.analyzers[nm].doAnalysis(line) File "/usr/local/lib/python2.6/dist-packages/PyFoam/LogAnalysis/TimeLineAnalyzer.py", line 31, in doAnalysis self.notify(float(m.group(2))) File "/usr/local/lib/python2.6/dist-packages/PyFoam/LogAnalysis/LogLineAnalyzer.py", line 60, in notify f(*data) File "/usr/local/lib/python2.6/dist-packages/PyFoam/LogAnalysis/FoamLogAnalyzer.py", line 44, in setTime listener.timeChanged() File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/StepAnalyzedCommon.py", line 24, in timeChanged self.timeHandle() File "/usr/local/lib/python2.6/dist-packages/PyFoam/Execution/GnuplotRunner.py", line 258, in timeHandle self.plots[p].redo() File "/usr/local/lib/python2.6/dist-packages/PyFoam/Basics/GeneralPlotTimelines.py", line 112, in redo self.doReplot() File "/usr/local/lib/python2.6/dist-packages/PyFoam/Basics/GnuplotTimelines.py", line 109, in doReplot self.replot() File "/usr/local/lib/python2.6/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 333, in replot self.refresh() File "/usr/local/lib/python2.6/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 226, in refresh self(self.plotcmd + ' ' + string.join(plotcmds, ', ')) File "/usr/local/lib/python2.6/dist-packages/PyFoam/ThirdParty/Gnuplot/_Gnuplot.py", line 210, in __call__ self.gnuplot(s) File "/usr/local/lib/python2.6/dist-packages/PyFoam/ThirdParty/Gnuplot/gp_unix.py", line 210, in __call__ self.flush() IOError: [Errno 32] Broken pipe Maybe you know how to fix it now? Please help me out.. Thanks. |
|
February 1, 2010, 18:08 |
|
#189 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
To verify this try running the command gnuplot from the command line. If it fails in the same way, then PyFoam is not to blame (and I don't know how to fix that kind of situation in a Debian/Ubuntu-system, sorry) Bernhard |
||
February 1, 2010, 22:14 |
|
#190 |
Senior Member
Sandy Lee
Join Date: Mar 2009
Posts: 213
Rep Power: 18 |
Hi Bernhard,
Thanks for your reply. However, if that, do you know how can I use gnuplot in Ubunto? Could you help me to fix up it? If I can not use PyFoam and gnuplot all, how can I do in OpenFOAM, you think. Sandy |
|
February 2, 2010, 05:55 |
|
#191 | |
Member
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16 |
Hi Sandy
Quote:
Code:
gnuplot -V You do the same with Code:
sudo apt-cache show gnuplot Cheers Wolle |
||
June 4, 2010, 10:54 |
pyFoamPlotWatcher.py with non-interactive opinion
|
#192 |
Member
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16 |
Hello pyFoamer,
i've got a question if there is a suitable method to interrupt the pyFoamPlotWatcher.py automatically if the parsed logfile doesn't change anymore? According to the explanation in the wiki: "Watches the file until interrupted.", i'm looking for an non-interactive opinion! The batch-system i use outputs only logfiles and i'm able to watch them with the pyFoamPlotWatcher.py. But after case solving i have to interrupt the watcher to go on with the queueing jobs. That's not useful when running a lot of cases in batch mode. But it is nice to watch the residuals from time to time. Has anybody an idea to manage non-interactive plot watching with pyFoam? ~Stefan |
|
June 4, 2010, 12:53 |
|
#193 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
So as I see it there are two options: 1. you can write your own analyzer scripts (using the stuff in the examples-directory and the original watcher-script as a template) 2. Write a bug report at http://sourceforge.net/apps/mantisbt...?page_number=1 and I will try to squeeze it into the next release (which I hope to have out before the Workshop). Bernhard |
||
June 4, 2010, 17:17 |
|
#194 |
Member
Stefan
Join Date: Jan 2010
Location: Kiel, Germany
Posts: 81
Rep Power: 16 |
Thanks Bernhard for the prompt statement!
I understand the problem of buffering file streams by the batch system, since i noticed time delays about a few minutes between calculation and log output. The only truncation criterium of stop parsing the logfile i see is the specified endTime within controlDict. I have little experience with batch systems (i use Torque by the way) so i'm not sure what cummunication standards used if a job is finished. Maybe this could be another idea. I did various attempts of using the pyFoamPlotRunner.py with the job script provided by Torque, but it seems that there is no chance of getting this done. ~Stefan |
|
June 9, 2010, 02:46 |
customRegexp file
|
#195 |
New Member
sasan
Join Date: Feb 2010
Posts: 5
Rep Power: 16 |
Hi everybody,
I successfully installed and ran pyFoam on my mac machine. I see residual plots. However, I could not find a way to plot other parameters (like Ux or gamma or Courant number) using line command or by editing customRegexp file. In fact, there is not such a file in my case directory! Does any body know how to solve this problem? Thanks, Ali |
|
June 9, 2010, 05:37 |
|
#196 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
custom in customRegExp means that it is customized for your case. The most complete documentation on that topic (to my knowledge) is: http://openfoamwiki.net/index.php/Co...omRegexp-files (jump immediately to the section on the new format) Bernhard |
||
June 9, 2010, 18:51 |
|
#197 |
New Member
sasan
Join Date: Feb 2010
Posts: 5
Rep Power: 16 |
Thanks Bernhard.
|
|
June 14, 2010, 06:46 |
forceCoeffs
|
#198 |
Senior Member
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23 |
Hello everybody,
first of all, I want to thank Bernhard for the effort he put on PyFoam. Good job guy! Now the point: I am trying to adapt doInletVariation.py example to obtain an airfoil polar plot. This pyFoam utility should be able to run the same case with different velocity direction, extract the forceCoeffs values at the last time step and collect all the value in a single file. I succeeded to include modification to velocity component and liftDir and dragDir using parsedParameterFile. However, since forceCoeffs is not a postprocess utility, I cannot use UtilityRunner to get the forceCoeffs value as made in the same example for the massFlow. How can I get it? Suggestions? Thanks, mad |
|
June 14, 2010, 08:11 |
|
#199 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi!
Quote:
Second solution would be to run the solver with a UtilityRunner instead of the BasicRunner and look for the forces. Third solution would be to write a subclass of the LogAnalyzer-class. I will demonstrate that during the PyFoam-training in Gothenburg and the slides should be available afterwards. Bernhard |
||
June 14, 2010, 08:42 |
|
#200 |
Senior Member
maddalena
Join Date: Mar 2009
Posts: 436
Rep Power: 23 |
... so I will try the 2nd solution, it seems the easiest to implement.
Or...
Thanks, mad |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Divergence detected in AMG solver: k when udf loaded | google9002 | Fluent UDF and Scheme Programming | 3 | November 8, 2019 00:34 |
udf problem | jane | Fluent UDF and Scheme Programming | 37 | February 20, 2018 05:17 |
Guide: Getting Started with the CFD Online Discussion Forums | pete | Site Help, Feedback & Discussions | 8 | July 29, 2016 06:00 |
Error messages | atg | enGrid | 7 | August 30, 2013 12:16 |
Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 15:37 |