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

simpleFunctionObjects in paraFoam

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 22, 2012, 18:00
Default simpleFunctionObjects in paraFoam
  #1
New Member
 
Javier Garcia
Join Date: Sep 2009
Posts: 7
Rep Power: 7
fjgg1549 is on a distinguished road
Hello Foamers,

I have made simpleFunctionObjects, namely a patchAverage. called averageVelocity in the patch atmosphere.

I have a nice file in the directory ./patchAverage_averageVelocity/0 but I don't know how to visualize it with paraFoam.

Could any one, please, offer a step-by-step explanation on how to visualize this patchAverage in paraFoam?

Thanks and best regards.

Javier Garcia

fjgg1549 is offline   Reply With Quote

Old   February 22, 2012, 20:18
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 fjgg1549 View Post
Hello Foamers,

I have made simpleFunctionObjects, namely a patchAverage. called averageVelocity in the patch atmosphere.

I have a nice file in the directory ./patchAverage_averageVelocity/0 but I don't know how to visualize it with paraFoam.

Could any one, please, offer a step-by-step explanation on how to visualize this patchAverage in paraFoam?

Thanks and best regards.

Javier Garcia

I don't think that paraview is the best choice for that kind of data.

The fastest way to plot this data is Gnuplot (the chances are good that it is already installed on your workstation). Starting it with "gnuplot" will bring you to a shell and there the command

plot "patchAverage_averageVelocity/0/atmosphere"

should plot the data. Gnuplot may be a bit frightening for the beginner but it is scriptable and thus makes it easy to generate plots with minimal intervention (once you've set up a script of course)

The pyFoam-utilities have a utility that generate the gnuplot-commands for you. In your case

pyFoamTimelinePlot.py . --dir=patchAverage_averageVelocity --basic-mode=lines

Piping that output directly into gnuplot gives you a PNG

pyFoamTimelinePlot.py . --dir=patchAverage_averageVelocity --basic-mode=lines | gnuplot

When you look at the online-help of the command you will find a number of other options. One of them is --csv-file. If you say

pyFoamTimelinePlot.py . --dir=patchAverage_averageVelocity --basic-mode=lines --csv=velocity.csv

then you will get a CSV file. This format is quite popular. It can be read into Excel, OpenOffice and other plotting programs and .... paraview. But doing 2D-plots is not Paraviews strong foot. You'll have to try that yourself
gschaider is offline   Reply With Quote

Old   February 22, 2012, 20:37
Default
  #3
New Member
 
Javier Garcia
Join Date: Sep 2009
Posts: 7
Rep Power: 7
fjgg1549 is on a distinguished road
Thank you very much Bernhard. I shall follow your recommendations.

I have already tried gnuplot, but the file I have created is an area average of U (a vector) and gnuplot does not perform a good job.

I can run my case again with patchAverage of vector components, rather than with the full vector. In any case, it is now my turn to experiment.

Again, thanks a lot. You have been most helpful.

Javier Garcia
fjgg1549 is offline   Reply With Quote

Old   February 23, 2012, 03:15
Default
  #4
Member
 
Timo K.
Join Date: Feb 2010
Location: University of Stuttgart
Posts: 66
Rep Power: 7
timo_IHS is on a distinguished road
Try something like this:

plot '<sed -e "s/[()]//g" ../patchAverage_avg_InOut/0/U' using 1:2 title "U_x" w l lw 2

If you want the magnitude of U, you can use:
foamCalc mag U

Best
timo_IHS is offline   Reply With Quote

Old   February 23, 2012, 05:21
Default
  #5
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 fjgg1549 View Post
Thank you very much Bernhard. I shall follow your recommendations.

I have already tried gnuplot, but the file I have created is an area average of U (a vector) and gnuplot does not perform a good job.

I can run my case again with patchAverage of vector components, rather than with the full vector. In any case, it is now my turn to experiment.

Again, thanks a lot. You have been most helpful.

Javier Garcia
I beg to differ: in gnuplot
Code:
plot "patchToFile" using 1:(sqrt($2*$2+$3*$3+$4*$4)) with lines
gives you a plot of the magnitude of your vector (or what did you mean with "not a good job")

BTW: pyFoamTimelinePlot.py does that automatically for you if it detects a vector-value in your file

Last edited by gschaider; February 23, 2012 at 05:23. Reason: Add code-tag to remove smileys
gschaider is offline   Reply With Quote

Old   February 23, 2012, 18:41
Default
  #6
New Member
 
Javier Garcia
Join Date: Sep 2009
Posts: 7
Rep Power: 7
fjgg1549 is on a distinguished road
Thanks Bernhard and Timo for your advices. I shall try them and I'll post here the results.

Incidentally, is there a Manual or something for those programms?

Thanks and best regards.

Javier Garcia
fjgg1549 is offline   Reply With Quote

Old   February 23, 2012, 20:01
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 fjgg1549 View Post
Thanks Bernhard and Timo for your advices. I shall try them and I'll post here the results.

Incidentally, is there a Manual or something for those programms?

Thanks and best regards.

Javier Garcia
If you mean PyFoam: no. But there is
- the Wiki-page
- 2 presentations (referenced on the Wiki-page)
- every PyFoam-command gives information about its usage if tickled with the --help-option
gschaider is offline   Reply With Quote

Reply

Tags
parafoam, simplefunctionobjects

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
pointVectorField in ParaFoam s_braendli OpenFOAM Paraview & paraFoam 0 April 22, 2010 08:36
surfaceScalarField in paraFoam danielr OpenFOAM Paraview & paraFoam 1 October 5, 2009 02:08
ParaFOAM visualization problems robbo OpenFOAM Paraview & paraFoam 0 March 15, 2008 15:10
Parafoam basic questions qtian OpenFOAM Paraview & paraFoam 0 July 20, 2007 11:52
ParaFoam OF 14 decomposed cases philippose OpenFOAM Paraview & paraFoam 4 April 18, 2007 05:17


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