← All Numericals
Chapter 9 — Numericals

DEM Hydrology — Sink, Flow & Watershed

Key Formulas & Process

1. Sink Detection

A sink is a cell whose elevation is lower than ALL 8 neighbours.

Check: if Z(cell) < min(8 neighbours) → it’s a sink.

Sinks trap water and disconnect river networks — they must be filled before hydrological analysis.

2. Sink Filling

Formula: Filled value = min(8 neighbours)

Raise the sink cell to match its lowest neighbour so water can flow out.

3. Flow Direction (D8)

Each cell flows to the neighbour with the steepest downhill slope.

For cardinal directions: slope = ΔZ / cell_size

For diagonal directions: slope = ΔZ / (cell_size × √2)

D8 Codes: E=1, SE=2, S=4, SW=8, W=16, NW=32, N=64, NE=128

4. Flow Accumulation

Count how many cells flow into each cell (upstream count).

Start from ridge cells (FA=0) and trace downstream, adding 1 for each contributing cell.

The cell with the highest FA is the outlet of the entire grid.

5. River Network

Formula: River threshold (cells) = Threshold area / cell area

Cell area = resolution × resolution (e.g., 30m × 30m = 900 m²)

All cells with FA ≥ threshold are river cells.

6. Watershed Area

Formula: Watershed area = Number of contributing cells × cell area

The watershed includes ALL cells that drain to the outlet point.

For the grid outlet: watershed area = total cells × cell area.

Standard Process (Exam Steps)

  1. Find sinks: Check each interior cell — is it lower than ALL 8 neighbours?
  2. Fill sinks: Raise to min(8 neighbours)
  3. Flow Direction: For each cell, find the neighbour with steepest drop
  4. Flow Accumulation: Count upstream cells flowing into each cell
  5. River Network: Convert threshold area to cells; mark FA ≥ threshold as river
  6. Watershed: Count all cells draining to the outlet; multiply by cell area

Q1. 6×6 DEM, 30m — Full Process VERIFIED

Exam: 2080 Chaitra Q10 [2+2+2+3+3 = 12 Marks]

Question: Given a 6×6 DEM with 30m resolution and area threshold 4500 m²:

(a) Identify sinks and fill   (b) Flow direction   (c) Flow accumulation   (d) River network   (e) Watershed area

ABCDEF
1130128102101124138
21351189788114121
311098846892103
41158681787687
5112102847396105
612911810385119105

(a) Sink Detection & Filling

⚙ Q1_SinkFill.calc
1
2
3
4
5
6
7
8
9
10
11
// Check each interior cell against 8 neighbours
Sink 1: D3 = 68
Neighbours: C2=97 D2=88 E2=114 C3=84 E3=92 C4=81 D4=78 E4=76
Min neighbour = 76 (E4)   68 < 76 ⇒ SINK
Fill: 76
Sink 2: D5 = 73
Neighbours: C4=81 D4=78 E4=76 C5=84 E5=96 C6=103 D6=85 E6=119
Min neighbour = 76 (E4)   73 < 76 ⇒ SINK
Fill: 76
Hydrology · DEMUTF-8

(b) Flow Direction (D8)

ABCDEF
1↘→↘↓↙↓
2↘↘↘↓↙↙
3↘→→↘↓↙
4→→→→✖←
5↗→→→↑↖
6↗↗↑↑←↖

✖ = Outlet — E4 is the outlet (76)

(c) Flow Accumulation

⚙ Q1_FlowAccum.calc
1
2
3
4
5
6
7
8
9
// Flow Accumulation (upstream cell count)
// A B C D E F
R1: 0 0 1 0 0 0
R2: 0 1 0 4 0 1
R3: 0 1 4 17 2 0
R4: 0 3 4 0 35 0
R5: 0 1 4 7 1 0
R6: 0 0 0 1 0 0
// Highest FA = E4 (35) — this is the outlet
Hydrology · DEMUTF-8

(d) River Network & (e) Watershed

⚙ Q1_River_Watershed.calc
1
2
3
4
5
6
7
8
// River threshold
Threshold = 4500 m² / (30 × 30) = 5 cells
River cells (FA≥5): D3(17) E4(35) D5(7)
// Watershed at outlet E4
All 36 cells drain to E4
Area = 36 × 900 = 32,400 m²
Hydrology · DEMUTF-8

Q2. 6×6 DEM, 100m VERIFIED

Exam: 2079 Chaitra Q8 [10 Marks]

Question: Given a 6×6 DEM with 100m resolution. Find sinks, fill, flow direction, flow accumulation, river network (threshold 40,000 m²), and watershed.

ABCDEF
1787269715849
2746756494650
3694044373748
4645855222224
5786147212119
6745334121112

Flow Direction (D8)

