Overview
Groundwater lives in three dimensions and changes in time. Head, pressure and concentration are functions of several variables, \(h(x, y, z, t)\), and the laws that govern them are written with partial derivatives. This module builds the calculus you need for the rest of the course, using groundwater examples throughout: Darcy's law in 3-D (Module 3), the groundwater flow equation, flow to wells, and contaminant transport.
- Tell scalar fields from vector fields, and read contour maps of a scalar field.
- Compute partial derivatives analytically, and estimate them numerically from gridded or tabulated data.
- Compute the gradient, its magnitude and direction, and the slope of a field in any direction.
- Find the hydraulic gradient from three wells (the three-point problem).
- Use the total differential to estimate changes, and the chain rule for a moving observer (total and material derivatives).
- Explain what a PDE is, recognize Laplace's, the diffusion and the advection equations, and state boundary and initial conditions.
- Convert between Cartesian and polar coordinates, convert derivatives and the Laplacian, and reduce radial flow to a well to an ODE.
How to work through it: each section has an animation or video, a reading and an interactive tool. Videos tagged required are part of the module; optional ones go deeper. Then do the practice problems, the Brightspace quiz, and Assignment 2, which you will solve in Excel.
1Scalar and vector fields
A field is a quantity defined at every point of a region.
- A scalar field assigns a single number to each point: hydraulic head \(h(x,y,z)\), pressure \(p\), temperature \(T\), concentration \(C(x,y,z,t)\), aquifer thickness \(b(x,y)\).
- A vector field assigns a vector, with magnitude and direction: the Darcy flux \(\mathbf{q}(x,y,z) = (q_x, q_y, q_z)\), the pore velocity \(\mathbf{v}\), the gradient of a scalar field.
Scalar fields in 2-D are drawn as contour maps: curves of constant value. A water-table map is a contour map of \(h(x,y)\), exactly like a topographic map of ground elevation. Where contours are close together the field changes quickly. Vector fields are drawn as arrows, or as flow lines that are tangent to the vectors everywhere.
optional Khan Academy: Vector fields, introduction (5 min).
2Partial derivatives
The partial derivative of \(h(x,y)\) with respect to \(x\) is the ordinary derivative taken while every other variable is held fixed:
Geometrically, \(\partial h/\partial x\) is the slope of the curve you get by slicing the surface \(h(x,y)\) along a line of constant \(y\). Its units are those of \(h\) divided by those of \(x\): a head gradient in m/m is dimensionless.
Rule: differentiate with respect to one variable, treating the others as constants. For \(h = 3x^2y + 5y^3 - 2x\): \(\partial h/\partial x = 6xy - 2\) and \(\partial h/\partial y = 3x^2 + 15y^2\).
Second derivatives. \(\dfrac{\partial^2 h}{\partial x^2}\) measures curvature in \(x\). The mixed derivatives are equal for smooth functions: \(\dfrac{\partial^2 h}{\partial x\,\partial y} = \dfrac{\partial^2 h}{\partial y\,\partial x}\). In the example, \(\partial^2h/\partial x^2 = 6y\), \(\partial^2h/\partial y^2 = 30y\), and \(\partial^2h/\partial x\partial y = 6x\).
Partial derivatives from data: finite differences
In practice head is known only at wells or on a model grid, so derivatives are estimated from differences. With spacing \(\Delta x\):
The central difference is much more accurate for the same spacing. Numerical groundwater models such as MODFLOW, and the OpenHydroQual cells you used in Module 1, are built on exactly these approximations.
Finite-difference explorer
Secant lines (forward, central) vs. the tangent
Predict, then check: halve Δx. How much smaller does each error get?
3The gradient and the slope in any direction
The gradient
The gradient of a scalar field is the vector of its partial derivatives:
The gradient turns a scalar field into a vector field. At every point it points in the direction of steepest increase, its magnitude is that steepest slope, and it is perpendicular to the contour through the point. In hydrogeology \(\nabla h\) is the hydraulic gradient, and Darcy's law in vector form is \(\mathbf{q} = -K\nabla h\): water flows down the gradient, perpendicular to head contours in an isotropic aquifer.
Slope in a direction: the directional derivative
The rate of change of \(h\) per unit distance in the direction of a unit vector \(\mathbf{u} = (\cos\phi, \sin\phi)\) is
where \(\alpha\) is the angle between \(\mathbf{u}\) and \(\nabla h\). It is largest (\(|\nabla h|\)) along the gradient, zero along the contour (\(\alpha = 90°\)), and most negative (\(-|\nabla h|\)) straight downhill. If a direction is given as a vector that is not of unit length, divide it by its length first.
Example. \(h = 50 - 0.004x + 0.002y\) (m, with \(x, y\) in m). Then \(\nabla h = (-0.004,\ 0.002)\) and \(|\nabla h| = 0.00447\). Flow goes along \(-\nabla h = (0.004, -0.002)\), at \(\tan^{-1}(-0.002/0.004) = -26.6°\) from the \(+x\) axis (east-southeast if \(x\) is east). Along a canal running northeast, \(\mathbf{u} = (0.707, 0.707)\), the head changes by \(D_{\mathbf{u}}h = -0.004(0.707) + 0.002(0.707) = -0.00141\) m per m.
Field explorer
Click anywhere on the map to move the point P. Arrows show the flow direction \(-\nabla h\).
Head contours (m), flow arrows, P, ∇h (green) and u (gold)
The three-point problem
The classic field use of the gradient: with heads measured in three wells that are not in a line, assume the water table is locally a plane, \(h = ax + by + c\). The three wells give three linear equations for \(a, b, c\), and then \(\nabla h = (a, b)\).
and \(b\) is the same with the roles of \(x\) and \(y\) swapped (and the sign of the denominator reversed): \(b = \dfrac{(h_3-h_1)(x_2-x_1) - (h_2-h_1)(x_3-x_1)}{(x_2-x_1)(y_3-y_1) - (x_3-x_1)(y_2-y_1)}\). In Excel, solve the 3×3 system with MMULT(MINVERSE(…), …) or use the formulas directly.
Three-point solver
Wells, fitted head contours and the flow direction
4The total differential and the total derivative
If you move a small step \((dx, dy)\), the change in \(h\) is the sum of the changes due to each variable:
This total differential is the multivariable version of the tangent-line approximation: a tangent plane. It is also how errors propagate. If \(Q = KA\,\Delta h/L\) and \(K\) is uncertain by 30% while \(\Delta h\) is uncertain by 5%, then \(dQ/Q = dK/K + d(\Delta h)/\Delta h\), so the uncertainty in \(Q\) is dominated by \(K\).
Total derivative along a path. If the position changes in time, \(x(t), y(t)\), the chain rule gives the rate of change seen by the traveller:
Material derivative. If the field itself also changes in time, \(C(x, y, t)\), a water parcel moving with velocity \(\mathbf{v}\) experiences
\(\partial C/\partial t\) is what a monitoring well at a fixed point records. \(DC/Dt\) is what a parcel of water carried by the flow experiences. If a contaminant only moves with the water and does not react, \(DC/Dt = 0\): this is the advection equation, the core of the transport module later in the course.
Example. A plume has \(C = 80\,e^{-x/200}\) mg/L at some instant, and the concentration everywhere is rising at 0.5 mg/L per day. Water moves in \(+x\) at \(v = 0.3\) m/day. At \(x = 100\) m: \(\partial C/\partial x = -\tfrac{80}{200}e^{-0.5} = -0.243\) mg/L/m, so \(DC/Dt = 0.5 + 0.3(-0.243) = 0.427\) mg/L/day. A fixed well sees 0.5 mg/L/day; the moving parcel sees less, because it is carried toward lower concentration.
5An introduction to partial differential equations
optional Steve Brunton: Partial differential equations overview (26 min), and 3Blue1Brown: Divergence and curl (16 min).
What a PDE is
A differential equation relates an unknown function to its derivatives. If the function depends on one variable, it is an ordinary differential equation (ODE), such as \(dh/dx = -q/K\). If it depends on several, \(h(x,y,z,t)\), the equation involves partial derivatives and is a partial differential equation (PDE). Its order is the highest derivative that appears. It is linear if the unknown and its derivatives appear only to the first power and are not multiplied together.
Divergence and the continuity equation
The divergence of a vector field measures its net outflow per unit volume at a point:
Mass balance on a small box of aquifer (Animation 3) says that in steady flow, with no sources inside, as much water leaves as enters: \(\nabla\cdot\mathbf{q} = 0\). Substituting Darcy's law \(\mathbf{q} = -K\nabla h\) with constant \(K\):
\(\nabla^2\), the divergence of the gradient, is called the Laplacian. If storage changes (transient flow), the box gains or loses water and the equation gains a time derivative.
Three PDEs you will meet
| Laplace (elliptic) | \(\nabla^2 h = 0\). Steady groundwater flow, steady heat conduction. The solution at a point is the average of its surroundings: no maxima or minima inside the domain. |
|---|---|
| Diffusion (parabolic) | \(\dfrac{S}{T}\dfrac{\partial h}{\partial t} = \nabla^2 h\). Transient groundwater flow (Theis), heat, molecular diffusion. Disturbances spread out and smooth over time. |
| Advection (hyperbolic) | \(\dfrac{\partial C}{\partial t} + v\dfrac{\partial C}{\partial x} = 0\). A solute carried by flowing water. Shapes travel without spreading. Adding diffusion gives the advection–dispersion equation of contaminant transport. |
Boundary and initial conditions
A PDE has infinitely many solutions; the conditions on the boundary of the domain select the one that describes your aquifer.
- Dirichlet (specified head): \(h\) is given on the boundary, for example a lake or river in good contact with the aquifer.
- Neumann (specified flux): \(\partial h/\partial n\) is given, where \(n\) is the direction normal to the boundary. A no-flow boundary (impermeable bedrock, a groundwater divide, a line of symmetry) has \(\partial h/\partial n = 0\). Recharge across the water table is a specified flux.
- Initial condition: a transient problem also needs \(h(x,y,z,0)\) everywhere at \(t = 0\).
Check a solution by substituting it. Is \(h = x^2 - y^2\) a possible steady head field? \(\partial^2h/\partial x^2 = 2\), \(\partial^2h/\partial y^2 = -2\), sum = 0: yes. Is \(h = x^2 + y^2\)? Sum = 4 ≠ 0: no, unless water is being removed everywhere (uniform pumping or evaporation).
6Cartesian vs. radial coordinates
Cartesian coordinates \((x, y)\) suit rectangular domains. Around a well, everything depends on the distance from the well, so polar coordinates \((r, \theta)\) fit the geometry. In 3-D, adding \(z\) gives cylindrical coordinates. The well is at the origin:
Use ATAN2(x, y) in Excel (note its argument order) to get the correct quadrant; \(\tan^{-1}(y/x)\) alone cannot tell \((1,1)\) from \((-1,-1)\).
Converting derivatives: the chain rule
If \(h\) is written as a function of \(r\) and \(\theta\), it depends on \(x\) through both. From \(r^2 = x^2 + y^2\): \(\partial r/\partial x = x/r = \cos\theta\), \(\partial r/\partial y = \sin\theta\). From \(\tan\theta = y/x\): \(\partial\theta/\partial x = -\sin\theta/r\), \(\partial\theta/\partial y = \cos\theta/r\). Therefore
and the gradient in polar components is \(\nabla h = \dfrac{\partial h}{\partial r}\,\hat{\mathbf{r}} + \dfrac{1}{r}\dfrac{\partial h}{\partial\theta}\,\hat{\boldsymbol{\theta}}\). (The \(1/r\) is there because a change \(d\theta\) moves you a distance \(r\,d\theta\).) Applying the chain rule a second time and adding \(\partial^2 h/\partial x^2 + \partial^2 h/\partial y^2\), the cross terms cancel and \(\sin^2+\cos^2 = 1\) leaves
Radial flow to a well: a PDE becomes an ODE
For a single well in a uniform, isotropic aquifer, nothing depends on \(\theta\). The \(\theta\) term vanishes and steady flow (Laplace) becomes
Physically, \(r\,dh/dr = C_1\) says the same discharge \(Q = 2\pi r\,b\,K\,dh/dr\) crosses every circle around the well: water converges, so the gradient must grow as \(1/r\) near the well. With \(C_1 = Q/(2\pi T)\) and a known head \(h_0\) at radius \(R\), this is the Thiem equation, \(h = h_0 + \dfrac{Q}{2\pi T}\ln\dfrac{r}{R}\), which you will derive properly in the well hydraulics module. Transient flow to a well gives the radial diffusion equation \(\dfrac{S}{T}\dfrac{\partial h}{\partial t} = \dfrac{1}{r}\dfrac{\partial}{\partial r}\left(r\dfrac{\partial h}{\partial r}\right)\), whose solution is the Theis equation from the pilot module.
Laplacian checker: Cartesian vs. polar
Pick a function and a point. The tool computes \(\nabla^2 h\) two ways: with Cartesian finite differences, and with the polar formula. Both must agree; a function is a possible steady head field only if the result is zero.
Contours of h, with the point and its polar grid lines
7Practice (ungraded)
New numbers every time. Aim for two correct attempts in a row on each type before taking the quiz. Angles are measured counterclockwise from the +x axis, in degrees between −180 and 180.
A · Partial derivatives of a polynomial
B · Finite differences from well data
C · Gradient and directional slope
D · Three-point problem
E · Total differential
F · Material derivative
G · Is it a solution of Laplace's equation?
H · Polar coordinates and radial flow
Concept checks
1. On a water-table map the contours are close together in the east and far apart in the west. What can you conclude?
2. You walk along a contour line of a head map. What is \(D_{\mathbf{u}}h\) in your walking direction, and why?
3. Why does the radial form of Laplace's equation for a single well depend only on \(r\)?
8Graded quiz and Assignment 2
When you can do every practice problem without opening the solution, go to Brightspace → Quizzes → Module 2: Math Toolkit.
- Fields, partial derivatives, gradient and directional slope, total and material derivatives, PDEs and polar coordinates; numerical questions use different numbers for every student and attempt.
- 2 attempts, highest score counts. Calculator and notes allowed.
Then complete Assignment 2: Fields, Gradients and PDEs in a Spreadsheet, linked on the course page. You will build a head field on an Excel grid, compute its derivatives numerically and compare them with the exact ones, solve a three-point problem, follow a contaminant parcel through a changing field, and verify Laplace's equation in Cartesian and polar form. Submit your workbook in Brightspace.