CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Stream Function (https://www.cfd-online.com/Forums/main/5516-stream-function.html)

 Beginner December 8, 2002 23:10

Stream Function

Hi all,

Could someone tell me how to get the stream functions at discrete points when a two-dimensional laminar flow problem has been solved with primitive variables. u and v at space coordinates are available. I want to plot the streamlines.

Thank you.

 Noname December 9, 2002 06:14

Re: Stream Function

buddy

save ur time....use tecplot to do it for u automatically :)

 Tom December 9, 2002 06:59

Re: Stream Function

If your geometry is simple just integrate u with respect to y setting the surface value to zero. Alternatively just plot the total head

H = p + (u^2 + v^2)/2.

which is constant on streamlines for steady inviscid flow and is a good indicator of the streamline behaviour.

If you really need the streamlines and your geometry isn't simple then you'll have to integrate the streamline equations and interpolate the velocities from your discrete grid point values.

 Beginner December 9, 2002 07:03

Re: Stream Function

If I get the stream function values at discrete points from the computed u and v values, I shall use MATLAB for plot of stremlines using their 'contour' plot command. I know using MATLAB.

 Beginner December 9, 2002 07:09

Re: Stream Function

Tom,

Thank you very much.

(a) "If you really need the streamlines and your geometry isn't simple then you'll have to integrate the streamline equations and interpolate the velocities from your discrete grid point values". - Could you explain it in further details.

 Tom December 9, 2002 08:22

Re: Stream Function

dx/ds = u, dy/ds = v (*)

where s is a parameter on the streamline (u & v are independent of s). Then if you take an arbitrary point in the flow, calling it (x_0,y_0), then the streamline passing through this point can be found by integrating (*) subject to the initial condition

x = x_0, y = y_0 at s=0.

You can pick, for example, the initial points x_0,y_0 to lie at grid points on the inflow. You can now integrate (*) for each initial point using your favourite ode integration scheme to generate the streamline passing through each point. Now during the integration you will need values of u and v which are not located at grid points. To obtain these values of the velocity simply use bilinear interpolation from the surrounding nearest four grid points.

 Linfeng BI December 9, 2002 09:45

Re: Stream Function

As you know,

d(Psi)/dy=u, d(Psi)/dx=-v

where Psi is the stream function. So the stream function value at point M with respect to a reference point M0 is

Psi(M)-Psi(M0)=

<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">/M
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">|dPsi=
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">/M0

<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">/M
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">|-vdx+udy
<p style="line-height: 150%; margin-top: 0; margin-bottom: 0">/M0

This integration is independent of the path so that you can integrate -v over [x0,x] and u over [y0,y]. Having the velocity values at discrete points at hand, the integration is very easy.

 Praveen December 10, 2002 11:53

Re: Stream Function

Matlab can plot streamlines given the velocity vector. See the functions "streamline", stream2" and "stream3".

 All times are GMT -4. The time now is 22:23.