Continuity equation
Continuity equation  

Main subject  
General microscopic balance  
Related Pages  
Important Concepts  
Del operator · Transport quantity Convective flux · Flow velocity Material derivative  
The continuity equation states that the rate at which mass enters a system is equal to the rate at which mass leaves the system plus the accumulation of mass within the system.
General development
We start with the general formulation of the microscopic balance using the Eulerian specification for the transport quantity of total mass, or
(1) 
where
 is the del or nabla operator
 is the mass density
 is the the transport quantity on a unit mass basis, which in this case is
 is the advective mass flux due to the bulk flow. is the velocity flow field. There is no molecular flux when analyzing total mass.
 . Mass is a conserved quantity (except in a nuclear reaction), hence there is no generation/consumption term.
Eq. (1) therefore is expressed as

(2) 
The time derivative can be understood as the local rate of accumulation (or loss) of mass per unit volume at a particular location, while the divergence term represents the difference between the inflow and outflow of mass on a per unit volume due to bulk flow at that location.
The continuity equation expressed as a material derivative
In order to restate (2) using the Lagrangian specification for the transport quantity of total mass, or , we apply the chain rule to to obtain

(3) 
which can be written more compactly as

(4) 
where
 represents the material (or total) derivative.
 represents the divergence of the velocity flow field
Incompressible approximation
If the fluid is a incompressible, the continuity equation simplifies to

(5) 
which means that the divergence of velocity field is zero everywhere. In Cartesian coordinates, this means that the velocity field must obey

(6) 
If purely 1dimensional fluid flow, the above equation reduces to

(7) 
which means that the velocity cannot vary along a streamline. Physically, the only way for velocity to vary along a streamline in 1dimensional flow is to also vary its density, which violates the condition of incompressibility.