In this blog, quick reference notes about OpenFOAM are posted in a form of a summary to address a specific topic per post.
Gnuplot Vector Probes from the funtionObject
Posted June 9, 2012 at 16:27 by Hisham
When using the functionObject to probe a vector (e.g. velocity) at a location, the output is in the format:
Unlike sampling or using probeLocations, until now AFAIK it is not possible to use U.component(0) to spit only the X-component. To resolve that using gnuplot, one can use:
to plot the Ux component and:
to plot the Uz component. %lf --> read a double and %*f --> skip number ... So it translates to: read (ignore ignore read)
Or:
Thereby, other data manipulation can be introduced.
Code:
# Time vector 1.20 (2.14 8.512 1.005) . . .
Code:
plot 'probeFile' using "%lf (%lf %*lf %*lf)"
Code:
plot 'probeFile' using "%lf (%*lf %*lf %lf)"
Or:
Code:
plot 'probeFile' using 1:2 '%lf (%lf %lf %lf)' plot 'probeFile' using 1:4 '%lf (%lf %lf %lf)'
Total Comments 3
Comments
-
Hi Hisham
Thanks for your Post. Right now I got a Problem with plotting those vectors.
My file looks like:
# Time vector01 vector02 1.20 (2.14 8.512 1.005) (2.15 0.23 1.24))Could you please give me some tipps?Posted August 8, 2012 at 09:19 by iznal -
Quote:
I think it should be something like:
Code:plot 'File' using "%lf (%lf %*lf %*lf) (%*lf %*lf %*lf)"
for plotting the X component of the first vector and so on!Posted September 4, 2012 at 10:01 by Hisham -
Quote:
Thank you very much for this helpful idea. I have one question: I want to plot the velocity vector compnonest(Ux , Uy and Uz) vs time for three points but there is small problem:
My case looks like this:
Time
1 (1 -4 4) (2 1 3) (0 1 7)
2 (1 -2 0) (1 3 6) (2 1 9)
...
I can plot (Ux1, Uy1, Uz1) and also (Ux2, Uy2, Uz2) ,or in other words datas till column 7, using plot 'File' using "%lf (%lf %*lf %*lf) (%*lf %*lf %*lf)"
BUT when I use 1:8 '%lf (%lf %lf %lf) (%lf %lf %lf) (%lf %lf %lf)' title 'Ux3' to plot the vlocity components of third point I get this ERROR:
"U3plot", line 6: Please use between 1 and 7 conversions, of type double (%lf)
Does anyone have any IDea???Posted April 22, 2014 at 04:25 by jeicek