---
title: "Method of characteristics; FD form for pipe flow"
subject: "Computational Techniques in Civil Engineering"
chapter: 6
key: "semester_8/computational_techniques_in_civil_engineering:moc-definition-fd-pipe-equations"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/moc-definition-fd-pipe-equations
site: BCT Engineering
---

# Method of characteristics; FD form for pipe flow

Computational Techniques in Civil Engineering · Chapter 6: Method of Characteristics

- Asked in: 2078 Chaitra, 2+6 marks; 2078 Kartik, 1+1+3 marks; 2075 Bhadra, 2+6 marks; 2071 Bhadra, 2+6 marks (asked 4 times)
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/moc-definition-fd-pipe-equations
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-6

## Question

What do you understand by the method of characteristics (MOC) and why is it necessary? Derive the finite difference form of the characteristic equations of the unsteady pipe flow equations to obtain the solution in terms of head and discharge.

## Short answer

MOC transforms the hyperbolic pipe flow PDEs into ODEs along dx/dt = ±a, preserving wave behaviour and accommodating nonlinear friction and boundaries. Integrating C⁺ and C⁻ yields H_P = H_A − B_p(Q_P − Q_A) − R_p Q_A|Q_A| and H_P = H_B + B_p(Q_P − Q_B) + R_p Q_B|Q_B|; solving gives Q_P = (K₁−K₂)/(2B_p) and H_P = (K₁+K₂)/2, with B_p = a/(gA_p), R_p = fΔx/(2gDA_p²).

## Answer

#### Method of characteristics (MOC)
The method of characteristics converts the two partial differential equations of unsteady flow (a hyperbolic system) into ordinary differential equations that hold only along special lines in the $x$-$t$ plane, called **characteristic lines**. These ordinary equations are then integrated by finite differences.

**Why it is necessary:**
- The PDEs (continuity and momentum) are non-linear because of the friction term $Q|Q|$ and cannot be solved analytically for real boundary conditions.
- Disturbances (pressure waves, water hammer) travel at finite speed $a$; the characteristics follow exactly these waves, so the numerical solution keeps the physical wave behaviour and sharp fronts are captured.
- It handles boundary conditions (reservoir, valve, pump) conveniently, and gives accurate results for water hammer.

For unsteady flow in a closed pipe (area $A_p$, diameter $D$, wave speed $a$, Darcy-Weisbach factor $f$), with head $H$ and discharge $Q$:

**Momentum:**
$$
L_1=\frac{\partial Q}{\partial t}+gA_p\frac{\partial H}{\partial x}+\frac{f\,Q|Q|}{2DA_p}=0
$$
**Continuity:**
$$
L_2=\frac{\partial H}{\partial t}+\frac{a^2}{gA_p}\frac{\partial Q}{\partial x}=0
$$

#### Conversion to characteristic (ordinary differential) equations
Combine the two equations linearly with an unknown multiplier $\lambda$: $L_1+\lambda L_2=0$.
$$
\left[\frac{\partial Q}{\partial t}+\lambda\frac{a^2}{gA_p}\frac{\partial Q}{\partial x}\right]+\lambda\left[\frac{\partial H}{\partial t}+\frac{gA_p}{\lambda}\frac{\partial H}{\partial x}\right]+\frac{fQ|Q|}{2DA_p}=0
$$
If the two brackets are total derivatives $\dfrac{dQ}{dt}$ and $\dfrac{dH}{dt}$ along a line $dx/dt$, then
$$
\frac{dx}{dt}=\lambda\frac{a^2}{gA_p}=\frac{gA_p}{\lambda}\ \Rightarrow\ \lambda=\pm\frac{gA_p}{a},\qquad \frac{dx}{dt}=\pm a
$$
This gives two pairs of equations:

| | $C^+$ | $C^-$ |
|---|---|---|
| Line | $\dfrac{dx}{dt}=+a$ | $\dfrac{dx}{dt}=-a$ |
| ODE | $\dfrac{gA_p}{a}\dfrac{dH}{dt}+\dfrac{dQ}{dt}+\dfrac{fQ|Q|}{2DA_p}=0$ | $-\dfrac{gA_p}{a}\dfrac{dH}{dt}+\dfrac{dQ}{dt}+\dfrac{fQ|Q|}{2DA_p}=0$ |

Multiplying by $a/(gA_p)$:
$$
C^+:\ \frac{dH}{dt}+\frac{a}{gA_p}\frac{dQ}{dt}+\frac{af}{2gDA_p^2}Q|Q|=0,\qquad
C^-:\ \frac{dH}{dt}-\frac{a}{gA_p}\frac{dQ}{dt}-\frac{af}{2gDA_p^2}Q|Q|=0
$$

