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

Plot Data from Probes

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2014, 15:59
Default
  #21
Senior Member
 
Timofey Mukha
Join Date: Mar 2012
Location: Stockholm, Sweden
Posts: 118
Rep Power: 14
tiam is on a distinguished road
Hi!

Have no idea why I didn't get that debugging idea, I guess the script fails on me totally or it works for everything. So it works on all fields but UPrime2Mean!

It looks like this:
# x 1.5 1.5 1.5 1.5 1.5 1.5
# y 0 0.1 0.2 0.3 0.4 0.5
# z 1.5 1.5 1.5 1.5 1.5 1.5
# Time
0.2 (0 0 0 0 0 0) (0 0 0 0 0 0) (0 0 0 0 0 0)
0.4 (2.7993e-08 -7.77667e-10 1.05859e-08 2.16042e-11 -2.94084e-10 4.00318e-09)
0.6 (3.17292e-08 -1.45928e-09 1.17226e-08 8.21429e-11 -5.31962e-10 4.33446e-09)
0.8 (2.85533e-08 -1.82099e-09 1.0425e-08 1.72582e-10 -6.48406e-10 3.81149e-09)
1 (2.40662e-08 -1.85896e-09 8.91598e-09 2.70264e-10 -7.08062e-10 3.32037e-09)
1.2 (2.01257e-08 -1.64986e-09 7.54823e-09 3.69006e-10 -7.58858e-10 2.96515e-09)
tiam is offline   Reply With Quote

Old   March 20, 2014, 17:33
Default
  #22
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 tiam View Post
Hi!

Have no idea why I didn't get that debugging idea, I guess the script fails on me totally or it works for everything. So it works on all fields but UPrime2Mean!

It looks like this:
# x 1.5 1.5 1.5 1.5 1.5 1.5
# y 0 0.1 0.2 0.3 0.4 0.5
# z 1.5 1.5 1.5 1.5 1.5 1.5
# Time
0.2 (0 0 0 0 0 0) (0 0 0 0 0 0) (0 0 0 0 0 0)
0.4 (2.7993e-08 -7.77667e-10 1.05859e-08 2.16042e-11 -2.94084e-10 4.00318e-09)
0.6 (3.17292e-08 -1.45928e-09 1.17226e-08 8.21429e-11 -5.31962e-10 4.33446e-09)
0.8 (2.85533e-08 -1.82099e-09 1.0425e-08 1.72582e-10 -6.48406e-10 3.81149e-09)
1 (2.40662e-08 -1.85896e-09 8.91598e-09 2.70264e-10 -7.08062e-10 3.32037e-09)
1.2 (2.01257e-08 -1.64986e-09 7.54823e-09 3.69006e-10 -7.58858e-10 2.96515e-09)
OK. That explains it. That is a tensor field and that class only supports scalars and vectors
__________________
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   March 22, 2014, 05:12
Default
  #23
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 gschaider View Post
OK. That explains it. That is a tensor field and that class only supports scalars and vectors
The attached patch tries to make PyFoam more tolerant about this (it ignores, warns, but doesn't fail)

PyFoam_tolerantProbes.patch
__________________
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   February 4, 2016, 07:18
Default
  #24
Senior Member
 
ArielJ
Join Date: Aug 2015
Posts: 127
Rep Power: 10
arieljeds is on a distinguished road
Hi, I couldn't find a more relevant thread so I am reviving this one.

I am trying to use pyFoamTimelinePlot.py to plot values from probes but I can find NOTHING except for this thread to help me understand how to use it.

First of all, here is my probeDict file:

Code:
       fields
        (
            p_rgh
            p
	    U
	    Ux
	    Uy
	    Uz
	    magU
	    vorticity
	    Co
        );

// Locations to be probed. runTime modifiable!
        probeLocations
        (
            ( -4     0     0 )	// 1 - inlet, in relaxation zone
            ( -2     0     0 )	// 2 - upstream
            ( -0.52  0     0 )	// 3 - upstream 
            (  0.52  0     0 )	// 4 - at the larger radius 
            (  2     0     0 )	// 5 - 
            ( -4     0     0 )	// 6 
            (  0     0.52  0 )	// 7 
            (  0    -0.52  0 )	// 8 
            (  0     3.9   0 )	// 9
            (  0     3.9   0 )	// 10 
            (  0.37  0.37  0 )	// 11
            ( -0.37  0.37  0 )	// 12
            ( -0.37 -0.37  0 )  // 13
            (  0.37 -0.37  0 )  // 14
           
        );
I am then trying the following things:

1) This command DOES work:
Code:
pyFoamTimelinePlot.py --fields=p_rgh --basic-mode=lines postProcessing/ | gnuplot
This produces a plot of, for example, the p_rgh field. However, this is not that useful because it is plotting ALL of the probes.

2) This command DID work but is now giving the error listed below:

Code:
pyFoamTimelinePlot.py --fields=p_rgh --basic-mode=lines --csv-file=p_rgh.csv postProcessing/
This has worked for me previously but is now giving:

Code:
Traceback (most recent call last):
  File "/usr/local/bin/pyFoamTimelinePlot.py", line 5, in <module>
    pkg_resources.run_script('PyFoam==0.6.5', 'pyFoamTimelinePlot.py')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam-0.6.5-py2.7.egg/EGG-INFO/scripts/pyFoamTimelinePlot.py", line 5, in <module>
    TimelinePlot()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam-0.6.5-py2.7.egg/PyFoam/Applications/TimelinePlot.py", line 34, in __init__
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/PyFoam-0.6.5-py2.7.egg/PyFoam/Applications/PyFoamApplication.py", line 424, in __init__
    result=self.run()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam-0.6.5-py2.7.egg/PyFoam/Applications/TimelinePlot.py", line 463, in run
    spread=plots[0][-1]()
  File "/usr/local/lib/python2.7/dist-packages/PyFoam-0.6.5-py2.7.egg/PyFoam/RunDictionary/TimelineDirectory.py", line 353, in __call__
    title="%s_t=%s" % (self.val,self.time))
  File "/usr/local/lib/python2.7/dist-packages/PyFoam-0.6.5-py2.7.egg/PyFoam/Basics/SpreadsheetData.py", line 138, in __init__
    dtype=list(zip(names,['f8']*len(names))))
ValueError: two fields with the same name
This error and producing no output.

Therefore, I have two specific questions for plotting values at probes:

1) Is it possible to use pyFoamTimelinePlot to specify which probe to plot at? And how would I do this?

2) Has anyone had experience with the error above? I don't understand it at all because this was working for a different case and I can't see where I've gone differently.

Any help or advice is much appreciated... I've been spending a loooooong time on this now and getting frustrated with the lack of documentation (aside from the code itself)
arieljeds 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
How to plot the data made by java? jelon STAR-CCM+ 2 April 11, 2010 06:00
How to save 2-D data in contour plot mssound FLUENT 0 February 15, 2010 14:01
[OpenFOAM] How to create an contour plot for arbitrary plane with interpolated data navaladi ParaView 0 June 4, 2008 07:57
xy data from graph plot to excel Radhika Siemens 5 February 23, 2007 07:23
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 17:27


All times are GMT -4. The time now is 06:25.