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

How to plot the sampled line over time under sets/

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 6, 2013, 05:20
Default How to plot the sampled line over time under sets/
  #1
Member
 
Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 74
Blog Entries: 1
Rep Power: 6
tfuwa is on a distinguished road
Hi OFers,

The pressure over a line has been sampled in the sets directory distributed in many time directories. I would like to plot the changes of the pressure over time on the fixed line. Is there any tool to do this?

Thanks a lot.
__________________
Kind regards,

Albert
tfuwa is offline   Reply With Quote

Old   February 6, 2013, 19:49
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tfuwa View Post
Hi OFers,

The pressure over a line has been sampled in the sets directory distributed in many time directories. I would like to plot the changes of the pressure over time on the fixed line. Is there any tool to do this?

Thanks a lot.
pyFoamSamplePlot.py from http://openfoamwiki.net/index.php/Contrib_PyFoam

Actually. It doesn't plot. It only generates the commands for gnuplot. But that is not a problem as you've only got to pipe the output into gnuplot ("pyFoamSamplePlot.py .... | gnuplot") to get a bunch of pictures. These you can animate with "animate" or encode them into a video
__________________
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 6, 2013, 21:46
Default
  #3
Member
 
Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 74
Blog Entries: 1
Rep Power: 6
tfuwa is on a distinguished road
Thanks Bernhard, for your quick reply and tips on how to use gnuplot. As I want to plot a 2D picture with x being time, y being the line and pressure in the 2D area, so I am trying to combine all the files in sets/ together.
__________________
Kind regards,

Albert
tfuwa is offline   Reply With Quote

Old   February 7, 2013, 05:51
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by tfuwa View Post
Thanks Bernhard, for your quick reply and tips on how to use gnuplot. As I want to plot a 2D picture with x being time, y being the line and pressure in the 2D area, so I am trying to combine all the files in sets/ together.
Ah. I thought you were going for an animation of the line. So you want a surface plot with the pressure going in z-direction, right? That is something the utility can't do yet
__________________
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 7, 2013, 06:33
Default
  #5
Member
 
Albert Tong
Join Date: Dec 2010
Location: Perth, WA, Australia
Posts: 74
Blog Entries: 1
Rep Power: 6
tfuwa is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Ah. I thought you were going for an animation of the line. So you want a surface plot with the pressure going in z-direction, right? That is something the utility can't do yet

Yes, Bernhard, I want to plot the temporal evolution of the pressure over a line. I have just solved the problem by combining all the files together, then use tecplot. Thanks for your attention.
__________________
Kind regards,

Albert
tfuwa is offline   Reply With Quote

Old   February 27, 2013, 10:15
Default pyFoamSamplePlot.py
  #6
Member
 
Jamal
Join Date: May 2012
Location: Freiburg
Posts: 54
Rep Power: 4
aujamal20 is an unknown quantity at this point
Dear
The temperatur over a line has been sampled in the sets directory distributed in many time directories. I would like to plot the changes of the temperature over time on the fixed line.
Quote:
Actually. It doesn't plot. It only generates the commands for gnuplot. But that is not a problem as you've only got to pipe the output into gnuplot ("pyFoamSamplePlot.py .... | gnuplot") to get a bunch of pictures.
Pleae elaborate this a bit more. I mean what commands would be generated and how to use those for gnuplots...
I am using this command pyFoamSamplePlot.py sets/timeDirectory/lineX1_.gplt and in result it gives following lines

Traceback (most recent call last):
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/bin/pyFoamSamplePlot.py", line 5, in <module>
SamplePlot()
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 31, in __init__
interspersed=True)
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/Applications/PyFoamApplication.py", line 213, in __init__
result=self.run()
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 288, in run
prefixes=self.opts.fieldPrefix)
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/RunDictionary/SampleDirectory.py", line 32, in __init__
for d in listdir(self.dir):
OSError: [Errno 20] Not a directory: 'sets/4320/lineX1_T.gplt/samples'


Thanks
aujamal20 is offline   Reply With Quote

Old   February 27, 2013, 10:51
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by aujamal20 View Post
Dear
The temperatur over a line has been sampled in the sets directory distributed in many time directories. I would like to plot the changes of the temperature over time on the fixed line.
Pleae elaborate this a bit more. I mean what commands would be generated and how to use those for gnuplots...
I am using this command pyFoamSamplePlot.py sets/timeDirectory/lineX1_.gplt and in result it gives following lines

Traceback (most recent call last):
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/bin/pyFoamSamplePlot.py", line 5, in <module>
SamplePlot()
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 31, in __init__
interspersed=True)
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/Applications/PyFoamApplication.py", line 213, in __init__
result=self.run()
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/Applications/SamplePlot.py", line 288, in run
prefixes=self.opts.fieldPrefix)
File "/opt/OpenFOAM/adin-2.1.0/lib/PyFoam-0.5.7/lib/python2.6/site-packages/PyFoam/RunDictionary/SampleDirectory.py", line 32, in __init__
for d in listdir(self.dir):
OSError: [Errno 20] Not a directory: 'sets/4320/lineX1_T.gplt/samples'


Thanks
You only have to specify the sets-directory. The utility will figure out what data is there (especially in cases where not every timestep has all the data).

Anyway. Like all other pyFoam-utilities the option --help gives you the basic usage and the options.

In your case something like

pyFoamSamplePlot.py . --dir=sets --field=T

should work
__________________
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

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
Problem with Gmsh nishant_hull Open Source Meshers: Gmsh, Netgen, CGNS, ... 19 July 31, 2015 05:10
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 9 January 3, 2012 09:06
mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 12 December 12, 2011 05:16
boundaries with gmshToFoam‏ ouafa Open Source Meshers: Gmsh, Netgen, CGNS, ... 7 May 21, 2010 12:43
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 16:16


All times are GMT -4. The time now is 19:10.