CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > ParaView

[OpenFOAM] simpleFunctionObjects in paraFoam

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 22, 2012, 17:00
Default simpleFunctionObjects in paraFoam
  #1
New Member
 
Javier Garcia
Join Date: Sep 2009
Posts: 7
Rep Power: 16
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, 19:18
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 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, 19:37
Default
  #3
New Member
 
Javier Garcia
Join Date: Sep 2009
Posts: 7
Rep Power: 16
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, 02:15
Default
  #4
Member
 
Timo K.
Join Date: Feb 2010
Location: University of Stuttgart
Posts: 66
Rep Power: 16
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, 04:21
Default
  #5
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 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 04:23. Reason: Add code-tag to remove smileys
gschaider is offline   Reply With Quote

Old   February 23, 2012, 17:41
Default
  #6
New Member
 
Javier Garcia
Join Date: Sep 2009
Posts: 7
Rep Power: 16
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, 19:01
Default
  #7
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 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 Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] Unable to launch parafoam & boonhow ParaView 5 March 23, 2022 08:09
[OpenFOAM.com] paraFoam cannot open due to Qt issues - [Solved/Information] u2berggeist OpenFOAM Installation 2 July 2, 2018 17:03
[OpenFOAM] How to use paraFoam on a cluster andreas ParaView 1 March 6, 2013 17:11
[OpenFOAM] OpenFoam (Ubuntu): paraFoam via Xming+PuTTY raketenmaid ParaView 4 February 5, 2013 05:20
[OpenFOAM] Parafoam basic questions qtian ParaView 0 July 20, 2007 11:52


All times are GMT -4. The time now is 07:40.