ABCDEF
1↘↘↘↓↓↙
2↘↓↘↓↓↙
3→→↘↓↓↓
4↗↑→↓↘↓
5↘↘→↓↓↓
6→→→→✖←

✖ = Outlet — E6 (11) is the outlet

⚙ Q2_2079Chaitra.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// ── (a) Sink & Fill ──
Sink: B3 = 40
Neighbours: A2=74 B2=67 C2=56 A3=69 C3=44 A4=64 B4=58 C4=55
Min neighbour = 44 (C3)   40 < 44 ⇒ SINK
Fill: 44
// ── (b) Flow Accumulation ──
// A B C D E F
R1: 0 0 0 0 0 0
R2: 0 1 1 2 2 0
R3: 0 6 7 5 4 0
R4: 0 0 0 15 5 1
R5: 0 0 0 17 0 8
R6: 0 2 4 23 35 9
// ── River & Watershed ──
Threshold = 40,000 / (100×100) = 4 cells
River: B3(6) C3(7) D3(5) E3(4) D4(15) E4(5)
D5(17) F5(8) C6(4) D6(23) E6(35) F6(9)
Watershed = 36 × 10,000 = 360,000 m² = 36 ha
Hydrology · DEMUTF-8

Q3. 6×5 DEM, 100m — Threshold 6 NEW

Exam: 2075 Magh Q3b [8 Marks]

Question: A 6×5 DEM with 100m resolution is given below. (a) Identify and fill any sinks. (b) Determine the flow direction (D8) and flow accumulation. (c) Delineate the river network using a flow-accumulation threshold of 6 cells. (d) Compute the watershed area at the outlet.

ABCDE
1510500490480470
2505495490475480
3500485455470475
4495490480465470
5490485475455450
6500490480460445

Flow Direction (D8)

ABCDE
1↘→↘→✖
2↘↘↓↙↑
3→→↘↓↙
4↘↗↘↘↓
5→→→↘↓
6↗↗→→✖

✖ = Outlet — E6 (445) is the main outlet

⚙ Q3_2075Magh.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// ── Sink & Fill ──
Sink: C3 = 455
Neighbours: B2=495 C2=490 D2=475 B3=485 D3=470 B4=490 C4=480 D4=465
Min = 465 (D4)   455 < 465 ⇒ SINK
Fill: 465
// ── Flow Accumulation ──
// A B C D E
R1: 0 0 1 0 2
R2: 0 1 0 2 0
R3: 0 3 11 0 0
R4: 0 0 0 14 0
R5: 0 2 4 6 16
R6: 0 0 0 1 26
River (FA≥6): C3(11) D4(14) D5(6) E5(16) E6(26)
Watershed at E6 = 27 × 10,000 = 270,000 m² = 27 ha
Hydrology · DEMUTF-8

Q4. 6×6 DEM — Flow Direction NEW

Exam: 2075 Bhadra Q9a [8 Marks]

Question: A 6×6 DEM with 100m resolution is given below. (a) Detect and fill any sinks. (b) Compute the D8 flow direction and flow accumulation for every cell. (c) Identify the river network (FA ≥ 5 cells) and report the watershed area at the main outlet.

ABCDEF
1585255535658
2554042455155
3483420334852
4332328272538
5172021222324
6121015181617

Flow Direction (D8)

ABCDEF
1↘↓↓↓↙↙
2→↘↓↙↙↙
3↘↓↙←↓↙
4↓↙↓↓↙↓
5↓↓↙↙↓↓
6→✖←←✖←

✖ = Outlet — B6 (10) is the main outlet

⚙ Q4_2075Bhadra.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// ── Sink & Fill ──
Sink: C3 = 20
Min neighbour = 23 (B4)   20 < 23 ⇒ SINK
Fill: 23
// ── Flow Accumulation ──
// A B C D E F
R1: 0 0 0 0 0 0
R2: 0 3 1 2 1 0
R3: 0 0 12 2 1 0
R4: 0 15 0 0 3 0
R5: 17 0 1 5 0 1
R6: 18 30 7 0 4 2
River (FA≥5): C3(12) B4(15) A5(17) D5(5)
A6(18) B6(30) C6(7)
Watershed = 31 × 10,000 = 310,000 m² = 31 ha
Hydrology · DEMUTF-8

Q5. 6×6 DEM — Threshold 4 NEW

Exam: 2074 Magh Q5b [10 Marks]

Question: Given the 6×6 DEM (30m resolution) shown below, (a) detect and fill all sinks, (b) determine the D8 flow direction, (c) compute the flow accumulation, (d) extract the river network using a threshold of 4 cells, and (e) calculate the catchment (watershed) area at the pour point D5.

