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

[PyFoam] pyFoamSamplePlot not working with 1.6?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 31, 2010, 10:51
Default pyFoamSamplePlot not working with 1.6?
  #1
New Member
 
Christian Schaad
Join Date: Mar 2010
Posts: 3
Rep Power: 16
cschaad is on a distinguished road
I am working with OF-1.6 and really happy with pyFoam from the svn-repository.

I am not sure, if I'm doing something wrong or if pyFoamSamplePlot is not compatible with OF-1.6.

pyFoamSamplePlot is looking for a "samples" directory instead of the "sets" directory created by the sample command. Creating a soft link from sets to samples leads to the following error message:

PyFoam FATAL ERROR on line 123 of file OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py : At least one line has to be specified. Found were ['data', 'data1', 'data2', 'data3']

My sampleDict contains:

interpolationScheme cellPoint;

setFormat raw;

sets
(
data3
{
type uniform;
axis distance;
start ( 1.3 0.028 0 );
end ( 1.3 -2 0 );
nPoints 1000;
}
.....);
surfaces ();

fields ( U );

Does anyone have similar problems or am I doing something wrong?
cschaad is offline   Reply With Quote

Old   March 31, 2010, 11:34
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 cschaad View Post
I am working with OF-1.6 and really happy with pyFoam from the svn-repository.

I am not sure, if I'm doing something wrong or if pyFoamSamplePlot is not compatible with OF-1.6.

pyFoamSamplePlot is looking for a "samples" directory instead of the "sets" directory created by the sample command. Creating a soft link from sets to samples leads to the following error message:

PyFoam FATAL ERROR on line 123 of file OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py : At least one line has to be specified. Found were ['data', 'data1', 'data2', 'data3']

My sampleDict contains:

interpolationScheme cellPoint;

setFormat raw;

sets
(
data3
{
type uniform;
axis distance;
start ( 1.3 0.028 0 );
end ( 1.3 -2 0 );
nPoints 1000;
}
.....);
surfaces ();

fields ( U );

Does anyone have similar problems or am I doing something wrong?
Have you had a look at the documentation the --help-option gives you? An excerpt from that is
Code:
Data
----
Select the data to plot

--line=LINE             Thesample line from which data is plotted (can be used
                        more than once)
--field=FIELD           The fields that are plotted (can be used more than
                        once). If none are specified all found fields are used
--directory-name=DIRNAME
                        Alternate name for the directory with the samples
                        (Default: samples)
This means
  1. That the symbolic link was not necessary (just say "--dir=sets" and you're ready to go
  2. The error message should be clear: specify at least on line (for instance "--line=data1", but you can also use several "--line=data1 --line=data2"
I hope you're aware that the utility itself doesn't plot anything. It just generates the appropriate gnuplot commands (but piping the output directly into gnuplot produces the pictures)

Bernhard

PS: Any hints how to improve the help-texts are welcome. User provided usage-examples on the Wiki are even more welcome
gschaider is offline   Reply With Quote

Old   March 31, 2010, 12:54
Default
  #3
New Member
 
Christian Schaad
Join Date: Mar 2010
Posts: 3
Rep Power: 16
cschaad is on a distinguished road
Hello Bernhard,

Thank You for your quick answer.
I already tried the options. So, the error message I get when I do

pyFoamSamplePlot.py --dir=sets --line=data1 --time=10000 .

is:

Traceback (most recent call last):
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/bin/pyFoamSamplePlot.py", line 5, in <module>
SamplePlot()
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 27, in __init__
interspersed=True)
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/PyFoamApplication.py", line 138, in __init__
self.run()
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 247, in run
if abs(vRange[0]-vRange[1])>1e-5*max(abs(vRange[0]),abs(vRange[1])) and max(abs(vRange[0]),abs(vRange[1]))>1e-10:
TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'

Or am I still doing something wrong?
cschaad is offline   Reply With Quote

Old   March 31, 2010, 14:21
Default
  #4
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 cschaad View Post
Hello Bernhard,

Thank You for your quick answer.
I already tried the options. So, the error message I get when I do

pyFoamSamplePlot.py --dir=sets --line=data1 --time=10000 .

is:

Traceback (most recent call last):
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/bin/pyFoamSamplePlot.py", line 5, in <module>
SamplePlot()
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 27, in __init__
interspersed=True)
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/PyFoamApplication.py", line 138, in __init__
self.run()
File "/home/chrisso/OpenFOAM/ThirdParty-1.6/pyfoam/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 247, in run
if abs(vRange[0]-vRange[1])>1e-5*max(abs(vRange[0]),abs(vRange[1])) and max(abs(vRange[0]),abs(vRange[1]))>1e-10:
TypeError: unsupported operand type(s) for -: 'tuple' and 'tuple'

Or am I still doing something wrong?
Try selecting with the --field-option only one field at a time (check with --info which fields are available). I'm afraid the problem is U (or some other vector-field)

Bernhard
gschaider is offline   Reply With Quote

Old   March 31, 2010, 18:27
Default
  #5
New Member
 
Christian Schaad
Join Date: Mar 2010
Posts: 3
Rep Power: 16
cschaad is on a distinguished road
Now I got it. It's working with scalar fields, but not with a vector field, in my case U.
Sadly, U.component(0) is not working with the sample utility, like mentioned here:
http://www.cfd-online.com/Forums/openfoam/72445-sample-utility-not-working-openfoam-1-6-a.html

Thank You anyway for your really powerful pyFoam,

Christian
cschaad is offline   Reply With Quote

Old   March 31, 2010, 19:30
Default
  #6
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 cschaad View Post
Now I got it. It's working with scalar fields, but not with a vector field, in my case U.
Sadly, U.component(0) is not working with the sample utility, like mentioned here:
http://www.cfd-online.com/Forums/openfoam/72445-sample-utility-not-working-openfoam-1-6-a.html

Thank You anyway for your really powerful pyFoam,

Christian
But it should (work with vector fields). If a bug report appears at
http://sourceforge.net/apps/mantisbt...e_status_id=90
I will see what I can do for the next release (can't promise anything though)

Bernhard
gschaider is offline   Reply With Quote

Reply


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
solver is working in windows but not in linux jbseo CFX 0 August 30, 2016 01:20
k-omega-SST model (OF 1.6) - turbulent flat plate cboss OpenFOAM Running, Solving & CFD 25 August 9, 2016 10:53
[OpenFOAM.com] [v3.0+] not working anymore (note: was missing entry in .bashrc) Jambne OpenFOAM Installation 1 May 29, 2016 15:37
Is there any institutions still working on solving N-S equations? sharonyue Main CFD Forum 2 November 11, 2015 09:23
DPM parallel is not working but serial is working johnwinter FLUENT 1 March 27, 2012 03:01


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