The fundamental requirement for incompressible flow is that the density, \rho , is constant within a small element volume,
dV, which moves at the flow velocity
u. Mathematically, this constraint implies that the
material derivative (discussed below) of the density must vanish to ensure incompressible flow. Before introducing this constraint, we must apply the
conservation of mass to generate the necessary relations. The mass is calculated by a
volume integral of the density, \rho : : {m} = {\iiint\limits_V\! \rho \,\mathrm{d}V}. The conservation of mass requires that the
time derivative of the mass inside a
control volume be equal to the
mass flux,
J, across its boundaries. Mathematically, we can represent this constraint in terms of a
surface integral: : {\partial m \over \partial t} = - \oint_{S}\mathbf{J} \cdot d\mathbf{S} The negative sign in the above expression ensures that outward flow results in a decrease in the mass with respect to time, using the convention that the surface area vector points outward. Now, using the
divergence theorem we can derive the relationship between the flux and the partial time derivative of the density: : {\iiint\limits_V {\partial \rho \over \partial t} \,\mathrm{d}V} = {- \iiint\limits_V\left(\nabla\cdot\mathbf{J}\right) \, \mathrm{d}V}, therefore: : {\partial \rho \over \partial t} = - \nabla \cdot \mathbf{J}. The
partial derivative of the density with respect to time need not vanish to ensure incompressible
flow. When we speak of the partial derivative of the density with respect to time, we refer to this rate of change within a control volume of
fixed position. By letting the partial time derivative of the density be non-zero, we are not restricting ourselves to incompressible
fluids, because the density can change as observed from a fixed position as fluid flows through the control volume. This approach maintains generality, and not requiring that the partial time derivative of the density vanish illustrates that incompressible fluids can still undergo compressible flow. What interests us is the change in density of a control volume that moves along with the flow velocity,
u. The flux is related to the flow velocity through the following function: : {\mathbf{J}} = {\rho \mathbf{u}}. So that the conservation of mass implies that: : {\partial \rho \over \partial t} + {\nabla \cdot \left(\rho \mathbf{u} \right)} = {\partial \rho \over \partial t} + {\nabla \rho \cdot \mathbf{u}} + {\rho \left(\nabla \cdot \mathbf{u} \right)} = 0. The previous relation (where we have used the appropriate
product rule) is known as the
continuity equation. Now, we need the following relation about the
total derivative of the density (where we apply the
chain rule): : {\mathrm{d}\rho \over \mathrm{d}t} = {\partial \rho \over \partial t} + {\partial \rho \over \partial x} {\mathrm{d}x \over \mathrm{d}t} + {\partial \rho \over \partial y} {\mathrm{d}y \over \mathrm{d}t} + {\partial \rho \over \partial z} {\mathrm{d}z \over \mathrm{d}t}. So if we choose a control volume that is moving at the same rate as the fluid (i.e. (
dx/
dt,
dy/
dt,
dz/
dt) =
u), then this expression simplifies to the
material derivative: : {D \rho \over Dt} = {\partial \rho \over \partial t} + {\nabla \rho \cdot \mathbf{u}}. And so using the continuity equation derived above, we see that: : {D \rho \over Dt} = {- \rho \left(\nabla \cdot \mathbf{u} \right)}. A change in the density over time would imply that the fluid had either compressed or expanded (or that the mass contained in our constant volume,
dV, had changed), which we have prohibited. We must then require that the material derivative of the density vanishes, and equivalently (for non-zero density) so must the divergence of the flow velocity: : {\nabla \cdot \mathbf{u}} = 0. And so beginning with the conservation of mass and the constraint that the density within a moving volume of fluid remains constant, it has been shown that an equivalent condition required for incompressible flow is that the divergence of the flow velocity vanishes. ==Relation to compressibility==