CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[PyFoam] does not want to plot

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By mich_K
  • 1 Post By gschaider

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 10, 2014, 08:30
Default does not want to plot
  #1
Member
 
Michael Kruger
Join Date: Jul 2014
Location: South Africa
Posts: 38
Rep Power: 12
mich_K is on a distinguished road
When I run a case normally it runs fine.

However when I run it as pyFoamPlotRunner.py simpleFoam, it seems to run fine and creates a bunch of pyFoam files and directories in the case directory, but does not plot any of the required residuals. Gnuplot does not even open.

I am not getting any errors and do have gnuplot installed.

Any suggestions?

Thanks in advance.
vs1 likes this.
__________________
-------------------------------------------------------
Michael
mich_K is offline   Reply With Quote

Old   August 10, 2014, 17:35
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mich_K View Post
When I run a case normally it runs fine.

However when I run it as pyFoamPlotRunner.py simpleFoam, it seems to run fine and creates a bunch of pyFoam files and directories in the case directory, but does not plot any of the required residuals. Gnuplot does not even open.

I am not getting any errors and do have gnuplot installed.

Any suggestions?

Thanks in advance.
Look at the date of your posting: Gnuplot refuses to work on Sundays. PyFoam works on sundays but respects the right of Gnuplot to have a day off.

No seriously. I guess you did your research and it is not the well known "I work with Ubunutu where there is a gnuplot and a gnuplot-x11-package. The first is installed by default the second one is the one I want because it draws windows"-problem. Please check whether Gnuplot draws windows if used by itself. If that works (and only then) the problem is PyFoam. Is there ANY output in the beginning that could give a hint about the problem
vs1 likes this.
__________________
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
gschaider is offline   Reply With Quote

Old   August 10, 2014, 17:58
Default
  #3
Senior Member
 
anonymous
Join Date: Aug 2014
Posts: 205
Rep Power: 13
ssss is on a distinguished road
As explained by gschaider, you should be seeing an error at the start, which says something about "X11:missing"

To solve this run:

Code:
sudo apt-get install gnuplot-x11
After that you can run:

Code:
pyFoamPlotRunner simpleFoam
And it should work, although I would recommend you using

Code:
pyFoamRunner.py --progress simpleFoam
And after that run

Code:
pyFoamPlotWatcher.py --silent PyFoamRunner.simpleFoam.logfile --hardcopy
Which should give you nicer plots, and will have better performance in your simulation.
ssss is offline   Reply With Quote

Old   August 11, 2014, 03:24
Default
  #4
Member
 
