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

Gnuplot Vector Probes from the funtionObject

Register Blogs Community New Posts Updated Threads Search

In this blog, quick reference notes about OpenFOAM are posted in a form of a summary to address a specific topic per post.
Rate this Entry

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:
Code:
# Time  vector
1.20   (2.14   8.512   1.005)
.
.
.
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:
Code:
plot 'probeFile' using "%lf (%lf %*lf %*lf)"
to plot the Ux component and:
Code:
plot 'probeFile' using "%lf (%*lf %*lf %lf)"
to plot the Uz component. %lf --> read a double and %*f --> skip number ... So it translates to: read (ignore ignore read)
Or:
Code:
plot 'probeFile' using 1:2 '%lf (%lf %lf %lf)'
plot 'probeFile' using 1:4 '%lf (%lf %lf %lf)'
Thereby, other data manipulation can be introduced.
Posted in Uncategorized
Views 4207 Comments 3 Edit Tags Email Blog Entry
« Prev     Main     Next »
Total Comments 3

Comments

  1. Old Comment
    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?
    permalink
    Posted August 8, 2012 at 09:19 by iznal iznal is offline
  2. Old Comment
    Hisham's Avatar
    Quote:
    Originally Posted by iznal View Comment
    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?
    Hi

    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!
    permalink
    Posted September 4, 2012 at 10:01 by Hisham Hisham is offline
  3. Old Comment
    Quote:
    Originally Posted by Hisham View Comment
    Hi

    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!
    Hello Hisham

    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???
    permalink
    Posted April 22, 2014 at 04:25 by jeicek jeicek is offline
 

All times are GMT -4. The time now is 17:56.