# Stream function

In fluid dynamics, two types of stream function are defined:

The properties of stream functions make them useful for analyzing and graphically illustrating flows.

## Two-dimensional stream function

### Assumptions

The two-dimensional stream function is based on the following assumptions:

• The space domain is three-dimensional.
• The flow field can be described as two-dimensional plane flow, with velocity vector
${\displaystyle \quad \mathbf {u} ={\begin{bmatrix}u(x,y,t)\\v(x,y,t)\\0\end{bmatrix}}.}$
${\displaystyle \quad \nabla \cdot \mathbf {u} =0.}$

Although in principle the stream function doesn't require the use of a particular coordinate system, for convenience the description presented here uses a right-handed Cartesian coordinate system with coordinates ${\displaystyle (x,y,z)}$.

### Derivation

#### The test surface

Consider two points ${\displaystyle A}$ and ${\displaystyle P}$ in the ${\displaystyle xy}$ plane, and a curve ${\displaystyle AP}$, also in the ${\displaystyle xy}$ plane, that connects them. Then every point on the curve ${\displaystyle AP}$ has ${\displaystyle z}$ coordinate ${\displaystyle z=0}$. Let the total length of the curve ${\displaystyle AP}$ be ${\displaystyle L}$.

Suppose a ribbon-shaped surface is created by extending the curve ${\displaystyle AP}$ upward to the horizontal plane ${\displaystyle z=b}$ ${\displaystyle (b>0)}$, where ${\displaystyle b}$ is the thickness of the flow. Then the surface has length ${\displaystyle L}$, width ${\displaystyle b}$, and area ${\displaystyle b\,L}$. Call this the test surface.

#### Flux through the test surface

The total volumetric flux through the test surface is

${\displaystyle Q(x,y,t)=\int _{0}^{b}\int _{0}^{L}\mathbf {u} \cdot \mathbf {n} \,\mathrm {d} s\,\mathrm {d} z}$

where ${\displaystyle s}$ is an arc-length parameter defined on the curve ${\displaystyle AP}$, with ${\displaystyle s=0}$ at the point ${\displaystyle A}$ and ${\displaystyle s=L}$ at the point ${\displaystyle P}$. Here ${\displaystyle \mathbf {n} }$ is the unit vector perpendicular to the test surface, i.e.,

${\displaystyle \mathbf {n} \,\mathrm {d} s=-R\,\mathrm {d} \mathbf {r} ={\begin{bmatrix}\mathrm {d} y\\-\mathrm {d} x\\0\end{bmatrix}}}$

where ${\displaystyle R}$ is the ${\displaystyle 3\times 3}$ rotation matrix corresponding to a ${\displaystyle 90^{\circ }}$ anticlockwise rotation about the positive ${\displaystyle z}$ axis:

${\displaystyle R=R_{z}(90^{\circ })={\begin{bmatrix}0&-1&0\\1&0&0\\0&0&1\end{bmatrix}}.}$

The integrand in the expression for ${\displaystyle Q}$ is independent of ${\displaystyle z}$, so the outer integral can be evaluated to yield

${\displaystyle Q(x,y,t)=b\,\int _{A}^{P}\left(u\,\mathrm {d} y-v\,\mathrm {d} x\right)}$

#### Classical definition

Lamb and Batchelor define the stream function ${\displaystyle \psi }$ as follows.[3]

${\displaystyle \psi (x,y,t)=\int _{A}^{P}\left(u\,\mathrm {d} y-v\,\mathrm {d} x\right)}$

Using the expression derived above for the total volumetric flux, ${\displaystyle Q}$, this can be written as

${\displaystyle \psi (x,y,t)={\frac {Q(x,y,t)}{b}}}$.

In words, the stream function ${\displaystyle \psi }$ is the volumetric flux through the test surface per unit thickness, where thickness is measured perpendicular to the plane of flow.

The point ${\displaystyle A}$ is a reference point that defines where the stream function is identically zero. Its position is chosen more or less arbitrarily and, once chosen, typically remains fixed.

An infinitesimal shift ${\displaystyle \mathrm {d} P=(\mathrm {d} x,\mathrm {d} y)}$ in the position of point ${\displaystyle P}$ results in the following change of the stream function:

${\displaystyle \mathrm {d} \psi =u\,\mathrm {d} y-v\,\mathrm {d} x}$.

From the exact differential

${\displaystyle \mathrm {d} \psi ={\frac {\partial \psi }{\partial x}}\,\mathrm {d} x+{\frac {\partial \psi }{\partial y}}\,\mathrm {d} y,}$

so the flow velocity components in relation to the stream function ${\displaystyle \psi }$ must be

${\displaystyle u={\frac {\partial \psi }{\partial y}},\qquad v=-{\frac {\partial \psi }{\partial x}}.}$

