How to plot streamlines
See original GitHub issueHello,
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 cavity.zip 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)
probe.color('k')
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:
- Created 4 years ago
- Comments:13 (6 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thank you very much. I appreciate your help.
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 usefoamToVTK
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 andU
for velocity. In this case how can I choose which field to plot in vtkplotter?Thanks