# Finding stream function from velocity fields.

Consider a velocity field $$u = x\hat{i}+2y\hat{j}$$. To find its stream function,$$\frac{\partial\psi}{\partial y}=x$$ $$\psi = xy + f(x)$$ and $$\frac{\partial\psi}{\partial x}=-2y$$ $$\psi=-2xy+g(y)$$ I am stuck at this point because both $$\psi$$ do not agree with each other and arbitrary functions $$f$$ and $$g$$ are not single variable if we proceed further. Please help in proceeding further to find the stream function of this velocity field.

The given velocity field does not correspond to incompressible flow since the continuity equation is not satisfied, i.e.,

$$\nabla \cdot \mathbf{u} = \frac{\partial u }{\partial x} + \frac{\partial v}{\partial y} = \frac{\partial}{\partial x} (x) + \frac{\partial }{\partial y} (2y) = 3 \neq 0$$

The streamfunction does not exist in this case.

A proof of the existence of a streamfunction for two-dimensional, incompressible flow satisfying $$\psi_y = u, \, \psi_x = -v$$ is given here.

Aside

This velocity field is irrotational with

$$\nabla \times \mathbf{u} = \frac{\partial v }{\partial x} - \frac{\partial u}{\partial y} = 0,$$

and can be expressed in terms of a poatential

$$\mathbf{u} = - \nabla \phi,$$

where $$\phi = -x^2/2 - y^2 +C$$.