CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   how to make a graph using sampleDict (http://www.cfd-online.com/Forums/openfoam-post-processing/105220-how-make-graph-using-sampledict.html)

zxj160 July 25, 2012 12:03

how to make a graph using sampleDict
 
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.

gschaider July 25, 2012 18:36

Quote:

Originally Posted by zxj160 (Post 373511)
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, ...)

zxj160 July 26, 2012 08:00

Quote:

Originally Posted by gschaider (Post 373581)
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?

Bernhard July 26, 2012 08:40

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.

zxj160 July 26, 2012 08:48

Quote:

Originally Posted by Bernhard (Post 373689)
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.

despaired student July 26, 2012 09:31

suface
 
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

Bernhard July 26, 2012 10:36

For vtk-surface I would use Paraview to visualize. Alternatively you can use a tool as Tecplot, but that one is not freely available.

zxj160 July 26, 2012 12:07

Quote:

Originally Posted by Bernhard (Post 373725)
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?

hewei July 30, 2012 10:35

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 (Post 373689)
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 July 30, 2012 10:40

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.

despaired student July 30, 2012 15:52

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 August 1, 2012 05:04

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 (Post 374408)
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 August 3, 2012 04:47

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...:confused:

hewei August 3, 2012 06:47

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 (Post 375189)
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...:confused:



All times are GMT -4. The time now is 16:27.