Skip to main content

Method of characteristics; FD form for pipe flow

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²).

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.

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 xx-tt 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∣Q|Q| and cannot be solved analytically for real boundary conditions.
  • Disturbances (pressure waves, water hammer) travel at finite speed aa; 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 ApA_p, diameter DD, wave speed aa, Darcy-Weisbach factor ff), with head HH and discharge QQ:

Momentum:

L1=∂Q∂t+gAp∂H∂x+f Q∣Q∣2DAp=0L_1=\frac{\partial Q}{\partial t}+gA_p\frac{\partial H}{\partial x}+\frac{f\,Q|Q|}{2DA_p}=0

Continuity:

L2=∂H∂t+a2gAp∂Q∂x=0L_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: L1+λL2=0L_1+\lambda L_2=0.

[∂Q∂t+λa2gAp∂Q∂x]+λ[∂H∂t+gApλ∂H∂x]+fQ∣Q∣2DAp=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 dQdt\dfrac{dQ}{dt} and dHdt\dfrac{dH}{dt} along a line dx/dtdx/dt, then

dxdt=λa2gAp=gApλ ⇒ λ=±gApa,dxdt=±a\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^+C−C^-
Linedxdt=+a\dfrac{dx}{dt}=+adxdt=−a\dfrac{dx}{dt}=-a
ODE$\dfrac{gA_p}{a}\dfrac{dH}{dt}+\dfrac{dQ}{dt}+\dfrac{fQQ

Multiplying by a/(gAp)a/(gA_p):

C+: dHdt+agApdQdt+af2gDAp2Q∣Q∣=0,C−: dHdt−agApdQdt−af2gDAp2Q∣Q∣=0C^+:\ \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, Δx=aΔt\Delta x=a\Delta t)

 t
 t+dt :          P            unknown H_P, Q_P
                / \
          C+  /   \  C-
 t    :     A --C-- B         known
         (x-dx)  (x)  (x+dx)        --> x

Integrate C+C^+ from A to P and C−C^- from B to P, taking the friction term at the known point (first-order) and using aΔt=Δxa\Delta t=\Delta x:

HP=HA−Bp(QP−QA)−RpQA∣QA∣(C+)H_P=H_A-B_p\left(Q_P-Q_A\right)-R_pQ_A|Q_A|\qquad(C^+) HP=HB+Bp(QP−QB)+RpQB∣QB∣(C−)H_P=H_B+B_p\left(Q_P-Q_B\right)+R_pQ_B|Q_B|\qquad(C^-) Bp=agAp,Rp=f Δx2gDAp2B_p=\frac{a}{gA_p},\qquad R_p=\frac{f\,\Delta x}{2gDA_p^2}

Define the known quantities

K1=HA+BpQA−RpQA∣QA∣,K2=HB−BpQB+RpQB∣QB∣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 HP=K1−BpQPH_P=K_1-B_pQ_P and HP=K2+BpQPH_P=K_2+B_pQ_P, so

QP=K1−K22Bp,HP=K1+K22Q_P=\frac{K_1-K_2}{2B_p},\qquad H_P=\frac{K_1+K_2}{2}

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

✓ Answer checked by Claude Opus 5.5 (high effort)

All Computational Techniques in Civil Engineering chapter 6 questions →