CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Paraview & paraFoam (
-   -   XYZ starting points of streamtraces in Paraview (

deniggo March 26, 2013 09:37

XYZ starting points of streamtraces in Paraview
in Paraview I want to draw streamtraces with defined starting points xyz.
In the Object Inspector I can only define the radius around a point (or a line) where Paraview creates randomized starting points.
I recorded a python-macro, where I can define at least one single starting point ([12.02, 2.52, 1.66], with a radius of 0):


try: paraview.simple
except: from paraview.simple import *

Calc_U1 = GetActiveSource()
StreamTracer2 = StreamTracer( SeedType="Point Source" )
StreamTracer2.SeedType.Center = [12.02, 2.52, 1.66]
StreamTracer2.Vectors = ['POINTS', 'U']
StreamTracer2.MaximumStreamlineLength = 29.85
StreamTracer2.TerminalSpeed = 1e-12
StreamTracer2.MaximumError = 1e-06
StreamTracer2.SeedType.Radius = 0.0
StreamTracer2.SeedType.NumberOfPoints = 1

RenderView1 = GetRenderView()
DataRepresentation4 = Show()
DataRepresentation4.EdgeColor = [0.0, 0.0, 0.5]
I there a possibility to import a list of more than one starting points into Paraview? Just adding a similar block under this one, does not work.

Thank's for your help.

deniggo March 27, 2013 06:00

I found a solution, without using a python macro:

1. Save your xyz-coordinates as *.csv.
2. load them in Paraview, they appear as a table.
3. apply the filter "Table to points" (Filters>Alphabetical) to the table and define x,y,z directions.
4. Activate the velocity field/variable and apply the filter "Stream Tracer with Custom Source".
5. Choose "Source" on the left bar and choose the TableToPoints-variable (created under 3.)
6. Activate the Filter

Hope that helps someone....

BTW: When exporting the streamtraces as *.csv the column "Integration Time Steps" can be used for travel time analysis.

jans May 21, 2013 14:17

This was really helpful

deniggo May 22, 2013 03:02

Yes, but it's a bit intricate. In case of more than one run automatization with a script would be nice where loading xyz data, activating the filters, and finally write new csv file would be done by one click....

All times are GMT -4. The time now is 05:10.