The Glen-Stokes equations describe the ice in a glacier or ice sheet as a gravity-driven, viscous, shear-thinning flow:
This repository contains a practical tutorial on solving these coupled partial differential equations numerically, by using the finite element method.
The Python programs here are relatively-short and only solve idealized problems. We do not use any observational data from real glaciers.
We use the Firedrake library, which calls PETSc to solve the equations. See the Firedrake install directions to install both libraries. Note that each time you start Firedrake you will need to activate the Python virtual environment:
source firedrake/bin/activate
Also, for stage1/
and stage2/
you will need Gmsh to generate the meshes, and for all stages I recommend Paraview to visualize the results.
To do this tutorial, read slides.pdf
and follow the stages. Each stage is self-contained, with increasing sophistication. In stage1/
and stage2/
, mesh-generation and Stokes solution are separated. Later stages combine these actions into a single program by using extruded meshes, starting in stage3/
. Then stage4/
shows more robust numerics and better diagnostics, and stage5/
shows a 3D ice sheet with a bumpy bed. All stages use direct solvers, which limits ultimate performance, but they all allow parallel runs.
I have written another open-source Stokes solver for glaciology, with a different and less-introductory, emphasis, but using the same Firedrake/PETSc/Gmsh/Paraview stack: