Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

200 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stokes-ice-tutorial

purpose

Provide an easy-to-modify and well-documented finite element solver for glacier modeling, for planar and 3D glacier geometries, without shallowness assumptions in the equations.

ice speed in a glacier

versions

  • v2.1 Switch pressure elements.
  • v2.0 Well-behaved glacial evolution in stage4/.
  • v1.0 The first version of this tutorial was for glacier dynamics only, for fixed geometry.

model equations

The Glen-Nye-Stokes equations describe the dynamics of 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-Nye flow law} \end{align*}$$

The free surface of a glacier is governed by an additional equation, coupled to the above, which has the surface mass balance as a source term:

$$\begin{align*} \frac{\partial s}{\partial t} - \mathbf{u}|_s \cdot \mathbf{n}_s &= a \hspace{10mm} \text{free-surface kinematics} \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 model 2D and 3D land-based glaciers with moving margins. The emphasis is on modern and robust solver techniques.

The codes are documented by slides.pdf.

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 venv-firedrake/bin/activate

You will need Gmsh to generate certain meshes (but only for stage1/ and stage2/). For all stages Paraview is recommended to visualize the results.

tutorial in stages

To do this tutorial, read slides.pdf and follow the stages. Each stage is essentially self-contained, with increasing sophistication.

The first three stages use fixed geometry and address how to solve the Glen-Nye-Stokes equations for the dynamics of ice.

In stage1/ and stage2/, mesh-generation and Stokes solution are separate actions. Mesh generation uses Gmsh on .geo geometry-outline files, which generates .msh mesh files.

stage3/ combines meshing and solving into a single program by using extruded meshes. (Mesh management is entirely through Firedrake, but the base mesh could be read from a .msh if desired.) For this stage one can choose 2D (planar) or full 3D glacier geometry at runtime.

stage4/ solves the coupled system above, only in 2D (planar). That is, we combine the Glen-Nye-Stokes dynamics model with the free-surface equation. The coupled system, which is solved by time-stepping for a moving-margin case by default, permits the glacier to evolve in response to a climate (surface mass balance) model. Several advanced and recent techniques are applied in this stage.

All stages can be run in parallel.

known limitations

  • We do not use any observational data from, and thus we do not actually model, any real glaciers.
  • We do not model sliding, nor floating ice.
  • The stages all currently use direct solvers, which limits scalability, especially in 3D.
  • The time-stepping in stage4/, though apparently very well-behaved under the applied stabilization and adaptive techniques, remains mostly-explicit and CFL-limited.
  • In the moving-margin cases for stage4/, there is a mass-conservation error committed at the free boundary.
  • In stage3/ and stage4/, reading a .msh for the base mesh is easy but it requires code modifications.
  • In stage4/, adding a surface mass balance model is easy but it requires code modifications.

other glacier-related solvers using Firedrake

  • I wrote an earlier open-source Stokes solver for glaciology. It uses the same Firedrake/PETSc/Gmsh/Paraview stack. See the py/stokes/ directory in my McCarthy materials.

  • Icepack by Dan Shapero and others is a general-purpose glacier and ice-sheet modeling framework based on Firedrake.

About

A Firedrake solver for the Glen-Nye-Stokes equations for glaciers, with evolving surfaces.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages