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

how to make a graph using sampleDict

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2012, 13:03
Default how to make a graph using sampleDict
  #1
Senior Member
 
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14
zxj160 is on a distinguished road
I am new to openfoam and I am trying to use sample utility. I have run the sampleDict. But now I do not know how to make a graph base on the sets files generated.
zxj160 is offline   Reply With Quote

Old   July 25, 2012, 19:36
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 zxj160 View Post
I am new to openfoam and I am trying to use sample utility. I have run the sampleDict. But now I do not know how to make a graph base on the sets files generated.
Depends on the format you specified to write them out. But I guess the fastest choice (once you get to know it) is gnuplot. Otherwise a lot of programs (especially those specialized in plotting) can read data from files where the numbers are separated by spaces (excel, OpenOffice, ...)
gschaider is offline   Reply With Quote

Old   July 26, 2012, 09:00
Default
  #3
Senior Member
 
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14
zxj160 is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Depends on the format you specified to write them out. But I guess the fastest choice (once you get to know it) is gnuplot. Otherwise a lot of programs (especially those specialized in plotting) can read data from files where the numbers are separated by spaces (excel, OpenOffice, ...)
If my format is set as : setFormat raw;, then how can I read the data and plot them?
zxj160 is offline   Reply With Quote

Old   July 26, 2012, 09:40
Default
  #4
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Code:
gnuplot -persist <<< "plot 'filename.raw'"
Is the easiest method from scratch.

This is something you should fit to your needs with a software of choice. It is a matter of taste and experience. Some people prefer gnuplot, some prefer grace, some prefer Excel, some prefer matlab to make graphs. I would advise gnuplot however. Start with a tutorial, and then google for the things when you need them. This most often works.
Bernhard is offline   Reply With Quote

Old   July 26, 2012, 09:48
Default
  #5
Senior Member
 
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14
zxj160 is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
Code:
gnuplot -persist <<< "plot 'filename.raw'"
Is the easiest method from scratch.

This is something you should fit to your needs with a software of choice. It is a matter of taste and experience. Some people prefer gnuplot, some prefer grace, some prefer Excel, some prefer matlab to make graphs. I would advise gnuplot however. Start with a tutorial, and then google for the things when you need them. This most often works.
Thanks for your advice. Then I will try the gnuplot tutorials first.
zxj160 is offline   Reply With Quote

Old   July 26, 2012, 10:31
Default suface
  #6
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
Hi,

would you also recommend gnuplot to visualise planes out of raw or vtk formats. To make the files I used sampleDict - surfaces.


Kind regards
despaired student is offline   Reply With Quote

Old   July 26, 2012, 11:36
Default
  #7
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
For vtk-surface I would use Paraview to visualize. Alternatively you can use a tool as Tecplot, but that one is not freely available.
Bernhard is offline   Reply With Quote

Old   July 26, 2012, 13:07
Default
  #8
Senior Member
 
Jian Zhong
Join Date: Feb 2012
Location: Birmingham
Posts: 109
Rep Power: 14
zxj160 is on a distinguished road
Quote:
Originally Posted by Bernhard View Post
For vtk-surface I would use Paraview to visualize. Alternatively you can use a tool as Tecplot, but that one is not freely available.
I want to sample data from a surface and then average those with the same y position. Later I want to plot a line with those averaged values. Is it possible to do that?
zxj160 is offline   Reply With Quote

Old   July 30, 2012, 11:35
Default
  #9
Member
 
Join Date: May 2010
Posts: 74
Rep Power: 16
hewei is on a distinguished road
hello Berhard,

I used sampledict to get the data at one point, then in the directory of "sets",there are thousands folders in sets.and the data format is gnuplot.
I use the command gnuplot -persist <<< "plot 'somePoints_U.gplt'" in the case home directory, but the result is
gnuplot -persist <<< "plot 'somePoints_U.gplt'"
line 0: warning: Skipping unreadable file "somePoints_U.gplt"
line 0: No data in plot

but after I delete the head words in the .gplt file,it can be plot in the subdirectory of folder,gnuplot works,but this is not effective.
What's my problem?
Thank you~




Quote:
Originally Posted by Bernhard View Post
Code:
gnuplot -persist <<< "plot 'filename.raw'"
Is the easiest method from scratch.

This is something you should fit to your needs with a software of choice. It is a matter of taste and experience. Some people prefer gnuplot, some prefer grace, some prefer Excel, some prefer matlab to make graphs. I would advise gnuplot however. Start with a tutorial, and then google for the things when you need them. This most often works.

Last edited by hewei; July 30, 2012 at 13:33.
hewei is offline   Reply With Quote

Old   July 30, 2012, 11:40
Default
  #10
Senior Member
 
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22
Bernhard is on a distinguished road
Well, my example was for a datafile with two column from a probe point or something similar. You mayt want to show the function object or sampling you are actually using, as well as the head of the outputfile.
Bernhard is offline   Reply With Quote

Old   July 30, 2012, 16:52
Default
  #11
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
Hi hewei,

I don't know what you need to "sample" data at one point for. Maybe you can also use the probeUtility to do this job (if it's data at one point over the time) and visualise the data with python - maybe there exists already a short script for python to do this.
despaired student is offline   Reply With Quote

Old   August 1, 2012, 06:04
Default
  #12
Member
 
Join Date: May 2010
Posts: 74
Rep Power: 16
hewei is on a distinguished road
I wanna calculate the frequency of vibration. and I compared the results between ProbeLocation and sample, they are not the same! My friend told me that probeUtility is sensitive on the grid knot location.

Quote:
Originally Posted by despaired student View Post
Hi hewei,

I don't know what you need to "sample" data at one point for. Maybe you can also use the probeUtility to do this job (if it's data at one point over the time) and visualise the data with python - maybe there exists already a short script for python to do this.
hewei is offline   Reply With Quote

Old   August 3, 2012, 05:47
Default
  #13
Senior Member
 
Sören
Join Date: Mar 2012
Posts: 102
Rep Power: 14
despaired student is on a distinguished road
I don't know in whch way the probe-utility is sensitive on the grid... I hear this the first time but I'm new to OpenFoam so that doesn't mean a thing...
Maybe a more experienced user could comment this...
despaired student is offline   Reply With Quote

Old   August 3, 2012, 07:47
Default
  #14
Member
 
Join Date: May 2010
Posts: 74
Rep Power: 16
hewei is on a distinguished road
I just made this decision after comparing the results gotten by sampledic and probelocation. But I really know what's the reason why. as you said, waiting for experienced users.
Quote:
Originally Posted by despaired student View Post
I don't know in whch way the probe-utility is sensitive on the grid... I hear this the first time but I'm new to OpenFoam so that doesn't mean a thing...
Maybe a more experienced user could comment this...
hewei 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
graph transient post data at sensor point Micha Siemens 6 March 20, 2013 05:17
use of Gturbo to make turbine blade usman FLUENT 0 December 31, 2007 06:47
How to plot different model's graph on a graph? echo Siemens 1 April 28, 2006 04:54
Mass flow rate graph Lior FLUENT 0 March 7, 2004 11:02
[Q]How to make MPEGs with CFD datas??? Bum-Seok Hyun Main CFD Forum 4 February 16, 2000 19:59


All times are GMT -4. The time now is 12:26.