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

Get the velocity values of a streamline

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

Reply
 
LinkBack Thread Tools Display Modes
Old   May 12, 2016, 07:59
Default Get the velocity values of a streamline
  #1
New Member
 
Pierre Bobillier
Join Date: May 2012
Posts: 1
Rep Power: 0
lybhur is on a distinguished road
Hi all,

Here is a piece of code for a programmable filter. The idea is to get the all velocity values of each streamlines.

If you look at the streamtracer output in a spreadsheet view, and in particular the integration time column, you will notice that each streamline begin with a zero.
So to isolate each streamline, I check all the zeros of the integration time column.

Then I want to use the "j" variable to slice the velocity array


Code:
 
from vtk.numpy_interface import dataset_adapter as dsa
from vtk.numpy_interface import algorithms as algs

input0 = inputs[0]
IntegrationTime = input0.PointData["IntegrationTime"]
Velocity = input0.PointData["Velocity"]

index = algs.where(IntegrationTime==0)

j=index[0][1]

print'j value : ', j
print'j type : ', type(j)
print j[0]
I thought that the variable "j" would be an integer but I think there is a bug because here is the result I have got in the output window (picture enclosed)

What did I missed ?!
Attached Images
File Type: png output_window.png (37.6 KB, 3 views)
lybhur is offline   Reply With Quote

Reply

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Integral average of velocity values on a slice cfdaddicted ParaView 12 November 30, 2015 03:12
Velocity gradient along a streamline Delcraft OpenFOAM Programming & Development 0 October 17, 2015 18:58
Velocity values are normal but pressure values are too big rv82 OpenFOAM Running, Solving & CFD 4 April 13, 2015 03:59
Problem with negative velocity values Andris CFX 23 September 20, 2012 08:52
ploting velocity with averaged values in z-direction FB87 OpenFOAM Paraview & paraFoam 0 September 11, 2012 09:51


All times are GMT -4. The time now is 11:34.