MAE 360 Aerodynamics

Stream Function Tutorial

Please enter your name:

This lesson should take you approximately 30 minutes to complete.  Do not forget to SUBMIT your results at the end of the lesson.

The Stream Function

Let us define a function of two variables, $\psi (x,z)$, for which we will define the first derivatives as:

For now, $u$ is simply the first derivative of $\psi $ with respect to $z$, and $w$ is the negative of the first derivative of $\psi $ with respect to $x$. Notice that, for these definitions of $u$ and $w$, the function, $\psi (x,z)$, automatically satisfies the steady continuity equation in two dimensions:
Therefore, if we can define a function that satisfies:

  1. its $z$-derivative is the $u$-velocity in some flow field, and
  2. the negative of its $x$-derivative is the $w$-velocity in that same flow field,

that function, called a "stream function," will describe a legitimate steady, two-dimensional flow. It seems like a very tall order to find such a function, but a sizable number of close-to-realistic flows with engineering significance can be described in such a simple manner. Consider the following example:

Which of the following represents the velocity within this flow field?



The stream function, $\psi (x,z)$, is a scalar function of position, i.e., for some value of $x$ and some value of $z$ the function $\psi $has some assigned scalar value. In general, $\psi $can have the same scalar value for different sets of $(x,z)$ pairs. In the example given above, $\psi $ will equal 1 whenever $z=1/x$, so a curve of constant $\psi =\psi _{0}$ is equivalent to the curve $z=\psi _{0}/x$. Consider the case $\psi =$ constant $=\psi _{0}$. Then the differential of $\psi $ along the curve $\psi =\psi _{0}$ can be written:
Rearranging the last of these equations leads to
along the curve $\psi =\psi _{0}$. This implies that a curve of constant $\psi $ for which MATH and MATH will have slope given by $w/u$. To envision the meaning of this, refer to the figure, which illustrates the scenario described by equation 2. The velocity vector, $\QTR{bf}{V}$, is tangent to the curve at point $P$ so that the ratio $w/u$ is the slope at point $P$. Thus, any curve described by $\psi =$ constant is everywhere tangent to the velocity vector. This is the definition of a streamline.

Figure 1.  The slope of the curve at point, P, is w/u.  By definition, the curve is tangent to V.

Now that we know $\psi =$ constant represents a streamline, we can find the streamlines for the flow represented by equation 1 above. The following MATLAB code will plot 11 streamlines for this flow. The plot is restricted to the first quadrant.

% program to compute streamlines from stream function psi = xy
% the function "corner(y,x,p1)" contains the function xy - p1, where p1 is the current constant

warning off;

x = linspace(0,5,51);

p0 = linspace(0,10,11);

hold on;

for i = 1:11

   p1 = p0(i);

   if p1 == 0

      p1 = .0001;


   for j = 1:51
      y(j,i) = fzero(@corner,1,[],x(j),p1);



plot(x,y); axis equal;
title('Streamlines for the stream function \psi = xy for x,y > 0');
axis([0 5 0 5]);

Figure 2 shows the plot of the streamlines. Note that the stream function does not directly tell us the flow direction.

Figure 2.  Streamline pattern for flow into a corner.

In which direction is the flow moving? 

Explain how you determined your answer to the above question:

Notice that one of the streamlines in the flow pattern is the x-axis.  What is the value of the stream function constant for this streamline?

Keeping in mind your answer to the previous question, what streamline is missing in Figure 2?  Explain.

Equation 1 gives the stream function for flow into a corner.  The x- and z-axes are the boundaries of the corner.  Recalling the definition of a streamline - that the velocity is everywhere perpendicular - the boundaries must then be streamlines since no fluid can pass perpendicular to a solid surface.  Conversely, any streamline could represent a solid boundary since the boundary condition that the velocity is everywhere tangent is satisfied at every point on any streamline.

Streamlines from Velocity

Because of its property that $\psi =$ constant defines a streamline, the stream function provides a straightforward way of finding flow patterns.  However, streamlines can be determined directly from the velocity field.  MATLAB has functions streamline and stream2, which plot streamlines given velocity data.

Incompressible, Two-dimensional, Irrotational Flow

If a flow is irrotational, the curl of the velocity is zero, or
Substituting in the expressions for velocity in terms of the stream function,
Thus, the stream function satisfies the Laplace equation for an irrotational flow. As an exercise, show that the stream function defined in eq. (1) satisfies the governing Laplace equation.

Note that the flow must be two-dimensional for the stream function to be defined, whereas the velocity potential exists for three-dimensional flows as well. It is important to remember the differences between the stream function and the velocity potential. Both satisfy Laplace's equation. One can obtain the velocty components from either of them according to

This document created by Scientific WorkPlace 4.0.