Notice that the stream function is linear in the velocity. Consequently if two incompressible flow fields are superimposed, then the stream function of the resultant flow field is the algebraic sum of the stream functions of the two original fields.

### Effect of shift in position of reference point

Consider a shift in the position of the reference point, say from ${\displaystyle A}$ to ${\displaystyle A'}$. Let ${\displaystyle \psi '}$ denote the stream function relative to the shifted reference point ${\displaystyle A'}$:

${\displaystyle \psi '(x,y,t)=\int _{A'}^{P}\left(u\,\mathrm {d} y-v\,\mathrm {d} x\right).}$

Then the stream function is shifted by

{\displaystyle {\begin{aligned}\Delta \psi (t)&=\psi '(x,y,t)-\psi (x,y,t)\\&=\int _{A'}^{A}\left(u\,\mathrm {d} y-v\,\mathrm {d} x\right),\end{aligned}}}

which implies the following:

• A shift in the position of the reference point effectively adds a constant (for steady flow) or a function solely of time (for nonsteady flow) to the stream function ${\displaystyle \psi }$ at every point ${\displaystyle P}$.
• The shift in the stream function, ${\displaystyle \Delta \psi }$, is equal to the total volumetric flux, per unit thickness, through the surface that extends from point ${\displaystyle A'}$ to point ${\displaystyle A}$. Consequently ${\displaystyle \Delta \psi =0}$ if and only if ${\displaystyle A}$ and ${\displaystyle A'}$ lie on the same streamline.

### In terms of vector rotation

The velocity ${\displaystyle \mathbf {u} }$ can be expressed in terms of the stream function ${\displaystyle \psi }$ as

${\displaystyle \mathbf {u} =-R\,\nabla \psi }$

where ${\displaystyle R}$ is the ${\displaystyle 3\times 3}$ rotation matrix corresponding to a ${\displaystyle 90^{\circ }}$ anticlockwise rotation about the positive ${\displaystyle z}$ axis. Solving the above equation for ${\displaystyle \nabla \psi }$ produces the equivalent form

${\displaystyle \nabla \psi =R\,\mathbf {u} .}$

From these forms it is immediately evident that the vectors ${\displaystyle \mathbf {u} }$ and ${\displaystyle \nabla \psi }$ are

• perpendicular: ${\displaystyle \mathbf {u} \cdot \nabla \psi =0}$
• of the same length: ${\displaystyle |\mathbf {u} |=|\nabla \psi |}$.

Additionally, the compactness of the rotation form facilitates manipulations (e.g., see Condition of existence).

### In terms of vector potential and stream surfaces

Using the stream function, one can express the velocity in terms of the vector potential ${\displaystyle {\boldsymbol {\psi }}}$

${\displaystyle \mathbf {u} =\nabla \times {\boldsymbol {\psi }}}$

where ${\displaystyle {\boldsymbol {\psi }}=\psi \,\mathbf {z} }$, and ${\displaystyle \mathbf {z} }$ is the unit vector pointing in the positive ${\displaystyle z}$ direction. This can also be written as the vector cross product

${\displaystyle \mathbf {u} =\nabla \psi \times \mathbf {z} }$

where we've used the vector calculus identity

${\displaystyle \nabla \times \left(\psi \mathbf {z} \right)=\psi \nabla \times \mathbf {z} +\nabla \psi \times \mathbf {z} .}$

Noting that ${\displaystyle \mathbf {z} =\nabla z}$, and defining ${\displaystyle \phi =z}$, one can express the velocity field as

${\displaystyle \mathbf {u} =\nabla \psi \times \nabla \phi .}$

This form shows that the level surfaces of ${\displaystyle \psi }$ and the level surfaces of ${\displaystyle z}$ (i.e., horizontal planes) form a system of orthogonal stream surfaces.

### Alternative (opposite sign) definition

An alternative definition, sometimes used in meteorology and oceanography, is

