The Well of Zamzam
Hydrology & Groundwater

The Well of Zamzam

Hydrology and groundwater science hidden in a well that has flowed for four thousand years.

Hydrology & Groundwater12-Month Curriculum 10h

The Story

The Desert

The valley of Makkah is one of the harshest places on Earth. It sits in a cleft between barren granite hills in western Saudi Arabia, where summer temperatures soar past 50°C and rain falls perhaps two or three times a year. Nothing about this landscape suggests water. The rocks are dry. The soil is dust. The sky is an unbroken blue from horizon to horizon.

And yet, in the heart of this valley, inside the most sacred mosque in Islam, there is a well that has produced water continuously for over four thousand years.

Hajar’s Search

The story begins with a mother’s desperation. According to Islamic tradition, the Prophet Ibrahim (Abraham) brought his wife Hajar (Hagar) and their infant son Ismail (Ishmael) to this barren valley and left them there, trusting in God’s plan.

Hajar had a small skin of water. It ran out quickly. Her baby cried from thirst. She did what any mother would do — she searched for help. She climbed the small hill of Safa and scanned the horizon. Nothing. She ran to the hill of Marwa and looked again. Nothing. She ran back and forth seven times, growing more desperate with each pass.

When she returned to Ismail, she saw something extraordinary. Where the baby had been kicking the ground with his heels, water was bubbling up from the earth. A spring, emerging from the barren desert floor.

Hajar cupped her hands around the spring to contain it, saying "Zam! Zam!" — "Stop! Stop!" — fearing the water would run away. The spring held. It became a well. And that well attracted travellers, then traders, then settlers. A city grew around it. That city is Makkah.

The Well Today

The Well of Zamzam still flows. It sits 20 metres east of the Kaaba, the cube-shaped structure at the centre of the Grand Mosque. Today it is accessed through underground taps rather than the original open shaft, but the water comes from the same source it always has: a fractured rock aquifer in the Wadi Ibrahim valley.

The well has been tested by the Saudi Geological Survey. It produces approximately 18.5 litres per second — enough to fill a bathtub every seven seconds. During the Hajj pilgrimage, when millions of people drink from it, the well is pumped at rates exceeding 8,000 cubic metres per day. The water level drops, but it recovers within hours when pumping stops.

How? How does a well in one of the driest places on Earth produce water endlessly? The answer lies underground — in the science of hydrology and groundwater.

Where the Water Comes From

Rain that falls on the hills surrounding Makkah does not stay on the surface long. Most of it evaporates. But a fraction seeps into cracks in the rock, percolating downward through fractures and porous zones until it reaches a layer of saturated rock called an aquifer. There, it joins a slow-moving underground reservoir that feeds the well.

The Zamzam aquifer is not a single pocket of water. It is a network of fractured crystalline rock — alluvium, weathered granite, and metamorphic rock — that stores and transmits water over an area of several square kilometres. The water that emerges from the well today may have entered the ground as rain years or even decades ago. It has been filtered through rock, purified by time, and enriched with minerals along the way.

This is the story of all groundwater. It is the story of a hidden, patient cycle: rain becomes rock-water becomes spring becomes life.

The end.

Try It Yourself

Choose your level. Everyone starts with the story — the code gets deeper as you go.

Story Progress

0%

Ready to Start Coding?

Here is a taste of what Level 1 looks like for this lesson:

Level 1: Explorer — Python
# Darcy's Law Calculator
K = 0.001    # hydraulic conductivity (m/s)
A = 500      # cross-section area (m²)
h1 = 50      # upstream head (m)
h2 = 48      # downstream head (m)
L = 100      # distance between points (m)

Q = K * A * (h1 - h2) / L  # m³/s
Q_litres = Q * 1000

print(f"Hydraulic gradient: {(h1-h2)/L:.4f}")
print(f"Flow rate: {Q:.4f} m³/s = {Q_litres:.1f} L/s")
print(f"Daily flow: {Q * 86400:.0f} m³/day")

# Compare to Zamzam's 18.5 L/s
print(f"Zamzam produces: 18.5 L/s")
print(f"Our aquifer: {Q_litres:.1f} L/s")

This is just the first of 6 coding exercises in Level 1. By Level 4, you will build: Build a Groundwater Flow Simulator.

By Level 4, enrolled students build: Build a Groundwater Flow Simulator

Free

Level 0: Listener

Stories, science concepts, diagrams, quizzes. No coding.

You are here

Enrolled

Levels 1-4

Python, NumPy, Matplotlib, real projects, mentorship.

Sign Up Free

Stay Updated

Join Waitlist

Get notified when enrollment opens for your area.

Notify Me

Level 0 is always free. Coding levels (1-4) are part of our 12-Month Curriculum.