---
title: "Continuity equation; seepage under a dam algorithm"
subject: "Computational Techniques in Civil Engineering"
chapter: 7
key: "semester_8/computational_techniques_in_civil_engineering:continuity-gw-seepage-algorithm"
source: https://www.bctengineer.com/q/semester_8/computational_techniques_in_civil_engineering/continuity-gw-seepage-algorithm
site: BCT Engineering
---

# Continuity equation; seepage under a dam algorithm

Computational Techniques in Civil Engineering · Chapter 7: Simulation of Ground water flow

- Asked in: 2071 Bhadra, 3+5 marks
- 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/continuity-gw-seepage-algorithm
- Whole chapter: https://www.bctengineer.com/md/semester_8/computational_techniques_in_civil_engineering/chapter-7

## Question

Explain the continuity equation used in groundwater flow analysis. Write down the algorithm for simulation of seepage under a dam.

## Short answer

Continuity states net inflow minus outflow equals change in storage, leading to ∇·(K∇h)=S_s ∂h/∂t; for steady seepage it reduces to Laplace’s equation. The algorithm: define grid and boundary heads, enforce no‑flow boundaries with mirror nodes, iterate φ_new = average of neighbours until change < tolerance, then compute seepage Q = K Σ Δh across a section.

## Answer

#### Continuity equation in groundwater flow
Continuity expresses conservation of mass. For a small control volume $\Delta x\,\Delta y\,\Delta z$ of porous medium,
$$
\text{inflow}-\text{outflow}=\text{rate of change of water stored}
$$
With Darcy fluxes $q_x,q_y,q_z$, specific storage $S_s$ and a source/sink term $W$ (recharge positive):
$$
-\left(\frac{\partial q_x}{\partial x}+\frac{\partial q_y}{\partial y}+\frac{\partial q_z}{\partial z}\right)+W=S_s\frac{\partial h}{\partial t}
$$
Substituting Darcy's law ($q_x=-K_x\,\partial h/\partial x$, and similarly for $y$ and $z$) gives the groundwater flow equation
$$
\frac{\partial}{\partial x}\left(K_x\frac{\partial h}{\partial x}\right)+\frac{\partial}{\partial y}\left(K_y\frac{\partial h}{\partial y}\right)+\frac{\partial}{\partial z}\left(K_z\frac{\partial h}{\partial z}\right)=S_s\frac{\partial h}{\partial t}-W
$$
For steady flow ($\partial h/\partial t=0$) without sources in a homogeneous, isotropic soil, it reduces to the Laplace equation $\nabla^2h=0$, which is used for seepage under a dam.

#### Algorithm for seepage under a dam
1. **Define the problem:** draw the vertical section, choose a square grid ($\Delta x=\Delta y$) covering the dam foundation down to the impervious layer, and number the nodes.
2. **Read data:** upstream head $h_1$, downstream head $h_2$, hydraulic conductivity $K$, grid spacing, tolerance $\varepsilon$ and maximum number of iterations.
3. **Boundary conditions:** set $\phi=h_1$ on the upstream bed nodes and $\phi=h_2$ on the downstream bed nodes; mark the dam base and the impervious layer as no-flow boundaries (use mirror nodes).
4. **Initialise** all interior potentials, e.g. by linear interpolation between $h_1$ and $h_2$.
5. **Iterate:** for each interior node compute
$$
\phi_{i,j}^{new}=\tfrac14\left(\phi_{i+1,j}+\phi_{i-1,j}+\phi_{i,j+1}+\phi_{i,j-1}\right)
$$
   (using the no-flow form on impervious boundaries). Record the largest change $\Delta_{max}$.
6. **Test:** if $\Delta_{max}>\varepsilon$, go to step 5; otherwise stop.
7. **Seepage rate:** compute $Q=K\sum_j(\phi_{i,j}-\phi_{i+1,j})$ over a vertical section below the dam (per unit length of dam), and check it at another section.
8. **Output:** the potentials at all nodes (for equipotential lines and the flow net) and the seepage $Q$.

## Check yourself

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

1. What principle does the continuity equation in groundwater flow express?
   A. Energy is conserved along a streamline
   B. Flow velocity is proportional to head squared
   C. Conservation of mass: net inflow minus net outflow equals the rate of change of water stored
   D. Head is constant in time at every point
   Answer: C. Continuity is mass balance on a control volume: inflow minus outflow equals storage change. (Key point: Meaning of continuity)

2. Under which conditions does the groundwater flow equation reduce to the Laplace equation used for seepage under a dam?
   A. Steady flow, no sources, homogeneous isotropic soil
   B. Transient flow with high specific storage
   C. Steady flow with a strong recharge term
   D. Anisotropic soil with Kx different from Ky
   Answer: A. dh/dt = 0 removes storage, W = 0 removes sources, and constant isotropic K cancels, leaving nabla^2 h = 0. (Key point: Reduction to Laplace)

3. In the seepage-under-dam algorithm, how are the boundaries set?
   A. Fixed heads h1 and h2 on upstream and downstream beds; the dam base and impervious layer as no-flow using mirror nodes
   B. All boundaries fixed at h1
   C. Dam base fixed at h2, impervious layer at h1
   D. All boundaries are no-flow
   Answer: A. The water bodies give specified heads while the dam base and impervious layer allow no flow. (Key point: Boundary conditions in the algorithm)

4. How does the algorithm decide when to stop iterating?
   A. After exactly one sweep of all nodes
   B. When the heads at all nodes equal h1
   C. When the seepage rate Q is zero
   D. When the largest change in any node potential in a sweep is not greater than the tolerance
   Answer: D. Each sweep applies the 1/4 average and records the maximum change; iteration stops once it is within the tolerance. (Key point: Iteration and stopping)

## Related in Computational Techniques in Civil Engineering

- [Steady 2D model: seepage under a dam](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Aseepage-under-dam-2d-model) — Computational Techniques in Civil Engineering, chapter 7, asked 3×
- [2D groundwater FD scheme, boundary conditions](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Agw-2d-fd-boundary-flow-coefficients) — Computational Techniques in Civil Engineering, chapter 7
- [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

## Related in other subjects

- [Seepage under embankment dam on pervious foundation](https://www.bctengineer.com/question.md?key=semester_7%2Fhydropower_engineering%3Aseepage-pervious-foundation-consequences) — Hydropower Engineering, chapter 4
- [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
- [Impervious dam seepage discharge](https://www.bctengineer.com/question.md?key=semester_4%2Fsoil_mechanics%3Aimpervious-dam-seepage-discharge-numerical) — Soil Mechanics, chapter 7
- [Earth dam with filter, seepage quantity](https://www.bctengineer.com/question.md?key=semester_4%2Fsoil_mechanics%3Aearth-dam-horizontal-filter-seepage) — Soil Mechanics, chapter 7
