Skip to content

Python examples which use Firedrake to solve the Glen-Stokes equations for glaciers.

License

Notifications You must be signed in to change notification settings

bueler/stokes-ice-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stokes-ice-tutorial

ice speed in a glacier

The Glen-Stokes equations describe the ice in a glacier or ice sheet as a gravity-driven, viscous, shear-thinning flow:

$$\begin{align*} -\nabla \cdot \tau + \nabla p &= \rho_i \mathbf{g} & &\text{stress balance} \\ \nabla \cdot \mathbf{u} &= 0 & &\text{incompressibility} \\ \tau &= B_n |D\mathbf{u}|^{(1/n)-1} D\mathbf{u} & &\text{Glen flow law} \end{align*}$$

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.

prerequisites

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.

stages

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.

another playground

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:

About

Python examples which use Firedrake to solve the Glen-Stokes equations for glaciers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published