# Plotting Velocity Components from Probe Data Using Gnuplot

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

 January 30, 2023, 08:49 Plotting Velocity Components from Probe Data Using Gnuplot #1 New Member   Josh Join Date: Nov 2022 Location: Scotland Posts: 2 Rep Power: 0 Dear all, I am running an unsteady single-phase 2D viscoelastic simulation using the rheoFoam solver. To identify whether a solution has reached a steady state, I have placed several probes (9 in total) in the domain (using the relevant function within controlDict) and I would like to check that they do not oscillate over time. However, the output file for the velocity probes has the following form: Code: ``` # Probe 0 (0.1 4 0) # Probe 1 (0.1 1.5 0) # Probe 2 (0.1 -1.5 0) # Probe 3 (0.1 -4 0) # Probe 4 (0.1 3 0) # Probe 5 (0.1 0 0) # Probe 6 (0.1 -3 0) # Probe 7 (0.3 4.28 0) # Probe 8 (-0.3 -4.28 0) # Time 0 1 2 3 4 5 6 7 8 300 (1.63497901423e-05 1.37147164839e-05 0) (1.10471997781e-05 -8.10669816334e-05 0) (1.10472265148e-05 8.10664831717e-05 0) (1.63497726397e-05 -1.37146161646e-05 0) (0.0130657458981 -0.000283639102177 0)(0.0130657401772 5.97955849558e-11 0) (0.0130657459222 0.000283639299117 0) (1.95795959515e-05 3.2456599189e-05 0) (-1.79769313486e+307 -1.79769313486e+307 -1.79769313486e+307)``` What I would like to do is create a script which, using Gnuplot, plot the x and y components of velocity for each probe on a separate graph. I appreciate that there are other threads which explain how to do this to some extent (see: Plotting Velocity Probe File with gnuplot), however they are poorly explained and I am unsure of how to extrapolate their scripts to suit my use-case. Any help would be appreciated! Thanks in advance, Josh

February 15, 2023, 10:35
#2
New Member

Josh
Join Date: Nov 2022
Location: Scotland
Posts: 2
Rep Power: 0
Dear all,

For anyone looking for a solution to the same problem I have, there are two possible solutions I have found which do not directly use gnuplot in the manner I have asked for help with.

The first is to modify the rheoFoam solver such that it produces an addition field "magU" for the magnitude of U, therefore getting around the problem of having three velocity components for each probe and therefore making it easy to use gnuplot in the standard fashion. (Credit and thanks to PC for helping me implement this)

Otherwise, KM has helped me produce a python script which is able to plot the probes using matplotlib which I have included in case anyone would like to use it.

In any case, if anybody is able to help to plot the individual velocity components from the probe easily using gnuplot, I would appreciate the additional knowledge.

Regards,
Josh
Attached Files
 plot.zip (146.4 KB, 1 views)

 Tags gnuplot, probes, velocity