This tutorial describes the 2D Steady Flow in Heterogeneous Aquifers applet, which solves steady-state groundwater flow using the finite element method across a rectangular domain with heterogeneous hydraulic conductivity. After computing the head and velocity fields, you can track flow paths from individual points or animate the movement of a particle cloud to observe macro-scale dispersion.
For the mathematical background, see the Solution Tutorial.
The applet window is divided into three regions: a toolbar at the top, a main canvas in the center, and a data panel on the right.
- Toolbar (top): Five step buttons (Start → Properties → Head → Flow → Animation) are enabled sequentially as each step completes. Three zoom controls sit below them.
- Main canvas (center): Displays the domain, drawn head contours, K color map, flow paths, and particle cloud.
- Data panel (right): Four tabs — Head, Velocity, Paths, Export — update live as the simulation progresses.
- Status bar (bottom of canvas): Shows the current step prompt and cursor coordinates.
The applet is driven by five sequential steps shown in the toolbar. Complete them in order — each step unlocks the next.
| Step | Button | What it does |
|---|---|---|
| 1 | Start | Define the grid dimensions and hydraulic gradient. |
| 2 | Properties | Assign hydraulic conductivity and porosity to the domain — by zone, random, or Fgen92 field. |
| 3 | Head | Solve the steady-state flow equation (FEM) and draw head contours. |
| 4a/4b | Flow | Choose flow-path tracking (click to place seed points) or particle-cloud mode (draw a polygon to seed particles). |
| 5a/5b | Animation | Configure time step and playback speed, then click the canvas to start the animation. |
Click Start to open the setup dialog. This defines the rectangular flow domain and the mean hydraulic gradient driving flow.
| Parameter | Default | Description |
|---|---|---|
| Grid spacing (m) | 10 | Physical distance between finite element nodes. Smaller spacing gives finer resolution but a slower solve. |
| Number of columns | 30 | Number of grid columns in the x-direction. Domain width = columns × spacing. |
| Number of rows | 20 | Number of grid rows in the y-direction. Domain height = rows × spacing. |
| Average hydraulic gradient | 0.01 | Mean head gradient driving flow from left to right; sets the boundary head difference h₁ − h₂. |
Click OK — the domain grid is drawn on the canvas and the Properties button becomes active.
Click Properties to open the zone editor. Up to 5 zones are available, each with its own color, hydraulic conductivity K (m/s), and porosity (%).
| Mode | Description |
|---|---|
| Select above | Select a zone row, click OK, then draw a polygon on the canvas to paint that zone. Right-click or double-click to close the polygon. Draw zones as needed — last drawn wins where polygons overlap. |
| Randomize | Assigns a random K zone to every grid cell instantly — quick way to create discrete heterogeneity. |
| Fgen92 | Opens the Fgen92 dialog to generate a spatially correlated, continuous random log-K field with a user-specified correlation length and variance. |
Fgen92 — Spatially Correlated Random K Field
Selecting Fgen92 and clicking OK opens a full-screen dialog that generates a log-normal hydraulic conductivity field using the FGEN92 spectral simulation algorithm. The dialog has three panels:
Field Parameters (left panel)
| Parameter | Description |
|---|---|
| Mean (ln K) | Mean of the natural log of hydraulic conductivity. E.g., −5.2 gives geometric mean K ≈ 5.5×10⁻³ m/s. |
| Variance | Variance of ln K. Higher values produce stronger K contrasts. Typical range: 0.5–3.0; default 1.04. |
| Nugget | Spatially uncorrelated variance added to the spectrum. Usually 0 for smoothly correlated fields. |
| Correlation model | Exponential: exponentially decaying autocovariance — common for natural aquifers. Gaussian: smoother, bell-shaped autocovariance. |
| Lambda_x (m) | Correlation length in x (flow direction). Controls how far K patches extend along flow. Larger = longer connected features. |
| Lambda_y (m) | Correlation length in y. Typically smaller than Lambda_x in layered aquifers, producing horizontally elongated patterns. |
| Random Seed | Integer seed for the PRNG. The same seed always produces the same field realization. |
| nfull_x / nfull_y | Full periodic grid size for the spectral FFT (power of 2, ≥ Nx and Ny). Larger improves spectral accuracy. |
Output Statistics (left panel)
| Statistic | Description |
|---|---|
| Mean | Sample mean of ln K across all grid cells — should be close to the input Mean (ln K). |
| Variance | Sample variance of ln K — should be close to the input Variance. |
| Std Dev | Sample standard deviation of ln K. |
| Min K / Max K | Minimum and maximum hydraulic conductivity values (in m/s) in the generated field. |
Field Plot and Color Schemes (center & right panels)
The center panel shows a color map of the generated ln K field (blue = low K, red = high K). Hover over any cell to see its coordinates and ln K value. Four color schemes are selectable from the right panel:
| Scheme | Description |
|---|---|
| Smooth Shading | Continuous gradient — best for visualizing full spatial variability. |
| Contour by 5% Steps | 20 discrete color bands — useful for identifying distinct high/low K regions. |
| Contour by 10% Steps | 10 discrete color bands. |
| Custom No. of Contours | Enter any number of color bands in the adjacent box. |
Cross-Section Controls (right panel)
- Choose Horizontal or Vertical to set the transect direction.
- Hover over the field plot — the cross-section profile updates live at the cursor's row or column.
- Click the field to lock a cross-section line. Locked lines appear as dashed overlays on the field and are listed below the controls with a × button to remove each one.
- Autocovariance — shows the empirical autocovariance in x and y compared to the theoretical model curve.
- Additional Output — reports detailed variance and truncation statistics from the spectral simulation.
- Display Log K Output — opens a 2D table of ln K values and a Download CSV button exporting the field as an x-vs-y array.
Applying the Field
Click OK (Apply to Model) to close the dialog. The domain redraws with the continuous K color map, and the Head button becomes active.
Click Head and enter the number of contour intervals (typically 10–30). The applet solves the steady-state groundwater flow equation using FEM and draws head contour lines over the domain.
| Boundary | Condition |
|---|---|
| Left (AD) | Specified head h₁ (higher) |
| Right (BC) | Specified head h₂ = 0 (lower) |
| Top (AB) and Bottom (DC) | No-flow (∂h/∂y = 0) |
Head statistics (min, max, cursor value) appear in the Head tab of the right data panel. Once flow paths are added, head contours turn grey so paths remain visually distinct.
Click Flow to open the flow options dialog. Two modes are available:
4a — Flow Path Tracking
Select Flow path tracking and click OK. Then click anywhere on the canvas to place a seed point — a flow line is computed through that point.
| Option | Description |
|---|---|
| Forward and backward | Traces the flow path in both directions from the seed point. |
| Forward only | Traces only downstream from the seed point. |
| Backward only | Traces only upstream from the seed point. |
Right-click any flow line to open a context menu to change its color, thickness, or remove it.
4b — Particle Cloud
Select Particle movement, set the initial particle spacing (m), and click OK. Then draw a polygon on the canvas — particles are seeded on a regular grid inside the polygon. The Animation step then moves them forward in time.
Line Style
Set the default line color and thickness in the dialog before clicking OK. Individual lines can be restyled via right-click after placement.
Click Animation to configure and run the animation. Parameters available for both flow-path and particle modes:
| Parameter | Description |
|---|---|
| Travel time per sim. second | How many days or years of transport are represented by one second of animation playback. |
| Time unit | Days or years — sets the display unit for the elapsed time label. |
| Frames per second | Animation playback speed: 1, 5, 10, 15, or 20 fps. |
Additional parameters for particle mode only:
| Parameter | Description |
|---|---|
| Longitudinal dispersivity αL | Adds stochastic longitudinal spreading to particle paths. |
| Transverse dispersivity αT | Adds stochastic transverse spreading to particle paths. |
| Show center of mass ± N std. dev. | Draws an ellipse showing the centroid and spatial spread of the particle cloud. |
| Plot spatial variance vs time | Opens a secondary graph of Sxx and Syy over time. |
| Plot spatial mean vs time | Opens a secondary graph of xc and yc over time. |
After clicking OK, click the canvas to start the animation. Click again to pause or resume. Elapsed time updates in the status bar.
The right panel has four tabs that update as the simulation progresses:
| Tab | Contents |
|---|---|
| Head | Min and max head values across the domain; head value at the cursor position. |
| Velocity | Max Darcy flux and seepage velocity; qx, qy, vx, vy, |q|, |v| at cursor; average seepage velocity per zone. |
| Paths | For flow-path mode: number of tracked paths and max/min travel time. For particle mode: particle count, spacing, max/min travel time, and dispersivity values. |
| Export | Buttons to display and download head data, velocity field, flow-path data, and properties grid. |
| Action | Effect |
|---|---|
| Mouse wheel | Zoom in or out centered on the cursor position. |
| + button | Zoom in by 1.5×. |
| ⊙ button | Reset zoom to fit the full domain in the canvas. |
| − button | Zoom out by 1.5×. |
| Shift + drag | Pan the view. |
| Middle-mouse drag | Pan the view. |
From the Export tab in the right data panel, display and download simulation results:
| Dataset | Contents | Formats |
|---|---|---|
| Head Data | Node positions and computed hydraulic head values. | TXT, CSV |
| Velocity Field | Darcy flux and seepage velocity components at each element centroid. | TXT, CSV |
| Flow / Particle Paths | Coordinates and travel times for each tracked path or particle. | TXT, CSV |
| Properties Grid | Element K zones, hydraulic conductivity, and porosity. | TXT, CSV |
The Log K field can also be downloaded as a 2D x-vs-y CSV table from the Display Log K Output button inside the Fgen92 dialog.