CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [PyFoam] does not want to plot (https://www.cfd-online.com/Forums/openfoam-community-contributions/140193-does-not-want-plot.html)

mich_K August 10, 2014 07:30

does not want to plot
 
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.

gschaider August 10, 2014 16:35

Quote:

Originally Posted by mich_K (Post 505240)
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

ssss August 10, 2014 16:58

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.

mich_K August 11, 2014 02:24

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

gschaider August 11, 2014 04:40

Quote:

Originally Posted by mich_K (Post 505305)
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 (Post 505305)

Due to time constraints I limit my answering to some topics (PyFoam is one of them, but these are not)

mich_K August 11, 2014 04:57

Understandable.

Thanks Bernhard!

j-avdeev February 22, 2015 14:59

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.


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