# How to obtain streamslines from velocity field data points

I managed to solved a lid-driven cavity flow using LB code. It gave me the velocity field data points.

Now I have to obtain streamlines too, of course from the obtained velocity field.

Besides, I know the theory of Potential Flow as well as all of the associated relations.

How can I directly draw the streamlines of this flow without solving a Poisson equation. If numerical integration must to be used (as I guess), How should I do handle with partial derivatives?

• There are algorithms that already compute the streamlines for you. Can't you use one of those? – nicoguaro Apr 9 '15 at 19:13

Probably the easiest thing to do is to use a visualization package or something with built-in vis capabilities. MATLAB, ParaView, and VisIt all support plotting streamlines natively, and the latter two are freely available.

If you want to plot them yourself, they are usually integrated using a psuedo-time integration method from seed points such that

$$\frac{dx(s)}{ds} = u(x(s),t)$$

for $t$ fixed and some initial point $x(0)=x_0$. If the flow is steady, then you can drop the $t$.

• Thanks. I am willing to do it on my own (coding). Can you give me at least some sources? – Shaqpad Apr 8 '15 at 16:57
• I recommend that you don't unless you are working towards becoming an expert in scientific visualization. Integrating streamlines by hand is actually non-trivial, since your sample points will be between grid points and will also require some sort of interpolation to find the right velocities for each step. Experts at this have put in all the work for you already. – Bill Barth Apr 8 '15 at 17:00
• Yes. Actually I read A. A. Mohamad's book on Lattice Boltzmann Method. There he do this with a few lines of code. One thing more, What about Tecplot? Does it have this feature? – Shaqpad Apr 8 '15 at 17:08
• Yes, and every other visualization program that takes vector data. – Bill Barth Apr 8 '15 at 19:49

The CGAL library has a package for this purpose. See their documentation for details and references.