|
[Sponsors] |
![]() |
![]() |
#221 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
python -c "import PyFoam" If nothing happens your installation is OK |
||
![]() |
![]() |
![]() |
![]() |
#222 |
New Member
Join Date: Oct 2009
Location: Germany
Posts: 20
Rep Power: 16 ![]() |
Hi Bernhard,
thank you for your prompt help. I got my error: Wiki gives following path: export PYTHONPATH=/home/nonroot/my_python/lib/python-2.3/site-packages:$PYTHONPATHAccording to my directories I changed the path. But in the lib-directory the sub directory was "python2.6" and not "python-2.6". So the error was just the "-" character. Best regards Marc ![]() |
|
![]() |
![]() |
![]() |
![]() |
#223 |
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 17 ![]() |
Hi,
I can't resolve how to specify the case/logfile name in PlotWatcher. In my script casePath variable holds the (absolute) path for the directory which should be analyzed. Decomposer have no complaints with: Code:
Decomposer(args=["--progress","--method=simple","--n=2,1,1","--delta=1e-4",casePath,2]) Code:
PlotWatcher(args=["--solver-not-running-anymore",casePath) Code:
logfile = path.join(casePath,"PyFoamRunner.icoFoam.logfile") PlotWatcher(args=["--solver-not-running-anymore",logfile) |
|
![]() |
![]() |
![]() |
![]() |
#224 |
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 17 ![]() |
My bad, it was a typo - the ending square bracket of args was missing.
![]() Code:
from PyFoam.Applications.PlotWatcher import PlotWatcher logfile = path.join(casePath,"PyFoamRunner.icoFoam.logfile") if (path.isfile(logfile)): PlotWatcher(args=["--silent","--solver-not-running-anymore","--hardcopy","--format-of-hardcopy=pdf",logfile]) |
|
![]() |
![]() |
![]() |
![]() |
#225 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
![]() - have a look wheter the --prefix-hardcopy-option can be abused for that - write an enhancement bug report and hope for the best - implement it yourself and submit a patch Last edited by gschaider; July 18, 2011 at 10:21. Reason: Insert Newlines that were swallowed from the original |
||
![]() |
![]() |
![]() |
![]() |
#226 |
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 17 ![]() |
Thank you, so I guess it's about time I delve into python coding.
![]() |
|
![]() |
![]() |
![]() |
![]() |
#227 |
Member
Tibor Nyers
Join Date: Jul 2010
Location: Hungary
Posts: 91
Rep Power: 17 ![]() |
Can someone give me a hint how to use ParsedParameterFile with controlDict. I have checked the "Automatization with pyFoam" pdf, but couldn't deduce the solution.
Code:
controlFile = ParsedParameterFile( path.join(work.initialDir(),"system","controlDict") ) #set a new solver (application) here conrolFile.writeFile() ![]() Thx! OMG, I really need a sleep! Code:
controlFilePath = path.abspath(path.join(casePath,"system","controlDict")) controlFile = ParsedParameterFile(controlFilePath) controlFile["application"] = "myFoam" controlFile.writeFile() Last edited by Toorop; July 28, 2011 at 11:32. Reason: Solution |
|
![]() |
![]() |
![]() |
![]() |
#228 |
Member
Logan Page
Join Date: Sep 2010
Posts: 38
Rep Power: 15 ![]() |
Hi Foamers
I am really hoping someone can help me with this problem. I'm using the pyFoamPlotRunner module of PyFoam with the "--steady-run" option (i.e. steady-state problem). From the attached plot and the output from the solver you can see that the residuals are below the specified tolerances in the fvSolution file: T: 1e-04 U: 1e-03 pd: 1e-04 The problem is that the pyFoamPlotRunner didn't terminate the simulation. I get the following msg in the terminal: "PyFoam WARNING on line 320 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/BasicRunner.py : Stopping run at next write " But it the continues to run the simulation to the endTime in the controlDict file. Any possible reason for this ??? Code:
Time = 5995 DILUPBiCG: Solving for T, Initial residual = 9.96799e-05, Final residual = 9.96799e-05, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1.20307e-05, Final residual = 1.20307e-05, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 1.1291e-05, Final residual = 1.1291e-05, No Iterations 0 DICPCG: Solving for pd, Initial residual = 0.000109391, Final residual = 9.08461e-05, No Iterations 3 time step continuity errors : sum local = 3.94991e-05, global = 5.374e-06, cumulative = 0.00253859 ExecutionTime = 109.27 s ClockTime = 110 s Time = 5996 DILUPBiCG: Solving for T, Initial residual = 9.96901e-05, Final residual = 9.96901e-05, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1.26358e-05, Final residual = 1.26358e-05, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 1.11147e-05, Final residual = 1.11147e-05, No Iterations 0 DICPCG: Solving for pd, Initial residual = 9.33589e-05, Final residual = 9.33589e-05, No Iterations 0 time step continuity errors : sum local = 4.05917e-05, global = 4.34201e-06, cumulative = 0.00254293 ExecutionTime = 109.28 s ClockTime = 110 s Time = 5997 DILUPBiCG: Solving for T, Initial residual = 9.96888e-05, Final residual = 9.96888e-05, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1.25973e-05, Final residual = 1.25973e-05, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 1.10894e-05, Final residual = 1.10894e-05, No Iterations 0 DICPCG: Solving for pd, Initial residual = 9.54102e-05, Final residual = 9.54102e-05, No Iterations 0 time step continuity errors : sum local = 4.14834e-05, global = 2.98703e-06, cumulative = 0.00254592 ExecutionTime = 109.29 s ClockTime = 110 s Time = 5998 DILUPBiCG: Solving for T, Initial residual = 9.96934e-05, Final residual = 9.96934e-05, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1.25635e-05, Final residual = 1.25635e-05, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 1.10723e-05, Final residual = 1.10723e-05, No Iterations 0 DICPCG: Solving for pd, Initial residual = 0.000100084, Final residual = 8.60074e-05, No Iterations 3 time step continuity errors : sum local = 3.7395e-05, global = 1.43804e-06, cumulative = 0.00254735 ExecutionTime = 109.31 s ClockTime = 110 s Time = 5999 DILUPBiCG: Solving for T, Initial residual = 9.97056e-05, Final residual = 9.97056e-05, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1.28526e-05, Final residual = 1.28526e-05, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 1.10423e-05, Final residual = 1.10423e-05, No Iterations 0 DICPCG: Solving for pd, Initial residual = 8.5294e-05, Final residual = 8.5294e-05, No Iterations 0 time step continuity errors : sum local = 3.70849e-05, global = 2.18425e-07, cumulative = 0.00254757 ExecutionTime = 109.32 s ClockTime = 110 s Time = 6000 DILUPBiCG: Solving for T, Initial residual = 9.97047e-05, Final residual = 9.97047e-05, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 1.27986e-05, Final residual = 1.27986e-05, No Iterations 0 DILUPBiCG: Solving for Uy, Initial residual = 1.10194e-05, Final residual = 1.10194e-05, No Iterations 0 DICPCG: Solving for pd, Initial residual = 8.84995e-05, Final residual = 8.84995e-05, No Iterations 0 time step continuity errors : sum local = 3.84785e-05, global = -1.15081e-06, cumulative = 0.00254642 ExecutionTime = 109.33 s ClockTime = 110 s End Last edited by Logan Page; August 4, 2011 at 09:30. Reason: more info |
|
![]() |
![]() |
![]() |
![]() |
#229 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
Am a bit busy at the moment, but a bug-report would remind me to have a look at it |
||
![]() |
![]() |
![]() |
![]() |
#230 |
Member
Logan Page
Join Date: Sep 2010
Posts: 38
Rep Power: 15 ![]() |
Thanks Bernhard
I'll add a bug report. I tried the running the pyFoamSteadyRunner directly from the terminate for my case and i got the same issue. Terminal msg: "t = 2880 PyFoam WARNING on line 320 of file /usr/local/lib/python2.7/dist-packages/PyFoam/Execution/BasicRunner.py : Stopping run at next write" next write time would be t = 3000, but it continued to endTime in controlDict file. Not sure if its a bug or if its something I havn't setup properly. |
|
![]() |
![]() |
![]() |
![]() |
#231 |
Member
Logan Page
Join Date: Sep 2010
Posts: 38
Rep Power: 15 ![]() |
I just ran both pyFoamSteadyRunner and pyFoamPlotRunner["--steady-run"] for the icoFoam/cavityGrade tutorial problem and they both worked perfectly, as expected.
![]() I cant figure out why, for my case, the simulation is not stopped. Would a erratic behaviour of one of residuals affect it ???? In other words a few iterations its below the tolerance then a few iterations afterwards its above the tolerance. |
|
![]() |
![]() |
![]() |
![]() |
#232 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#233 | |
Member
Logan Page
Join Date: Sep 2010
Posts: 38
Rep Power: 15 ![]() |
Quote:
Hi Bernhard I tracked down what was wrong. It was a set-up issue on my part with the controlDict file. In short: I copied any old controlDict from a previous case of mine. I then formatted it neatly, aligning columns etc. Unfortunetly I ended up both tabs and spaces separating the parameters and values in the controlDict file, i.e. [parameter]\t\t\t____[value] This was causing that PyFoam wasn't updating the controlDict file at all. It now works 100% with that corrected. Two thumbs up for this awesome set of tools. I apologise if I wasted any of your time. |
||
![]() |
![]() |
![]() |
![]() |
#234 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
|
||
![]() |
![]() |
![]() |
![]() |
#235 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
||
![]() |
![]() |
![]() |
![]() |
#236 |
Member
Logan Page
Join Date: Sep 2010
Posts: 38
Rep Power: 15 ![]() |
||
![]() |
![]() |
![]() |
![]() |
#237 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Thanks. Also thanks for suggesting a fix (everybody interested myay have a look at http://sourceforge.net/apps/mantisbt...view.php?id=86)
|
|
![]() |
![]() |
![]() |
![]() |
#238 |
Member
Robert Ong
Join Date: Aug 2010
Posts: 86
Rep Power: 16 ![]() |
Hi All,
Sorry for the newbie question. I got a very similar error to the post #1 trying to run Code:
roberto@roberto:~/Desktop/mesh_test1$ pyFoamDisplayBlockMesh.py constant/polyMesh/blockMeshDict Code:
Traceback (most recent call last): File "/home/roberto/OpenFOAM/PyFoam-0.5.6/bin/pyFoamDisplayBlockMesh.py", line 7, in <module> from PyFoam.Error import warning ImportError: No module named PyFoam.Error Robert |
|
![]() |
![]() |
![]() |
![]() |
#239 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 ![]() ![]() |
Quote:
I don't think so. Seems to me that PyFoam is not in the PYTHONPATH Could you please check your installation with pyFoamVersion.py and report what you see? |
||
![]() |
![]() |
![]() |
![]() |
#240 |
Member
Robert Ong
Join Date: Aug 2010
Posts: 86
Rep Power: 16 ![]() |
Hi Bernhard,
I've set the PyFOam in the right PYTHONPATH Now, when I tried pyFoamDisplayBlockMesh.py constant/polyMesh/blockMeshDict It gives me Code:
Error in /home/roberto/OpenFOAM/PyFoam-0.5.6/bin/pyFoamDisplayBlockMesh.py : PyFoam FATAL ERROR on line 26 of file /home/roberto/OpenFOAM/PyFoam-0.5.6/PyFoam/Applications/DisplayBlockMesh.py: Error while importing modules: No module named libvtkCommonPython The pyFaomVersion.py gives me Code:
PYTHONPATH: //home/roberto/OpenFOAM/PyFoam-0.5.6/lib/python-2.7/site-packages: OpenFOAM (1, 7, 'x') of the installed versions ['2.0.x', '1.7.x'] pyFoam-Version: 0.5.6 Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/roberto/.pyFoam/pyfoamrc'), ('directory', '/home/roberto/.pyFoam/pyfoamrc.d')] Configuration files (used): [] 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 : Yes matplotlib : Yes psyco : No Not a problem. Acceleration not possible hotshot : Yes profile : No Not a problem. Can't profile using this library cProfile : Yes PyQt4 : No Only some experimental GUI-stuff relies on this PyQt4.Qwt5 : No Only an alternate plotting back-end vtk : No Not a problem. Only used for some utilities Tkinter : Yes mercurial : No Not a problem. Used for experimental case handling Have a nice day Regards, Robert |
|
![]() |
![]() |
![]() |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Divergence detected in AMG solver: k when udf loaded | google9002 | Fluent UDF and Scheme Programming | 3 | November 7, 2019 23:34 |
udf problem | jane | Fluent UDF and Scheme Programming | 37 | February 20, 2018 04:17 |
Guide: Getting Started with the CFD Online Discussion Forums | pete | Site Help, Feedback & Discussions | 8 | July 29, 2016 05:00 |
Error messages | atg | enGrid | 7 | August 30, 2013 11:16 |
Phase locked average in run time | panara | OpenFOAM | 2 | February 20, 2008 14:37 |