#### Finite difference form (rectangular grid, $\Delta x=a\Delta t$)
```text
 t
 t+dt :          P            unknown H_P, Q_P
                / \
          C+  /   \  C-
 t    :     A --C-- B         known
         (x-dx)  (x)  (x+dx)        --> x
```
Integrate $C^+$ from A to P and $C^-$ from B to P, taking the friction term at the known point (first-order) and using $a\Delta t=\Delta x$:
$$
H_P=H_A-B_p\left(Q_P-Q_A\right)-R_pQ_A|Q_A|\qquad(C^+)
$$
$$
H_P=H_B+B_p\left(Q_P-Q_B\right)+R_pQ_B|Q_B|\qquad(C^-)
$$
$$
B_p=\frac{a}{gA_p},\qquad R_p=\frac{f\,\Delta x}{2gDA_p^2}
$$
Define the known quantities
$$
K_1=H_A+B_pQ_A-R_pQ_A|Q_A|,\qquad K_2=H_B-B_pQ_B+R_pQ_B|Q_B|
$$
Then $H_P=K_1-B_pQ_P$ and $H_P=K_2+B_pQ_P$, so
$$
Q_P=\frac{K_1-K_2}{2B_p},\qquad H_P=\frac{K_1+K_2}{2}
$$

With $H_P$ and $Q_P$ known for all interior points, the boundary points are found from one characteristic plus the boundary condition (e.g. a reservoir: $H_P=H_{res}$; closed valve: $Q_P=0$), and the procedure is repeated for the next time step.

## Check yourself

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

1. MOC is used because:
   A. the equations are non-linear and waves travel at finite speed a, which characteristics follow
   B. it avoids using friction
   C. it makes the PDEs elliptic
   D. it needs no boundary conditions
   Answer: A. It turns hyperbolic PDEs into ODEs along wave paths, capturing wave behaviour. (Key point: Why MOC)

2. Combining momentum and continuity with multiplier lambda gives lines:
   A. dx/dt = 0
   B. dx/dt = +/- a
   C. dx/dt = +/- V
   D. dx/dt = +/- g
   Answer: B. lambda = +/- gA_p/a, so C+ and C- travel at +a and -a. (Key point: Characteristic lines)

3. With K1 and K2 known, Q_P and H_P are:
   A. Q_P=(K1-K2)/(2Bp), H_P=(K1+K2)/2
   B. Q_P=(K1+K2)/2, H_P=(K1-K2)/(2Bp)
   C. Q_P=K1-K2, H_P=K1+K2
   D. Q_P=(K1+K2)/(2Bp), H_P=(K1-K2)/2
   Answer: A. Equating H_P = K1 - Bp Q_P and H_P = K2 + Bp Q_P. (Key point: Solution)

4. At a closed valve the boundary condition used with the C+ equation is:
   A. H_P = H_res
   B. Q_P = 0
   C. Q_P = Q_A
   D. H_P = 0
   Answer: B. Zero discharge gives H_P = K1. (Key point: Boundaries)

## Related in Computational Techniques in Civil Engineering

- [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
- [Characteristic form FD solution (velocity, pressure)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acharacteristic-fd-velocity-pressure) — Computational Techniques in Civil Engineering, chapter 6, asked 2×
- [MOC numerical: discharge and head at P (30 cm pipe)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Amoc-pipe-discharge-head-pc-30cm) — Computational Techniques in Civil Engineering, chapter 6
- [MOC single reach, reservoir pipe (2 s)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Amoc-reservoir-pipe-sin-2) — Computational Techniques in Civil Engineering, chapter 6
- [Characteristic curve; velocity and pressure at P](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Acharacteristic-curve-pipe-numerical-b4) — Computational Techniques in Civil Engineering, chapter 6
- [MOC single reach, reservoir pipe (3 s)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Amoc-reservoir-pipe-sin-3) — Computational Techniques in Civil Engineering, chapter 6

## Related in other subjects

- [Derive continuity equation for unsteady pipe flow](https://www.bctengineer.com/question.md?key=semester_4%2Fhydraulics%3Acontinuity-equation-unsteady-pipe-flow) — Hydraulics, chapter 4
- [Velocity, head loss, discharge in pipes BC, CD, BF, FD (0.1 m)](https://www.bctengineer.com/question.md?key=semester_5%2Fwater_supply_engineering%3Aloop-c72) — Water Supply Engineering, chapter 7
- [Velocity, head loss, discharge in loop pipes BC, CD, BF, FD](https://www.bctengineer.com/question.md?key=semester_5%2Fwater_supply_engineering%3Aloop-a76) — Water Supply Engineering, chapter 7
- [Head loss and flow direction in tapering oil pipe](https://www.bctengineer.com/question.md?key=semester_6%2Fhydro_power%3Atapering-pipe-oil-flow) — Hydro Power, chapter 1