ABCDEF
1109106104103114115
2107105102100112113
310510310095110112
41061059990108110
51071109894110111
61081119695112115

Flow Direction (D8)

ABCDEF
1→↘↘↓←↙
2↘↘↘↓↙↙
3→→→↓↙↙
4↗→→↓←←
5↑→→✖←↖
6↑→↗↑←↑

✖ = Outlet — D5 is the outlet (pour point)

⚙ Q5_2074Magh.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// ── Sink & Fill ──
Sink: D4 = 90
Min neighbour = 94 (D5)   90 < 94 ⇒ SINK
Fill: 94
// ── Flow Accumulation ──
// A B C D E F
R1: 0 1 0 1 0 0
R2: 0 0 2 3 1 0
R3: 0 3 5 17 1 0
R4: 0 2 3 27 4 0
R5: 1 0 1 35 0 1
R6: 0 0 1 1 0 0
River (FA≥4): C3(5) D3(17) D4(27) E4(4) D5(35)
Catchment = 36 × 30×30 = 32,400 m²
Hydrology · DEMUTF-8

Q6. 6×5 DEM, 100m — Threshold 10 NEW

Exam: 2074 Bhadra Q2b [12 Marks]

Question: The 6×5 DEM below has a 100m cell size. (a) Locate and fill any sinks. (b) Compute the D8 flow direction and flow accumulation. (c) Delineate the river network for a flow-accumulation threshold of 10 cells. (d) Determine the watershed area drained by the main outlet E6.

ABCDE
1480500490480485
2505495490475480
3500485455470475
4495490480465470
5490485475455450
6500490480460445

Flow Direction (D8)

ABCDE
1✖←↘↓↙
2↑↘↓↙↙
3→→↘↓↙
4↘↗↘↓↓
5→→→↘↓
6↗↗→→✖

✖ = Outlet — E6 (445) is the main outlet

⚙ Q6_2074Bhadra.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ── Sink & Fill ──
Sink: C3 = 455
Min neighbour = 465 (D4)   455 < 465 ⇒ SINK
Fill: 465
// ── Flow Accumulation ──
// A B C D E
R1: 2 0 0 0 0
R2: 0 0 0 3 0
R3: 0 2 10 1 0
R4: 0 0 0 14 0
R5: 0 2 4 6 16
R6: 0 0 0 1 26
River (FA≥10): C3(10) D4(14) E5(16) E6(26)
Hydrology · DEMUTF-8

Watershed at E6 (445) = 27 × 10,000 = 270,000 m² = 27 ha

Q7. 6×5 DEM, 30m — Pour Point NEW

Exam: 2073 Magh Q7 [10 Marks]

Question: A 6×5 DEM with 30m resolution is provided. (a) Identify and fill the sink. (b) Determine the D8 flow direction and flow accumulation for each cell. (c) Extract the river network using a flow-accumulation threshold of 4 cells. (d) Compute the watershed area at the pour point E6.

ABCDE
1118112109111115
2114107968992
310940847779
410499956265
56868676164
66260585650

Flow Direction (D8)

ABCDE
1↘↘↘↓↓
2↘↓↘↓↓
3→→↘↓↓
4↓↓→↓↙
5↓↓↓↘↓
6→→→→✖

✖ = Outlet — E6 (50) is the outlet

⚙ Q7_2073Magh.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// ── Sink & Fill ──
Sink: B3 = 40
Min neighbour = 84 (C3)   40 < 84 ⇒ SINK
Fill: 84
// ── Flow Accumulation ──
// A B C D E
R1: 0 0 0 0 0
R2: 0 1 1 2 1
R3: 0 4 5 5 2
R4: 0 0 0 17 3
R5: 1 1 0 18 0
R6: 2 5 7 8 29
River (FA≥4): B3(4) C3(5) D3(5) D4(17) D5(18)
B6(5) C6(7) D6(8) E6(29)
Hydrology · DEMUTF-8

Watershed = 30 cells × 900 = 27,000 m² = 2.7 ha

Q8. 5×5 DEM NEW

Exam: 2072 Ashwin Q5b [8 Marks]

Question: A 5×5 DEM with 100m resolution is given. (a) Identify the sink and fill it. (b) Determine the D8 flow direction and flow accumulation. (c) Delineate the river network for a threshold of 5 cells, and (d) compute the total watershed area drained by the outlet C1.

ABCDE
110098979899
210510310299100
310710595100101
4109106104102104
5115112110109108

Flow Direction (D8)

ABCDE
1→→✖←←
2↑↑↑↖↖
3↗→↗←↖
4→↗↑↖↑
5↗↑↑↑↖

✖ = Outlet — C1 (97) is the outlet

