Does stream function hold only for steady flow? This is just a basic question about streamline, equation of streamline and stream function. I am used to perceiving that the stream fucntion is just another form of the equations of streamlines. Since streamlines can be obtained at an "instant time" of an unsteady flow field, then the stream function should be the same, it could be obtained at an instant time of an unsteady flow field.
However, I stuck at this point: consider an unsteady, compressible, 2D - flow field at an instant time, it has stream function $\bar {\psi}$. From textbooks, we already know:
$$\rho u = \frac{\partial \bar {\psi}}{\partial y}\space\space\space (1) $$ 
$$\rho v = -\frac{\partial \bar {\psi}}{\partial x}\space\space\space (2) $$
Then I do some maths:
$$(1)\Rightarrow \frac{\partial (\rho u)}{\partial x} = \frac{\partial^2 \bar {\psi}}{\partial y \partial x}$$
$$(2)\Rightarrow -\frac{\partial (\rho v)}{\partial y} = \frac{\partial^2 \bar {\psi}}{\partial x \partial y}$$
Since $\frac{\partial^2 \bar {\psi}}{\partial y \partial x} = \frac{\partial^2 \bar {\psi}}{\partial x \partial y}  $, hence:
$$\frac{\partial (\rho u)}{\partial x} = -\frac{\partial (\rho v)}{\partial y} \iff \frac{\partial (\rho u)}{\partial x} + \frac{\partial (\rho v)}{\partial y}=0 \iff \nabla.(\rho\vec V)=0\space\space\space (3)$$
But continuity equation says:
$$\frac{\partial \rho}{\partial t}+ \nabla.(\rho\vec V)=0\space\space\space (4)$$
Here you can see the flow field is unsteady, then $\frac{\partial \rho}{\partial t}$ is not equal zero and the equation (4) is inconsistent with (3). Here is where I stuck... if I am wrong, so does stream function hold only for steady flow?
 A: Generalizing your mathematics (which are all correct), the 2D stream function automatically satisfies continuity for any 2D case where $\partial\rho / \partial t$ is zero. In flows other than these, you must independently confirm that your results satisfy continuity.
A: @Peter: I have clicked your link and read it. I think we should forget temporarily about true meaning of these words: steady or unsteady, imcompressible or compressible...let's the equations speak words. Does your answer above mean stream function only hold for flow which has $\partial\rho / \partial t = 0$, despite it is steady or unsteady or whatever ? If the answer is yes, so is this true: consider a 2D flow has:
V = u$\vec i$  + v$\vec j$ ; u = u(x, y, t) ; v = v(x, y, t);
$\rho = (x+y)t^2$.
Suppose we already have u and v so that the equation (4) is true (at any point, any instant  time of the flow, satisfying continuity equation). Now, consider this flow at instant time t = 1 . At this instant time, $\partial\rho / \partial t = 2(x+y)t = 2(x+y) \ne 0$. So at this instant time, we can not obtain stream function for this flow. Isn't it true?
A: Continuity is $\frac{\partial \rho}{\partial t} + \nabla\cdot (\rho \hat V)=0 $  or $\frac{\partial \rho}{\partial t} + \rho \nabla \cdot \hat V + \hat V \cdot \nabla \rho =0 $. The value of a stream function is that it takes two functions $u(x,y,t)$ and $v(x,y,t)$ and replaces them with one higher order function $\psi(x,y,t)$. This relationship holds for 2-D flow, whether steady or not. And, the substitution of the stream function into the continuity equation only applies spatially to $u$ and $v$. There are no time derivatives of velocity in mass conservation.
Therefore $\frac{\partial^2 \psi}{\partial x \partial y} =\frac{\partial u}{\partial x}$ and $-\frac{\partial^2 \psi}{\partial x \partial y}=\frac{\partial v}{\partial y}$ replace $\rho \nabla \cdot \hat V = \rho(\frac{\partial u}{\partial x}+\frac{\partial v}{\partial y})=\rho(\frac{\partial^2 \psi}{\partial x \partial y}-\frac{\partial^2 \psi}{\partial x \partial y})=0$. But, there are additional terms that describe the rate of change of density, i.e. the convective parts, namely $u\frac{\partial \rho}{\partial x}+v\frac{\partial \rho}{\partial y}$ that when added to the local density changes $\frac{\partial \rho}{\partial t}$ will equal zero.
Taking the suggestion above for an unsteady scalar density function $\rho = (x+y)t^2$, its material derivative shows that indeed a stream function exists in the form of $\psi=x^2/t-y^2/t$. From this stream function we find that $u=-2y/t$ and $v=-2x/t$. Substituting into the local and and convective terms results in $\frac{\partial \rho}{\partial t}+u\frac{\partial \rho}{\partial x}+v\frac{\partial \rho}{\partial y}=2t(x+y)-2y/t*t^2-2x/t*t^2=0$. And by inspection of $u$ and $v$, the divergence is also zero, but we already found this using the stream function. From this we see that the time dependent or local changes in density are offset by the spatial changes in density and indeed $\frac{\partial \rho}{\partial t}$ is non-zero, but the stream function exists and continuity is satisfied.
