Conservation of Mass

The derivative \( D\rho / Dt \) is the time rate of change of fluid density following a fluid particle. It will be zero for constant density flow where \( \rho = \) constant throughout the flow field, and for incompressible flow where the density of fluid particles does not change but different fluid particles may have different density: \[ \frac{D\rho}{Dt} \equiv \frac{\partial \rho}{\partial t} + \mathbf{u} \cdot \nabla \rho = 0 \] Taken together, \(\frac{1}{\rho(\mathbf{x}, t)} \frac{D}{Dt} \rho(\mathbf{x}, t) + \nabla \cdot \mathbf{u}(\mathbf{x}, t) = 0\) and \(\frac{D\rho}{Dt} \equiv \frac{\partial \rho}{\partial t} + \mathbf{u} \cdot \nabla \rho = 0\) imply

\[ \nabla \cdot \mathbf{u} = 0 \] for incompressible flows

Constant density flows are a subset of incompressible flows; \( \rho = \) constant is a solution of \(\frac{D\rho}{Dt} \equiv \frac{\partial \rho}{\partial t} + \mathbf{u} \cdot \nabla \rho = 0\) but it is not a general solution. A fluid is usually called incompressible if its density does not change with pressure.
Liquids are almost incompressible. Gases are compressible, but for flow speeds less than ~100 m/s the fractional change of absolute pressure in a room temperature airflow is small. In this and several other situations, density changes in the flow are also small and \(\frac{D\rho}{Dt} \equiv \frac{\partial \rho}{\partial t} + \mathbf{u} \cdot \nabla \rho = 0\) and \(\nabla \cdot \mathbf{u} = 0\) are valid.
The general form of the continuity equation \[ \frac{\partial \rho(\mathbf{x}, t)}{\partial t} + \nabla \cdot \left( \rho(\mathbf{x}, t) \, \mathbf{u}(\mathbf{x}, t) \right) = 0 \quad \text{or in index notation:} \quad \frac{\partial \rho}{\partial t} + \frac{\partial}{\partial x_i} (\rho u_i) = 0 \] is typically required when the derivative \( D\rho / Dt \) is nonzero because of changes in the pressure, temperature, or molecular composition of fluid particles