---
title: "Saint-Venant, second-order explicit scheme"
subject: "Computational Techniques in Civil Engineering"
chapter: 5
key: "semester_8/computational_techniques_in_civil_engineering:saint-venant-second-order-explicit"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/saint-venant-second-order-explicit
site: BCT Engineering
---

# Saint-Venant, second-order explicit scheme

Computational Techniques in Civil Engineering · Chapter 5: Finite difference method

- Asked in: 2074 Bhadra, 6 marks; 2072 Asoj, 6 marks (asked 2 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/saint-venant-second-order-explicit
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-5

## Question

Derive the finite difference equations for the full Saint-Venant equations representing the fluid flow using a second order accurate explicit scheme (dynamic wave model).

## Short answer

Using leapfrog central differences, continuity: y_i^(n+1)=y_i^(n-1)−(Δt/(BΔx))(Q_{i+1}^n−Q_{i-1}^n)+2Δt q_i^n/B. Momentum: Q_i^(n+1)=Q_i^(n-1)−(Δt/Δx)[(Q^2/A)_{i+1}^n−(Q^2/A)_{i-1}^n]−gA_i^n(Δt/Δx)(y_{i+1}^n−y_{i-1}^n)+2gΔt A_i^n(S_0−S_f) with friction at n−1. Stability requires Δt ≤ Δx/(|V|+√(gA/B)).

## Answer

The dynamic-wave model uses the full Saint-Venant equations. A second-order accurate explicit scheme is obtained by replacing every derivative with a **central difference** in both space and time (the leapfrog scheme).

#### Governing equations
For a channel of top width $B$ (so $\partial A/\partial t=B\,\partial y/\partial t$):
$$
B\frac{\partial y}{\partial t}+\frac{\partial Q}{\partial x}=q
$$
$$
\frac{\partial Q}{\partial t}+\frac{\partial}{\partial x}\left(\frac{Q^2}{A}\right)+gA\frac{\partial y}{\partial x}-gA(S_0-S_f)=0
$$

#### Grid and central differences
```text
 t
 n+1 :        o (i, n+1)   unknown
 n   :  x-----x-----x      (i-1, i, i+1) known
 n-1 :        x (i, n-1)   known
       i-1    i    i+1   --> x
```
For any variable $f$ at $(i,n)$:
$$
\frac{\partial f}{\partial t}\approx\frac{f_i^{n+1}-f_i^{n-1}}{2\Delta t},\qquad
\frac{\partial f}{\partial x}\approx\frac{f_{i+1}^{n}-f_{i-1}^{n}}{2\Delta x}
$$
Both are accurate to $O(\Delta t^2)$ and $O(\Delta x^2)$ (the $f''$ terms cancel in the Taylor series).

#### Finite difference equations
**Continuity:**
$$
B\,\frac{y_i^{n+1}-y_i^{n-1}}{2\Delta t}+\frac{Q_{i+1}^n-Q_{i-1}^n}{2\Delta x}=q_i^n
$$
$$
y_i^{n+1}=y_i^{n-1}-\frac{\Delta t}{B\,\Delta x}\left(Q_{i+1}^n-Q_{i-1}^n\right)+\frac{2\Delta t}{B}q_i^n
$$
**Momentum:**
$$
\frac{Q_i^{n+1}-Q_i^{n-1}}{2\Delta t}+\frac{1}{2\Delta x}\left[\left(\frac{Q^2}{A}\right)_{i+1}^n-\left(\frac{Q^2}{A}\right)_{i-1}^n\right]+gA_i^n\frac{y_{i+1}^n-y_{i-1}^n}{2\Delta x}-gA_i^n\left(S_0-S_{f,i}\right)=0
$$
$$
Q_i^{n+1}=Q_i^{n-1}-\frac{\Delta t}{\Delta x}\left[\left(\frac{Q^2}{A}\right)_{i+1}^n-\left(\frac{Q^2}{A}\right)_{i-1}^n\right]-gA_i^n\frac{\Delta t}{\Delta x}\left(y_{i+1}^n-y_{i-1}^n\right)+2g\Delta t\,A_i^n\left(S_0-S_{f,i}\right)
$$
with $S_{f,i}=\dfrac{n^2Q_i^{n-1}|Q_i^{n-1}|}{(A_i^{n-1})^2(R_i^{n-1})^{4/3}}$. The friction term is lagged to level $n-1$ (a central evaluation at $n$ would be unstable for this explicit scheme).

#### Solution procedure
1. Initial condition gives $Q_i^0,y_i^0$; the first step to level 1 is made with a one-step scheme (e.g. forward in time) because level $-1$ does not exist.
2. For each later step, compute $y_i^{n+1}$ and $Q_i^{n+1}$ at all interior points from the equations above.
3. Boundaries: upstream $Q(t)$ from the inflow hydrograph; downstream a stage or rating curve $Q=f(y)$.
4. Time step limit (Courant condition): $\Delta t\le\dfrac{\Delta x}{|V|+\sqrt{gA/B}}$.

**Note:** an equally common second-order explicit alternative is the two-step Lax-Wendroff/MacCormack scheme (predictor-corrector).

## Check yourself

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

1. How is the second-order explicit (leapfrog) scheme obtained?
   A. Forward difference in time and backward in space
   B. Backward difference in both
   C. Central differences in both space and time
   D. Implicit averaging at level n+1
   Answer: C. Replacing each derivative by a central difference in space and time gives O(dt^2) and O(dx^2) accuracy. (Key point: Second-order explicit idea)

2. In the leapfrog scheme, which values give dQ/dt at (i, n)?
   A. (Q_i^{n+1} - Q_i^n)/dt
   B. (Q_i^{n+1} - Q_i^{n-1})/(2 dt)
   C. (Q_i^n - Q_i^{n-1})/dt
   D. (Q_{i+1}^n - Q_{i-1}^n)/(2 dt)
   Answer: B. The central time difference uses levels n+1 and n-1, so the unknown at n+1 is found from known n and n-1 values. (Key point: Time difference)

3. Why is the friction slope evaluated at level n-1?
   A. A central evaluation at n would be unstable for this explicit scheme
   B. Because level n values are unknown
   C. Because friction is negligible at n
   D. To make the scheme implicit
   Answer: A. Lagging friction to n-1 keeps the explicit leapfrog stable, since evaluating at n would not be. (Key point: Friction lag)

4. How is the first step started and how is delta t limited?
   A. Start with central differences; dt unlimited
   B. Start with level -1 data; dt <= dx/c with c = V only
   C. Start with a one-step scheme (level -1 does not exist); dt <= dx/(|V| + sqrt(gA/B))
   D. Start with the implicit method; dt <= 1 hour
   Answer: C. Leapfrog needs levels n and n-1, so a one-step scheme makes the first step, and the Courant condition uses the dynamic wave celerity. (Key point: Start-up and time step)

## Related in Computational Techniques in Civil Engineering

- [Full Saint-Venant explicit scheme numerical (50 m)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asaint-venant-explicit-k8) — Computational Techniques in Civil Engineering, chapter 5, asked 2×
- [Full Saint-Venant explicit scheme numerical (10 m)](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asaint-venant-explicit-m3) — Computational Techniques in Civil Engineering, chapter 5, asked 2×
- [Second-order scheme, linear kinematic wave](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asecond-order-linear-kinematic-scheme) — Computational Techniques in Civil Engineering, chapter 5
- [First and second order finite difference schemes](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Afd-first-second-order-schemes) — Computational Techniques in Civil Engineering, chapter 5, asked 2×
- [Second-order non-linear kinematic wave; FDM principle](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Asecond-order-nonlinear-kinematic-principle) — Computational Techniques in Civil Engineering, chapter 5
- [Finite difference method; explicit and implicit schemes](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Afdm-explicit-implicit) — Computational Techniques in Civil Engineering, chapter 5, asked 2×

## Related in other subjects

- [Second derivative central difference scheme](https://www.bctengineer.com/question.md?key=semester_7%2Fapplied_computational_fluid_dynamics%3Asecond-derivative-central-difference) — Applied Computational Fluid Dynamics, chapter 3
- [Stress concentration and Saint-Venant's principle](https://www.bctengineer.com/question.md?key=semester_3%2Fstrength_of_materials%3Astress-concentration-saint-venant) — Strength of Materials, chapter 3
- [Torsion of non-circular bars by Saint-Venant](https://www.bctengineer.com/question.md?key=semester_5%2Fmechanics_of_solids%3Asaint-venant-prandtl-stress-function) — Mechanics of Solids, chapter 9
