Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to plot streamlines

See original GitHub issue

Hello, Sorry, if this is not the right place to post this. I followed the different examples provided by vtkplotter to plot streamlines. Unfortunately I couldn’t make it work. Here is an example of a vtk file that contains the velocity vector field U. Here is my code:

Draw streamlines for the cavity case from OpenFOAM tutorial

from vtkplotter import loadUnStructuredGrid, load, show, interactive, Box, Grid, streamLines, Text

cavity = load('cavity.vtk')

domain = load('cavity.vtk')

comment = Text(__doc__, c='w')
probe = Grid(pos=[0.05,0.1,0.005], normal=[0,1,0], sx=0.01, sy=0.1, resx=30, resy=10)

stream = streamLines(domain, probe, direction='forward')
show(domain, stream, probe, comment, axes=8)

when I run the example above, I couldn’t see the streamlines I appreciate your help

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

ghostcommented, Apr 12, 2020

Thank you very much. I appreciate your help.

ghostcommented, Dec 16, 2019

Thank you very much for the detailed answer. Of course you could add it to the examples. You could find many others in the tutorials directory of OpenFOAM, just use foamToVTK to convert the results to vtk files.

I have just another question about how to choose the field to plot if you have more than one. For example if I convert the original OpenFOAM cavity results, the final VTK will contain the field p for pressure and U for velocity. In this case how can I choose which field to plot in vtkplotter?


Read more comments on GitHub >

github_iconTop Results From Across the Web

Plot streamlines from 2-D or 3-D vector data - MathWorks
streamline ( X , Y , U , V , startX , startY ) returns plotted streamlines for 2-D vector data. The inputs...
Read more >
Streamline plots in Python - Plotly
A Streamline plot is a representation based on a 2-D vector field interpreted as a velocity field, consisting of closed curves tangent to...
Read more >
How can one produce a proper streamline plot?
A streamline plot represents a collection of such streamlines, and it is an extremely useful tool for visualizing the field, and its direction...
Read more >
Fluids eBook: Conservation of Mass
The graph at the left plots six different streamlines, ψ = 1, 2, 3, 4, 5, and 6. The velocity field equations has...
Read more >
Streamlines - NCL Graphics
stream_1.ncl: Default black and white plot. gsn_csm_streamline_map_ce is the plot interface that draws streamlines on a cylindrical equidistant projection. A ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found