Michael Kruger
Join Date: Jul 2014
Location: South Africa
Posts: 38
Rep Power: 12
mich_K is on a distinguished road
I agree it was unfair of me to ask gnuplot to work on a Sunday (-:

Thank you both sssss and gschaider for helping a newbie out. Success!

Another question on pyFoam,

how does the ClearCase command work?

When I run pyFoamClearCase.py in the case directory it gives an error and says I have to specify a parameter, what parameter is this?

Also, on another subject, might one of you be able to help me with these questions:

http://www.cfd-online.com/Forums/ope...r-surface.html

http://www.cfd-online.com/Forums/ope...lon-omega.html

http://www.cfd-online.com/Forums/mai...nce-study.html
__________________
-------------------------------------------------------
Michael
mich_K is offline   Reply With Quote

Old   August 11, 2014, 05:40
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by mich_K View Post
I agree it was unfair of me to ask gnuplot to work on a Sunday (-:

Thank you both sssss and gschaider for helping a newbie out. Success!

Another question on pyFoam,

how does the ClearCase command work?

When I run pyFoamClearCase.py in the case directory it gives an error and says I have to specify a parameter, what parameter is this?
The directory you want to clear. In your case a simple . will be sufficient.

It HAS been asked in the past whether I could make this utility run parameter-less, but I'm a strong believer in the second Zen of Python ("Explicit is better than implicit". See http://legacy.python.org/dev/peps/pep-0020/)

Quote:
Originally Posted by mich_K View Post
Due to time constraints I limit my answering to some topics (PyFoam is one of them, but these are not)
__________________
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
gschaider is offline   Reply With Quote

Old   August 11, 2014, 05:57
Default
  #6
Member
 
Michael Kruger
Join Date: Jul 2014
Location: South Africa
Posts: 38
Rep Power: 12
mich_K is on a distinguished road
Understandable.

Thanks Bernhard!
__________________
-------------------------------------------------------
Michael
mich_K is offline   Reply With Quote

Old   February 22, 2015, 15:59
Default
  #7
Member
 
Avdeev Evgeniy
Join Date: Jan 2011
Location: Togliatty, Russia
Posts: 69
Blog Entries: 1
Rep Power: 21
j-avdeev will become famous soon enough
Send a message via Skype™ to j-avdeev
Hello.
I have similar problem as mich_K. It is sunday and pyFoam does not want to plot.
I have installed pyFoam and gnuplot as "notroot" user to my home directory.
gnuplot works fine - after command "plot sin(x)" window appears.

But if I run pyFoamPlotRunner

Code:
]$ pyFoamPlotRunner.py potentialFoam
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.2                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.2.2-9739c53ec43f
Exec   : potentialFoam
Date   : Feb 22 2015
Time   : 22:41:38
Host   : "mgt1"
PID    : 21491
Case   : /home/avdeev/OpenFOAM/OpenFOAM-2.2.2/tutorials/basic/potentialFoam/pitzDaily
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Reading field p

Reading field U

No finite volume options present


Calculating potential flow
DICPCG:  Solving for p, Initial residual = 1, Final residual = 9.18464e-07, No Iterations 221
 PyFoam WARNING on line 142 of file /home/avdeev/python27/lib/python2.7/site-packages/PyFoam/LogAnalysis/GeneralLineAnalyzer.py : Problem doing timelines could not convert string to float:  
 PyFoam WARNING on line 142 of file /home/avdeev/python27/lib/python2.7/site-packages/PyFoam/LogAnalysis/GeneralLineAnalyzer.py : Problem doing timelines could not convert string to float:  
continuity error = 1.60712e-05
Interpolated U error = 0.000110442
ExecutionTime = 0.29 s  ClockTime = 1 s
 PyFoam WARNING on line 142 of file /home/avdeev/python27/lib/python2.7/site-packages/PyFoam/LogAnalysis/GeneralLineAnalyzer.py : Problem doing timelines could not convert string to float:  

End
pyFoam makes files, but no plot windows

Code:
$ ls
0         Allrun                pitzDaily.foam                      PyFoamServer.info           PyFoamState.StartedAt
0.org     constant              PyFoamHistory                       PyFoamState.CurrentTime     PyFoamState.TheState
Allclean  Gnuplotting.analyzed  PyFoamRunner.potentialFoam.logfile  PyFoamState.LastOutputSeen  system
And also I have no Qt installed - is it matter?

Code:
$ pyFoamVersion.py 
Machine info: Linux | mgt1 | 2.6.18-398.el5 | #1 SMP Tue Aug 12 06:26:17 EDT 2014 | x86_64 | x86_64

Python version: 2.7.7 (default, Jun 27 2014, 12:11:28) 
[GCC 4.5.2]

Python executable: /home/avdeev/python27/bin/python

Python 2.7 is one development platform for PyFoam (along with Python 3)
PYTHONPATH: /home/avdeev/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/Utilities/VTKPythonWrapping:/home/avdeev/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/lib/paraview-3.12:/home/avdeev/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/Utilities/VTKPythonWrapping:/home/avdeev/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/lib/paraview-3.12:/home/avdeev/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/Utilities/VTKPythonWrapping:/home/avdeev/OpenFOAM/ThirdParty-2.2.2/platforms/linux64Gcc45/paraview-3.12.0/lib/paraview-3.12

Location of this utility: /home/avdeev/my_python/bin/pyFoamVersion.py

 PyFoam WARNING on line 192 of file /home/avdeev/python27/lib/python2.7/site-packages/PyFoam/FoamInformation.py : Basedir /home/avdeev/foam for fork extend does not exist or is not a directory 
Version 2.2.2 Fork openfoam of the installed 3 versions:
openfoam-2.1.1 : /home/avdeev/OpenFOAM/OpenFOAM-2.1.1
openfoam-2.2.0 : /home/avdeev/OpenFOAM/OpenFOAM-2.2.0
openfoam-2.2.2 : /home/avdeev/OpenFOAM/OpenFOAM-2.2.2

pyFoam-Version: 0.6.4
ALERT: Reported version (0, 6, 4) is different from hardcoded version (0, 6, 4, 'development') -> probably inconsistent library installation

Path where PyFoam was found (PyFoam.__path__) is ['/home/avdeev/python27/lib/python2.7/site-packages/PyFoam']

Configuration search path: [('file', '/etc/pyFoam/pyfoamrc'), ('directory', '/etc/pyFoam/pyfoamrc.d'), ('file', '/home/avdeev/.pyFoam/pyfoamrc'), ('directory', '/home/avdeev/.pyFoam/pyfoamrc.d')]
Configuration files (used): []

Installed libraries:
cython               :  No 	 Not used. Maybe will by used later to spped up parts of PyFoam 
cProfile             :  Yes 
docutils             :  No 	 Not necessary. Needed for RestructuredText to HTML conversion 
Gnuplot              :  No 	 Not a problem. Version from ThirdParty is used 
hotshot              :  Yes 
ipdb                 :  No 	 Not necessary. Only makes debugging more comfortable 
IPython              :  No 	 Not necessary. But the interactive shell may be more comfortable 
matplotlib           :  No 	 Only Gnuplot-plotting possible 
mercurial            :  No 	 Not a problem. Used for experimental case handling 
nose                 :  No 	 Only needed for running the unit-tests (developers only) 
numpy                :  Yes 	 version: 1.8.1 
openpyxl             :  No 	 Not a problem. Only used for exporting pandas-data to Excel-files (advanced) 
pandas               :  No 	 Not a problem. Only used for handling of advanced data-handling 
ply                  :  No 	 Not a problem. Version from ThirdParty is used 
profile              :  Yes 
psyco                :  No 	 Not a problem. Acceleration not possible 
PyQt4                :  No 	 Only some experimental GUI-stuff relies on this 
PyQt4.Qwt5           :  No 	 Only an alternate plotting back-end 
scipy                :  No 	 Not yet used. Possibly use signal-fitting etc 
Tkinter              :  No 	 Not a problem. Used for the old version of DisplayBlockmesh and some matplotlib-implementations 
twisted              :  No 	 Not yet used. Possibly reimplement MetaServer with it 
vtk                  :  No 	 Not a problem. Only used for some utilities 
xlwt                 :  No 	 Not a problem. Only used for exporting pandas-data to Excel-files 
xlrd                 :  No 	 Not a problem. Only used for importing Excel-files to pandas-data 

Library locations
cProfile             : /home/avdeev/python27/lib/python2.7/cProfile.pyc
hotshot              : /home/avdeev/python27/lib/python2.7/hotshot/__init__.pyc
numpy                : /home/avdeev/python27/lib/python2.7/site-packages/numpy/__init__.pyc
profile              : /home/avdeev/python27/lib/python2.7/profile.pyc

Checking additional envirnoment variables

Checking for PYFOAM_DIR : Location of the PyFoam-installation. Not strictly necessary
PYFOAM_DIR missing from environment

Checking for PYFOAM_SITE_DIR : Location of non-PyFoam-disctributions script. Set and used by some Foam-distributions
PYFOAM_SITE_DIR missing from environment
Thanks in advance.
j-avdeev is offline   Reply With Quote

Reply

Tags
pyfoam, simplefoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Contribute a forceCoeff plot and merge utility lakeat OpenFOAM Running, Solving & CFD 5 October 5, 2018 23:48
XY plot is not showing the surfaces I need to plot for. rnb13143 FLUENT 0 April 4, 2017 11:09
[OpenFOAM] Convergence validation with Plot Over Time jam68 ParaView 1 February 11, 2017 18:05
[swak4Foam] Foam warnings - related to swak4Foam Salam-H OpenFOAM Community Contributions 20 August 2, 2015 16:40
graph plot anindya Main CFD Forum 2 September 17, 2003 13:00


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