Constant mass flux in fluid dynamics? OK so I am having a conceptual crisis about Hydrodynamics.
1) Since mass should be conserved, is $\frac{dm}{dt}=0$ ?
2) But I know that the formula $\rho_1u_1A_1 = \rho_2u_2A_2$ exists... and doesn't that mean the mass flux is conserved? Where does this formula come from?
3) How can we derive an expression for $\frac{dm}{dt}=0$ from the continuity equation  $\frac{\partial\rho}{\partial t} + \nabla\cdot(\rho\mathbf{u})=0$
 A: OK so in the end I found an answer:
$\textbf{Derivation}$
Mass is conserved, so $$\frac{dm}{dt} = 0$$
But $$m = \iiint \rho(\mathbf{r}, t)d^3\mathbf{r} $$ so that $$ \frac{dm}{dt} = \iiint \frac{\partial \rho(\mathbf{r}, t)}{\partial t}d^3\mathbf{r} = 0$$.
From the continuity equation $$ \frac{\partial \rho(\mathbf{r}, t)}{\partial t} = -\nabla \cdot(\rho\mathbf{u})$$.
So $$ \iiint \frac{\partial \rho(\mathbf{r}, t)}{\partial t}d^3\mathbf{r} = 0 \quad\text{implies} \quad -\iiint \nabla \cdot(\rho\mathbf{u}) d^3\mathbf{r}=0$$ which using Stokes' theorem becomes $$ \iint \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\;\;\;\subset\!\supset  (\rho\mathbf{u})\cdot d\mathbf{S} = 0$$
Applying this to a flow like the one in the diagram
so that the velocity is parallel to the cross sectional areas ($A_1$ and $A_2$) and there is no vertical component of the velocity in the top and bottom surfaces.
Assuming the density and the velocity are constants over that area (at a fixed $x$), the integral becomes:
$$ \rho_1A_1\mathbf{v_1} = \rho_2A_2\mathbf{v_2} $$
$\textbf{Possible second derivation}$
There should also be another way of deriving this:
Starting once again from $$\frac{dm}{dt} = 0$$ and using  the definition of a convective derivative (or Lagrangian derivative) $$ \frac{d}{dt} = \frac{\partial}{\partial t} + (\mathbf{u}\cdot\nabla)$$ where $\frac{\partial}{\partial t}$ is the Eulerian derivative, we get $$ \frac{\partial m}{\partial t} = -(\mathbf{u}\cdot\nabla)m $$
No idea how to get to the required equation though.
Any pointers?
