|
[Sponsors] |
November 26, 2008, 05:35 |
Hi Bernhard,
... emacs/dire
|
#81 |
Senior Member
Fabian Braennstroem
Join Date: Mar 2009
Posts: 407
Rep Power: 19 |
Hi Bernhard,
... emacs/dired might even the most powerfull choice for a gui - file manager - editor combination. There are some gui examples in the gnuplot mode: http://cars9.uchicago.edu/~ravel/sof...mode/gp-ps.png http://cars9.uchicago.edu/~ravel/sof.../gp-xrange.png Using your pyFoam tools could be done using pymacs and an interactive python-OpenFoam interpreter should work as well (at least there is a python-mode with the interpreter)...!? Fabian |
|
December 31, 2008, 00:16 |
Hi, all,
I am trying to insta
|
#82 |
Member
Ivan Lau
Join Date: Mar 2009
Location: Hong Kong
Posts: 56
Rep Power: 17 |
Hi, all,
I am trying to install pyFoam and get the following error. In fact, I used pyFoam before, but (for some critical issue) I just reinstall OpenFOAM and every program. now, I got the following error. Can anyone help or any idea? Regards, Ivan Traceback (most recent call last): File "/usr/local/bin/pyFoamSteadyRunner.py", line 5, in <module> SteadyRunner() File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/SteadyRunner.py", line 51, in __init__ description=description) File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/PyFoamApplication. py", line 103, in __init__ self.run() File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/SteadyRunner.py", line 83, in run lam=lam) File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/ConvergenceRunner.py" , line 20, in __init__ AnalyzedRunner.__init__(self,analyzer,argv,silent, logname,server=server,lam=lam, restart=restart) File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/AnalyzedRunner.py", line 15, in __init__ BasicRunner.__init__(self,argv,silent,logname,serv er=server,lam=lam,restart=rest art) File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/BasicRunner.py", line 123, in __init__ f=open(path.join(self.dir,"PyFoamServer.info"),"w" ) IOError: [Errno 13] Permission denied: './PyFoamServer.info' Exception in thread Thread-3 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib64/python2.5/threading.py", line 460, in __bootstrap File "/usr/lib64/python2.5/threading.py", line 626, in run File "/usr/lib64/python2.5/threading.py", line 349, in set File "/usr/lib64/python2.5/threading.py", line 265, in notifyAll <type>: 'NoneType' object is not callable Unhandled exception in thread started by Error in sys.excepthook: Original exception was: ilau@CEY004:~/OpenFOAM/ilau-1.5/run/research/20081224-testSquareCylinder_fs-sf-NonlinearKES hih> pyFoamPlotRunner.py simpleFoam Traceback (most recent call last): File "/usr/local/bin/pyFoamPlotRunner.py", line 5, in <module> PlotRunner() File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/PlotRunner.py", line 54, in __init__ description=description) File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/PyFoamApplication. py", line 103, in __init__ self.run() File "/usr/local/lib64/python2.5/site-packages/PyFoam/Applications/PlotRunner.py", line 111, in run logname=self.opts.logname) File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/GnuplotRunner.py", line 208, in __init__ logname=logname) File "/usr/local/lib64/python2.5/site-packages/PyFoam/Execution/BasicRunner.py", line 123, in __init__ f=open(path.join(self.dir,"PyFoamServer.info"),"w" ) IOError: [Errno 13] Permission denied: './PyFoamServer.info' Exception in thread Thread-3 (most likely raised during interpreter shutdown): Traceback (most recent call last): File "/usr/lib64/python2.5/threading.py", line 460, in __bootstrap File "/usr/lib64/python2.5/threading.py", line 626, in run File "/usr/lib64/python2.5/threading.py", line 349, in set File "/usr/lib64/python2.5/threading.py", line 265, in notifyAll <type>: 'NoneType' object is not callable Unhandled exception in thread started by Error in sys.excepthook: Original exception was: |
|
December 31, 2008, 12:58 |
Happy New Year's Eve, Foamers:
|
#83 |
Senior Member
|
Happy New Year's Eve, Foamers:
Can someone help me with the syntax of using pyFoamWriteDictionary? I'm trying to modify the contents of fvSchemes inside of a loop in a python script and am getting an error. pyFoamWriteDictionary.py system/fvSchemes "divSchemes['div(phi,U)']" 'Gauss vanLeer' Error in /opt/local/bin/pyFoamWriteDictionary.py : Expression "divSchemes['div(phi,U)']" not usable as an expression I've tried a number of things, including preceding the parentheses with a backslash to avoid the metacharacter ['div\(phi,U\)'] and placing a "r" before the expression [r'div(phi,U)'] to flag it as a regexp. However, I haven't been able to make this work. Note, simple examples like pyFoamWriteDictionary.py 0/U "boundary[top][type]" noSlip work just fine. Also, as a test, I tried to change the default divSchemes pyFoamWriteDictionary.py system/fvSchemes "divSchemes['default']" 'Gauss vanLeer'. Here, pyFoamWriteDictionary runs, but puts paranthesis around "Gauss vanLeer" which causes OF to choke. Thanks, Eric |
|
January 5, 2009, 12:38 |
Happy new year to you all!
|
#84 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Happy new year to you all!
@Ivan: in your case the problem seems to be that you're not allowed to write ./PyFoamServer.info. Is it possible that the parent directory or the file do not belong to you? But I'll try to catch that exception in later versions of OF @Eric: The problem seems to be that under certain circumstances the shell preserves the enclosing "" and then the script failed. I modified the relevant files to strip away the "" and they can be downloaded from openfoam-extend (use these links and save them in the appropriate locations) https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/other/scripting/PyFoam/PyFoam/Applications/ReadDictionary.py https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/other/scripting/PyFoam/PyFoam/Applications/WriteDictionary.py To be honest: I hardly use these 2 utilities nowadays. They come from the time when our cluster refused to run Python-scripts as Batch-Jobs and I wanted to manipulate cases from Shell-scripts. 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 |
|
January 5, 2009, 18:03 |
Hi Bernhard,
Thanks for the
|
#85 |
Senior Member
|
Hi Bernhard,
Thanks for the information and update! As a work-around, I wrote my own python code to parse the fvSchemes file and replace the divScheme type. However, I'll test the updated version. I'm curious, what do you do instead of using these utilities? Eric |
|
January 6, 2009, 12:16 |
Hi Eric!
Usually I run jobs
|
#86 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Eric!
Usually I run jobs on our cluster using this feature of PyFoam: http://openfoamwiki.net/index.php/Co...luster_support (I just wrote this piece of Docu to be able to answer this question, the feature has been there for a long time). It does a lot of repetitive tasks (decomposing, reconstructing etc) for me and I don't have to write shell-scripts any more (am I the only one who thinks that the syntax of shell scripts is ... <invitation>) 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 |
|
January 6, 2009, 12:17 |
PS: In the last remark "invita
|
#87 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
PS: In the last remark "invitation to a flame war" got abreviated to "invitation".
__________________
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 |
|
February 17, 2009, 10:54 |
Hello Bernhard,
i have noti
|
#88 |
New Member
Ivana B.
Join Date: Mar 2009
Posts: 4
Rep Power: 17 |
Hello Bernhard,
i have noticed that pyFoamPlotWatcher.py (and I think pyFoamPlotRunner.py) does not work properly with log outputs of OF1.5-dev (with OF1.5.x it works). Since revision 949 there is a additional "velocity magnitude" output that cannot be processed. There is error output: Traceback (most recent call last): File "/OpenFOAM/python/bin/pyFoamPlotWatcher.py", line 5, in <module> PlotWatcher() File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/Applications/PlotWatcher.py ", line 35, in __init__ nr=1) File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/Applications/PyFoamApplicat ion.py", line 103, in __init__ self.run() File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/Applications/PlotWatcher.py ", line 105, in run run.start() File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/Execution/BasicWatcher.py", line 60, in start self.lineHandle(line) File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/Execution/AnalyzedCommon.py ", line 45, in lineHandle self.analyzer.analyzeLine(line) File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/LogAnalysis/FoamLogAnalyzer .py", line 80, in analyzeLine self.analyzers[nm].doAnalysis(line) File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/LogAnalysis/GeneralLineAnal yzer.py", line 69, in doAnalysis self.addToTimelines(m) File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/LogAnalysis/SimpleLineAnaly zer.py", line 62, in addToTimelines self.lines.setValue(name,data) File "/OpenFOAM/python/lib/python2.5/site-packages/PyFoam/Basics/TimeLineCollection.p y", line 134, in setValue val=float(value) ValueError: invalid literal for float(): 0 velocity magnitude: 0 And one more question: does PyFoam work with python 2.6 ? Thanks. Have a nice day, Ivana |
|
February 18, 2009, 12:37 |
Hi Ivana!
Thanks for the ba
|
#89 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Ivana!
Thanks for the back-trace. Could you tell me which solver has this additional output? Or even better: could you provide me the line from the output plus context (3 or 4 lines are sufficient) that is causing the trouble. 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 |
|
February 19, 2009, 06:42 |
About the other question: I'm
|
#90 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
About the other question: I'm regularily using pyFoam with python Versions ranging from 2.3 to 2.5. But I wouldn't see any reason why it shouldn't work with 2.6 (backward-compatibility of the python 2.x series is quite good). It definitely won't work with python 3.0
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 |
|
February 24, 2009, 09:09 |
Hello Bernhard,
1) pyFoam:
|
#91 |
New Member
Ivana B.
Join Date: Mar 2009
Posts: 4
Rep Power: 17 |
Hello Bernhard,
1) pyFoam: here is the log from OF-1.5-dev (tested with icoFoam): Time = 0.005 Courant Number mean: 0 max: 0 velocity magnitude: 0 PBiCG: Solving for Ux, Initial residual = 1, Final residual = 2.96338e-06, No Iterations 8 PBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 PCG: Solving for p, Initial residual = 1, Final residual = 7.55402e-07, No Iterations 35 time step continuity errors : sum local = 5.03809e-09, global = 1.94884e-19, cumulative = 1.94884e-19 PCG: Solving for p, Initial residual = 0.523591, Final residual = 9.72352e-07, No Iterations 34 time step continuity errors : sum local = 1.07766e-08, global = 4.49324e-19, cumulative = 6.44208e-19 ExecutionTime = 0.03 s ClockTime = 0 s here is the log file from OF-1.5.x (tested with icoFoam): Time = 0.005 Courant Number mean: 0 max: 0 DILUPBiCG: Solving for Ux, Initial residual = 1, Final residual = 2.96338e-06, No Iterations 8 DILUPBiCG: Solving for Uy, Initial residual = 0, Final residual = 0, No Iterations 0 DICPCG: Solving for p, Initial residual = 1, Final residual = 7.55402e-07, No Iterations 35 time step continuity errors : sum local = 5.03809e-09, global = 1.94884e-19, cumulative = 1.94884e-19 DICPCG: Solving for p, Initial residual = 0.523591, Final residual = 9.72352e-07, No Iterations 34 time step continuity errors : sum local = 1.07766e-08, global = 4.49324e-19, cumulative = 6.44208e-19 ExecutionTime = 0.03 s ClockTime = 0 s In OF-1.5-dev "velocity magnitude" output comes in all solvers sourcing CourantNo.H (see revision 949). 2) python 2.6 I have also thought that, but here is what I get: using pyFoamPlotWatcher.py: Traceback (most recent call last) File "/OpenFOAM/python/bin/pyFoamPlotWatcher.py", line 3, in <module> from PyFoam.Applications.PlotWatcher import PlotWatcher File "/OpenFOAM/python/lib64/python2.6/site-packages/PyFoam/Applications/PlotWatcher. py", line 6, in <module> from PyFoam.Execution.GnuplotRunner import GnuplotWatcher File "/OpenFOAM/python/lib64/python2.6/site-packages/PyFoam/Execution/GnuplotRunner.p y", line 86 with="steps", ^ SyntaxError: invalid syntax or using pyFoamPlotRunner.py: Traceback (most recent call last) File "/OpenFOAM/python/bin/pyFoamPlotRunner.py", line 3, in <module> from PyFoam.Applications.PlotRunner import PlotRunner File "/OpenFOAM/python/lib64/python2.6/site-packages/PyFoam/Applications/PlotRunner.p y", line 8, in <module> from PyFoam.Execution.GnuplotRunner import GnuplotRunner File "/OpenFOAM/python/lib64/python2.6/site-packages/PyFoam/Execution/GnuplotRunner.p y", line 86 with="steps", ^ SyntaxError: invalid syntax Thanks. Regards, Ivana |
|
February 24, 2009, 15:08 |
Hi Ivana!
@courant: I modif
|
#92 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Ivana!
@courant: I modified the regular expression that reads the Courant-line and it should work now @python2.6: That is the problem with the "with"-keyword that is new in Python2.6 and can't be used for variables anymore. I already fixed this in my local version (replacing it with "with_"), but in the last released version there is still "with" Both changes are now in the OF-extend SVN but you can also apply the two patches below: Try the patches in the PyFoam-directory with patch -p0 --dry-run <a.patch If its seems to work, remove --dry-run to apply the patch for real 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 |
|
February 24, 2009, 15:16 |
Hi Ivana!
@courant: I modif
|
#93 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Ivana!
@courant: I modified the regular expression that reads the Courant-line and it should work now @python2.6: That is the problem with the "with"-keyword that is new in Python2.6 and can't be used for variables anymore. I already fixed this in my local version (replacing it with "with_"), but in the last released version there is still "with" Both changes are now in the OF-extend SVN but you can also apply the two patches below: Try the patches in the PyFoam-directory with patch -p0 --dry-run <a.patch If its seems to work, remove --dry-run to apply the patch for real 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 |
|
February 24, 2009, 15:21 |
Fell again into the "I won't a
|
#94 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Fell again into the "I won't accept your attachments and I won't even ask where they are on your harddisk, but I'll gladly post your posting a second time" trap. I'll try to post the patches again
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 |
|
February 24, 2009, 16:00 |
Hi Ivana!
The MessageBoard
|
#95 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Ivana!
The MessageBoard hates me or I'm to stupid to attach-files. Don't want to know the truth, so my advice for you is to pull the patch for both problems with the following command (might take some time) and apply it: svn diff -r964 https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/other/scripting/PyFoam >cumulative.patch 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 |
|
February 25, 2009, 06:45 |
Hi Bernhard,
thanks for the
|
#96 |
New Member
Ivana B.
Join Date: Mar 2009
Posts: 4
Rep Power: 17 |
Hi Bernhard,
thanks for the fixes. "svn diff" did not work, but I did complete new "svn co" and installation. It works with python2.5 without problems, but with python2.6 I get empty graphs and following message (I tested pyFoamPlotWatcher.py and pyFoamPlotRunner.py with standard tutorial icoFoam/cavity): Warning: empty x range [0.005:0.005], adjusting to [0.00495:0.00505] Warning: empty y range [4.40722e-19:4.40722e-19], adjusting to [4.36315e-19:4.45129e-19] Warning: empty y2 range [4.40722e-19:4.40722e-19], adjusting to [4.36315e-19:4.45129e-19] Warning: empty x range [0.005:0.005], adjusting to [0.00495:0.00505] Warning: empty y range [1:1], adjusting to [0.99:1.01] Thanks. Regards, Ivana |
|
February 26, 2009, 09:59 |
Hi Ivana!
The "svn diff" ca
|
#97 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Ivana!
The "svn diff" can take some time (the sourceforge-server is not the fastest) About the 2.6-problem I'll have a look at 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 |
|
March 4, 2009, 04:08 |
Hey Bernhard!
First of all
|
#98 |
New Member
Josh Gambit
Join Date: Mar 2009
Posts: 2
Rep Power: 0 |
Hey Bernhard!
First of all thank you for your useful scripts within pyFoam. I have the same problem as Ivana (courant number ..) Since I have no Internet connection with my Linux I want to ask you, wheter there is a packed version of your patched pyFoam online? (got no Ftp-tool installed) |
|
March 4, 2009, 04:12 |
Hey Bernhard!
First of all
|
#99 |
New Member
Josh Gambit
Join Date: Mar 2009
Posts: 2
Rep Power: 0 |
Hey Bernhard!
First of all thank you for your useful scripts within pyFoam. I have the same problem as Ivana (courant number ..) Since I have no Internet connection with my Linux I want to ask you, wheter there is a packed version of your patched pyFoam online? (got no Ftp-tool installed) |
|
March 4, 2009, 05:42 |
Hi Ivana!
It (pyFoamPlotRun
|
#100 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Hi Ivana!
It (pyFoamPlotRunner.py) works with 2.6 for me. So this means that I fixed something else in my development version. Which means that I will upload a new release in the next weeks (as I was already planning to do). BTW: when starting pyFoamPlotRunner.py with python 2.6 do you get warnings about deprecated modules? @Aljoscha/Josh (identical posting under different names - that's a cool one): Go to http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/trunk/Breeder/ other/scripting/PyFoam/ and click on "Download Tarball" 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 |
|
|
|
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 |