simpleFunctionObjects in paraFoam
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 |
Quote:
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 |
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 |
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 |
Quote:
Code:
plot "patchToFile" using 1:(sqrt($2*$2+$3*$3+$4*$4)) with lines BTW: pyFoamTimelinePlot.py does that automatically for you if it detects a vector-value in your file |
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 |
Quote:
- the Wiki-page - 2 presentations (referenced on the Wiki-page) - every PyFoam-command gives information about its usage if tickled with the --help-option |
All times are GMT -4. The time now is 13:55. |