${\displaystyle \psi '=-\psi .}$

### Relation to vorticity

In two-dimensional plane flow, the vorticity vector, defined as ${\displaystyle {\boldsymbol {\omega }}=\nabla \times \mathbf {u} }$, reduces to ${\displaystyle \omega \,\mathbf {z} }$, where

${\displaystyle \omega =-\nabla ^{2}\psi }$

or

${\displaystyle \omega =+\nabla ^{2}\psi '}$

These are forms of Poisson's equation.

### Relation to streamlines

Consider two-dimensional plane flow with two infinitesimally close points ${\displaystyle P=(x,y,z)}$ and ${\displaystyle P'=(x+dx,y+dy,z)}$ lying in the same horizontal plane. From calculus, the corresponding infinitesimal difference between the values of the stream function at the two points is

{\displaystyle {\begin{aligned}\mathrm {d} \psi (x,y,t)&=\psi (x+\mathrm {d} x,y+\mathrm {d} y,t)-\psi (x,y,t)\\&={\partial \psi \over \partial x}\mathrm {d} x+{\partial \psi \over \partial y}\mathrm {d} y\\&=\nabla \psi \cdot \mathrm {d} \mathbf {r} \end{aligned}}}

Suppose ${\displaystyle \psi }$ takes the same value, say ${\displaystyle C}$, at the two points ${\displaystyle P}$ and ${\displaystyle P'}$. Then this gives

${\displaystyle 0=\nabla \psi \cdot \mathrm {d} \mathbf {r} ,}$

implying that the vector ${\displaystyle \nabla \psi }$ is normal to the surface ${\displaystyle \psi =C}$. Because ${\displaystyle \mathbf {u} \cdot \nabla \psi =0}$ everywhere (e.g., see In terms of vector rotation), each streamline corresponds to the intersection of a particular stream surface and a particular horizontal plane. Consequently, in three dimensions, unambiguous identification of any particular streamline requires that one specify corresponding values of both the stream function and the elevation (${\displaystyle z}$ coordinate).

The development here assumes the space domain is three-dimensional. The concept of stream function can also be developed in the context of a two-dimensional space domain. In that case level sets of the stream function are curves rather than surfaces, and streamlines are level curves of the stream function. Consequently, in two dimensions, unambiguous identification of any particular streamline requires that one specify the corresponding value of the stream function only.

### Condition of existence

It's straightforward to show that for two-dimensional plane flow ${\displaystyle \mathbf {u} }$ satisfies the curl-divergence equation

${\displaystyle (\nabla \cdot \mathbf {u} )\,\mathbf {z} =-\nabla \times (R\,\mathbf {u} )}$

where ${\displaystyle R}$ is the ${\displaystyle 3\times 3}$ rotation matrix corresponding to a ${\displaystyle 90^{\circ }}$ anticlockwise rotation about the positive ${\displaystyle z}$ axis. This equation holds regardless of whether or not the flow is incompressible.

If the flow is incompressible (i.e., ${\displaystyle \nabla \cdot \mathbf {u} =0}$), then the curl-divergence equation gives

${\displaystyle \mathbf {0} =\nabla \times (R\,\mathbf {u} )}$.

Then by Stokes' theorem the line integral of ${\displaystyle R\,\mathbf {u} }$ over every closed loop vanishes

${\displaystyle \oint _{\partial \Sigma }(R\,\mathbf {u} )\cdot \mathrm {d} \mathbf {\Gamma } =0.}$

Hence, the line integral of ${\displaystyle R\,\mathbf {u} }$ is path-independent. Finally, by the converse of the gradient theorem, a scalar function ${\displaystyle \psi (x,y,t)}$ exists such that

${\displaystyle R\,\mathbf {u} =\nabla \psi }$.

Here ${\displaystyle \psi }$ represents the stream function.

Conversely, if the stream function exists, then ${\displaystyle R\,\mathbf {u} =\nabla \psi }$. Substituting this result into the curl-divergence equation yields ${\displaystyle \nabla \cdot \mathbf {u} =0}$ (i.e., the flow is incompressible).

In summary, the stream function for two-dimensional plane flow exists if and only if the flow is incompressible.

### Potential flow

For two-dimensional potential flow, streamlines are perpendicular to equipotential lines. Taken together with the velocity potential, the stream function may be used to derive a complex potential. In other words, the stream function accounts for the solenoidal part of a two-dimensional Helmholtz decomposition, while the velocity potential accounts for the irrotational part.

### Summary of properties

The basic properties of two-dimensional stream functions can be summarized as follows:

1. The x- and y-components of the flow velocity at a given point are given by the partial derivatives of the stream function at that point.
2. The value of the stream function is constant along every streamline (streamlines represent the trajectories of particles in steady flow). That is, in two dimensions each streamline is a level curve of the stream function.
3. The difference between the stream function values at any two points gives the volumetric flux through the vertical surface that connects the two points.

## Two-dimensional stream function for flows with time-invariant density

If the fluid density is time-invariant at all points within the flow, i.e.,

${\displaystyle {\frac {\partial \rho }{\partial t}}=0}$,

then the continuity equation (e.g., see Continuity equation#Fluid dynamics) for two-dimensional plane flow becomes

${\displaystyle \nabla \cdot (\rho \,\mathbf {u} )=0.}$

In this case the stream function ${\displaystyle \psi }$ is defined such that

${\displaystyle \rho \,u={\frac {\partial \psi }{\partial y}},\quad \rho \,v=-{\frac {\partial \psi }{\partial x}}}$

and represents the mass flux (rather than volumetric flux) per unit thickness through the test surface.