Skip to main content

Continuity equation in Cartesian coordinates

Short answer

For a compressible fluid, the continuity equation is ∂ρ/∂t + ∂(ρu)/∂x + ∂(ρv)/∂y + ∂(ρw)/∂z = 0. For steady flow, ∂ρ/∂t =0 leaving ∇·(ρV)=0. For incompressible flow (ρ constant), it reduces to ∂u/∂x + ∂v/∂y + ∂w/∂z = 0.

Derive the three-dimensional differential continuity equation in Cartesian coordinates for a compressible fluid. Reduce it for steady flow and for incompressible flow.

Statement

The continuity equation expresses conservation of mass: the net rate of mass flowing out of a control volume equals the rate of decrease of mass inside it.

Derivation

Consider a fixed elemental control volume dx dy dzdx\,dy\,dz in a flow with velocity V⃗=ui^+vj^+wk^\vec V = u\hat i + v\hat j + w\hat k and density ρ\rho.

          y
          ^      _______
          |    /|      /|
          |   /_|_____/ |   dz
          |  |  |____|__|
          |  | /     | /  dy
          |  |/______|/
          +--------------> x
               dx

Mass inflow through the face perpendicular to xx (area dy dzdy\,dz) is ρu dy dz\rho u\,dy\,dz. Mass outflow through the opposite face is

[ρu+∂(ρu)∂xdx]dy dz\left[\rho u + \frac{\partial(\rho u)}{\partial x}dx\right]dy\,dz

Net outflow in the xx-direction is ∂(ρu)∂xdx dy dz\dfrac{\partial(\rho u)}{\partial x}dx\,dy\,dz. Similarly for yy and zz. Total net outflow:

[∂(ρu)∂x+∂(ρv)∂y+∂(ρw)∂z]dx dy dz\left[\frac{\partial(\rho u)}{\partial x} + \frac{\partial(\rho v)}{\partial y} + \frac{\partial(\rho w)}{\partial z}\right]dx\,dy\,dz

Rate of decrease of mass in the element: −∂ρ∂tdx dy dz-\dfrac{\partial\rho}{\partial t}dx\,dy\,dz.

Equating:

∂ρ∂t+∂(ρu)∂x+∂(ρv)∂y+∂(ρw)∂z=0\frac{\partial\rho}{\partial t} + \frac{\partial(\rho u)}{\partial x} + \frac{\partial(\rho v)}{\partial y} + \frac{\partial(\rho w)}{\partial z} = 0

or in vector form, ∂ρ∂t+∇⋅(ρV⃗)=0\dfrac{\partial\rho}{\partial t} + \nabla\cdot(\rho\vec V) = 0.

Special cases

  • Steady flow (∂ρ/∂t=0\partial\rho/\partial t = 0):
∂(ρu)∂x+∂(ρv)∂y+∂(ρw)∂z=0\frac{\partial(\rho u)}{\partial x} + \frac{\partial(\rho v)}{\partial y} + \frac{\partial(\rho w)}{\partial z} = 0
  • Incompressible flow (ρ\rho constant, steady or unsteady):
∂u∂x+∂v∂y+∂w∂z=0i.e. ∇⋅V⃗=0\frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z} = 0 \quad \text{i.e. } \nabla\cdot\vec V = 0
  • For 2D incompressible flow: ∂u/∂x+∂v/∂y=0\partial u/\partial x + \partial v/\partial y = 0.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Fluid Mechanics chapter 4 questions →