⚙ Q8_2072Ashwin.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// ── Sink ──
Sink: C3 = 95
Min neighbour = 99 (D2)   95 < 99 ⇒ SINK
Fill: 99
// ── Flow Accumulation ──
// A B C D E
R1: 1 4 24 2 0
R2: 0 1 0 14 0
R3: 0 0 7 3 1
R4: 0 3 1 2 0
R5: 0 0 0 0 0
River (FA≥5): C1(24) D2(14) C3(7)
Hydrology · DEMUTF-8

Watershed = 25 cells × 10,000 = 250,000 m²

Q9. 4×4 DEM — Threshold 9 NEW

Exam: 2071 Magh Q4a [2+2+2 Marks]

Question: The 4×4 DEM shown below has a 100m resolution. (a) Determine the D8 flow direction at every cell, showing the slope calculations for the steepest-descent path. (b) Compute the flow accumulation. (c) Identify the river network using a threshold of 9 cells and find the watershed area at the outlet D4.

ABCD
1156144138142
214813411298
31381068874
412811611044

Flow Direction (D8)

ABCD
1↘↘↘↓
2↘↘↘↓
3→→↘↓
4↗↗→✖

✖ = Outlet — D4 (44) = outlet

⚙ Q9_2071Magh.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ── Sinks ──
Sinks: None // All water flows to D4=44 (corner)
// ── Flow Direction ──
R1: SE SE SE S
R2: SE SE SE S
R3: E E SE S
R4: NE NE E OUT
// ── Flow Accumulation ──
R1: 0 0 0 0
R2: 0 1 1 2
R3: 0 3 7 5
R4: 0 0 0 15
River (FA≥9): D4(FA=15)    Area = 16 × 10,000 = 160,000 m²
Hydrology · DEMUTF-8

Note: This is a simple grid with no sinks — all water flows to the bottom-right corner D4 (44).

Q10. 5×5 DEM — Threshold 5 NEW

Exam: 2071 Bhadra Q7 [12 Marks]

Question: Given the 5×5 DEM (100m resolution) below, (a) detect and fill any sinks, (b) compute the D8 flow direction and flow accumulation, (c) delineate the river network using a flow-accumulation threshold of 5 cells, and (d) calculate the watershed area drained by the outlet E5.

ABCDE
19390899089
29188827978
38971727374
48683827069
58684827568

Flow Direction (D8)

ABCDE
1↘↘↘↓↓
2↘↓↓↓↓
3→→↘↓↓
4↗↑→↘↓
5↗→↗→✖

✖ = Outlet — E5 (68) is the outlet

⚙ Q10_2071Bhadra.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// ── Sink ──
Sink: B3 = 71
Min neighbour = 72 (C3)   71 < 72 ⇒ SINK
Fill: 72
// ── Flow Accumulation ──
// A B C D E
R1: 0 0 0 0 0
R2: 0 1 1 2 1
R3: 0 7 10 3 2
R4: 0 1 0 18 3
R5: 0 0 1 0 24
River (FA≥5): B3(7) C3(10) D4(18) E5(24)
Hydrology · DEMUTF-8

Watershed = 25 cells × 10,000 = 250,000 m²

Q11. 6×6 LiDAR 10m DEM NEW

Exam: 2081 Chaitra — LiDAR 10m, Threshold 1000 m²

Question: A high-resolution LiDAR-derived DEM with 10m cell size is shown below. (a) Detect and fill any sinks. (b) Compute the D8 flow direction and flow accumulation. (c) Extract the river network using a contributing-area threshold of 1000 m². (d) Determine the watershed area drained by the outlet E6.

ABCDEF
1125123121120118117
2124118119117116118
3123120118116114115
4122118116115113114
5121118114112112114
6120117115113109112

Flow Direction (D8)

ABCDEF
1↘↓↘↓↓↙
2→↘↘↘↓↙
3↘↘↘↘↓↙
4→↘↘↓↓↙
5→→→↘↓↙
6→↗↗→✖←

✖ = Outlet — E6 (109) is the outlet

⚙ Q11_2081Chaitra_LiDAR.calc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// ── Sinks ──
Sinks: None // Water flows toward E6=109 (lowest)
// ── Flow Accumulation ──
// A B C D E F
R1: 0 0 0 0 0 0
R2: 0 4 0 2 2 0
R3: 0 0 0 1 6 1
R4: 0 1 1 1 11 0
R5: 0 1 6 12 13 0
R6: 0 1 0 0 30 0
Threshold = 1000 m² / (10×10) = 10 cells
River: E4(11) D5(12) E5(13) E6(30)
Watershed = 31 cells × 100 = 3,100 m²
Hydrology · DEMUTF-8

Note: This LiDAR DEM uses 10m resolution (cell area = 100 m²), so the threshold in cells is much higher than for coarser DEMs with the same area threshold.