---
title: "Derive continuity equation for unsteady pipe flow"
subject: "Hydraulics"
chapter: 4
key: "semester_4/hydraulics:continuity-equation-unsteady-pipe-flow"
source: https://www.bctengineer.com/q/semester_4/hydraulics/continuity-equation-unsteady-pipe-flow
site: BCT Engineering
---

# Derive continuity equation for unsteady pipe flow

Hydraulics · Chapter 4: Unsteady flow in pipes

- Asked in: 2068 Magh, 8 marks
- Video: [Continuity Eqn for one Dimensional | Derive Continuity Eqn | Fluid Mechanics | Prashant YT |](https://www.youtube.com/watch?v=0iV9NJ6-Ybc) — Prashant YT
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_4/hydraulics/continuity-equation-unsteady-pipe-flow
- Whole chapter: https://www.bctengineer.com/md/semester_4/hydraulics/chapter-4

## Question

Derive following continuity equation for unsteady flow in pipes $\frac{1}{\rho}\frac{dp}{dt} + c^2\frac{\partial v}{\partial s} = 0$. Where $c = \sqrt{K/\rho}$ is celerity and other symbols have their usual meanings.

## Short answer

Mass conservation for a compressible fluid in an elastic pipe leads to (1/ρ)dp/dt + c² ∂v/∂s = 0. The celerity c accounts for water compressibility K and pipe elasticity D/(eE); for a rigid pipe, c = √(K/ρ).

## Answer

The continuity equation expresses conservation of mass in a pipe in which the water is slightly compressible and the pipe wall is elastic.

#### Set-up
Take a control volume of length $\delta s$ in a pipe of cross-section $A$, with density $\rho$ and velocity $v$ along the pipe axis $s$.

```text
        mass in             mass out
  rho A v --> |<-- ds -->| --> rho A v + d(rho A v)/ds ds
```

#### Mass balance
The net mass flow into the element equals the rate of increase of mass inside it:
$$
-\frac{\partial(\rho A v)}{\partial s}\delta s=\frac{\partial(\rho A\,\delta s)}{\partial t}
$$
$$
\frac{\partial(\rho A v)}{\partial s}+\frac{\partial(\rho A)}{\partial t}=0
$$
Expanding and dividing by $\rho A$:
$$
\frac{1}{\rho}\left(\frac{\partial\rho}{\partial t}+v\frac{\partial\rho}{\partial s}\right)+\frac{1}{A}\left(\frac{\partial A}{\partial t}+v\frac{\partial A}{\partial s}\right)+\frac{\partial v}{\partial s}=0
$$
i.e.
$$
\frac{1}{\rho}\frac{d\rho}{dt}+\frac{1}{A}\frac{dA}{dt}+\frac{\partial v}{\partial s}=0\qquad(1)
$$
where $d/dt$ is the derivative following the fluid.

#### Compressibility of water
From the bulk modulus, $K=\dfrac{dp}{d\rho/\rho}$:
$$
\frac{1}{\rho}\frac{d\rho}{dt}=\frac{1}{K}\frac{dp}{dt}\qquad(2)
$$

#### Elasticity of pipe wall
For a thin-walled pipe of diameter $D$, thickness $e$ and modulus $E$, the hoop stress is $\sigma=pD/2e$ and the strain is $\varepsilon=\Delta D/D=\sigma/E$. As $A\propto D^2$:
$$
\frac{1}{A}\frac{dA}{dt}=\frac{2}{D}\frac{dD}{dt}=\frac{2}{E}\frac{D}{2e}\frac{dp}{dt}=\frac{D}{eE}\frac{dp}{dt}\qquad(3)
$$

#### Result
Substitute (2) and (3) in (1):
$$
\frac{1}{K}\left(1+\frac{KD}{eE}\right)\frac{dp}{dt}+\frac{\partial v}{\partial s}=0
$$
Multiply by $K/\left(1+\dfrac{KD}{eE}\right)$ and divide by $\rho$:
$$
\frac{1}{\rho}\frac{dp}{dt}+\frac{K/\rho}{1+\dfrac{KD}{eE}}\frac{\partial v}{\partial s}=0
$$
With celerity $c=\sqrt{\dfrac{K/\rho}{1+KD/(eE)}}$:
$$
\boxed{\frac{1}{\rho}\frac{dp}{dt}+c^2\frac{\partial v}{\partial s}=0}
$$
For a rigid pipe ($E\to\infty$), $c=\sqrt{K/\rho}$, which is the speed of sound in water (about 1480 m/s at 20 °C, with $K\approx2.2$ GPa); this is the form given in the question.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. The derivation starts from
   A. Bernoulli equation
   B. Newton's third law
   C. Conservation of mass for a control volume
   D. Conservation of energy
   Answer: C. Net mass inflow equals the rate of increase of mass inside. (Key point: Basic principle)

2. Water compressibility is introduced via
   A. Young's modulus
   B. Viscosity
   C. Surface tension
   D. Bulk modulus: (1/rho) d rho/dt = (1/K) dp/dt
   Answer: D. From K = dp/(d rho/rho). (Key point: Compressibility)

3. Pipe wall elasticity contributes the term
   A. dA/dx = 0
   B. E/D
   C. A/K
   D. (1/A) dA/dt = (D/eE) dp/dt
   Answer: D. Hoop stress pD/2e causes strain, and A is proportional to D^2. (Key point: Pipe elasticity)

4. The resulting celerity is
   A. c = sqrt(E/K)
   B. c = sqrt(K rho)
   C. c = K/rho
   D. c = sqrt((K/rho)/(1 + KD/eE))
   Answer: D. For a rigid pipe it reduces to sqrt(K/rho). (Key point: Celerity)

## Related in Hydraulics

- [Derive laminar velocity in inclined pipe](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Alaminar-inclined-pipe-velocity-derivation) — Hydraulics, chapter 1
- [Define water hammer; continuity and momentum equations](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Awater-hammer-define-continuity-momentum-equations) — Hydraulics, chapter 4
- [Second parallel pipe to increase flow](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Atwo-reservoirs-second-pipe-increase-flow) — Hydraulics, chapter 2
- [Colebrook-White equation for smooth and rough pipes](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Acolebrook-white-equation-validity) — Hydraulics, chapter 1
- [Water hammer, Euler and continuity equations](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Awater-hammer-euler-continuity-equations) — Hydraulics, chapter 4
- [Wall friction force for developing pipe flow](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Afriction-force-parabolic-velocity-pipe) — Hydraulics, chapter 1

## Related in other subjects

- [Derive differential continuity equation](https://www.bctengineer.com/question.md?key=semester_7%2Fapplied_computational_fluid_dynamics%3Acontinuity-equation-differential-form) — Applied Computational Fluid Dynamics, chapter 2
- [Algorithm for unsteady pipe flow FD equations](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Aalgorithm-pipe-fd-hp-equations) — Computational Techniques in Civil Engineering, chapter 6
- [Derive continuity equation](https://www.bctengineer.com/question.md?key=semester_3%2Felectromagnetism%3Acontinuity-equation-derive-forms) — Electromagnetism, chapter 2, asked 2×
- [Continuity equation in Cartesian coordinates](https://www.bctengineer.com/question.md?key=semester_4%2Ffluid_mechanics_mechanical%3Acontinuity-equation-cartesian-derivation) — Fluid Mechanics, chapter 4
