CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Streamline plotting logic (https://www.cfd-online.com/Forums/main/66258-streamline-plotting-logic.html)

soggy316 July 10, 2009 01:09

Streamline plotting logic
 
hello,

I was wondering if anyone could explain the logic of how streamlines are plotted. I have a stream function of a Karman vortex street defined wrt a fixed co-ordinate system. Now, i need to plot the streamlines, I can evaluate the value of the stream function all over the domain. How do I go about plotting the stream lines from there.

Also, I would need to plot the same stream function with different frame of reference - i.e. wrt an observer moving with the stream, wrt an observer moving with the vortices. How would I incorporate a change of reference frame in the stream function?

Thanks in Advance

sanjay shukla July 10, 2009 02:22

If you have a stream function and you can evaluate stream function at any point in the domain than what is the problem with plotting. I mean, if you have stream function as function of space coordinates than your problem is solved.


make a bit clear about your difficulity that you are facing.

praveen July 10, 2009 04:09

Level curves of the stream-function will give you the instantaneous streamlines. See

http://en.wikipedia.org/wiki/Stream_function

soggy316 July 10, 2009 04:19

^Ah yes, but what logic do I use to code in a level curve plotting function- is it like

Search through the domain for a certian value of the function and store all such points and then connect them by a curve

Or search in the neighborhood of a point and keep joining the points of equal values

praveen July 10, 2009 04:26

Generate a grid, evaluate the stream-function on the grid points, and use the resulting data in some visualization software like matlab/paraview/visit/mayavi2 etc.

soggy316 July 10, 2009 04:43

^Thats too easy ;) . I was looking for the logic for plotting the stream lines from scratch - i prefer working with code I personally wrote so that I can mangle it in any way I see fit. Or do you think its really not worth it?

praveen July 10, 2009 05:07

Unless you have some special needs which existing softwares cannot deal with, it is not worth doing it yourself.

If you still want to do it yourself, then the procedure would be close what you described. But first you would need to generate a grid. Choose a set of discrete values for the stream-function. Locate these values in each grid cell and then try to join all points having same value. I think its easier to do this if you use triangular grids.

soggy316 July 10, 2009 05:35

Ok, will sleep on it then, thanks for all the help :)

mnabi July 10, 2009 08:14

If you ask about the logic of streamlines:
in 2D, the stream function is
u=ds/dy , v=-ds/dx
and the vorticity is
vort=dv/dx-dudy
subsitute
d^2s/dx^2+d^s/dy^2=-vort
you need to solve a poisson equation in each time step to see the moving stream lines. If you are only interested in steady state solution, you can solve this poisson equation once , at the end of simulation.


All times are GMT -4. The time now is 03:00.