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

pyFoamSamplePlot not working with 1.6?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   March 31, 2010, 09:51
Default pyFoamSamplePlot not working with 1.6?
  #1
New Member
 
Christian Schaad
Join Date: Mar 2010
Posts: 3
Rep Power: 8
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, 10:34
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,920
Rep Power: 41
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, 11:54
Default
  #3
New Member
 
Christian Schaad
Join Date: Mar 2010
Posts: 3
Rep Power: 8
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, 13:21
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,920
Rep Power: 41
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, 17:27
Default
  #5
New Member
 
Christian Schaad
Join Date: Mar 2010
Posts: 3
Rep Power: 8
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, 18:30
Default
  #6
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,920
Rep Power: 41
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

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
k-omega-SST model (OF 1.6) - turbulent flat plate cboss OpenFOAM Running, Solving & CFD 24 February 24, 2016 04:52
Sample Utility not working in OpenFoam 1.6 titio OpenFOAM Post-Processing 6 November 15, 2014 19:04
Sample Utility not working in OpenFoam 1.6 titio OpenFOAM Post-Processing 0 February 5, 2010 13:12
Troubles installing OF 1.6 on Opensuse 11.1 magnounibo OpenFOAM Installation 1 November 28, 2009 14:12
force function not working in OF 1.6 franzisko OpenFOAM 3 August 4, 2009 14:24


All times are GMT -4. The time now is 22:51.