The Geodynamic Modelling ToolBox is a Julia package primarily intended for teaching purposes. It provides various finite difference, staggered discretization schemes to numerically solve the governing equations of two-dimensional geodynamic problems. These include the conservation equations of:
GeoModBox.jl includes a series of exercises and examples of geodynamically well-defined problems. The exercises are provided as Jupyter notebooks for students to complete. The theoretical background is documented here.
The solvers for each governing equation can be used separately or in combination for dimensional or non-dimensional problems, with only minimal modifications when calling the functions. For more information on how to use the individual functions please see the list of functions or individual examples. Some typical initial conditions, such as a linearly increasing temperature, are predefined and can be called using specific functions. In the following a brief explanation is given regarding the governing equations and the numerical method to solve them within the GeoModBox.jl. For more detailed information see the individual documentations.
GeoModBox.jl can be installed directly through the Julia package manager or cloned from GitHub to access the complete repository, including the examples, exercises, and documentation.
Important:
GeoModBox.jluses separate Julia environments for the core package, examples, exercises, and documentation. When running examples or exercises, the correspondingexamplesorexercisesenvironment must be activated first.
For detailed instructions on installing Julia and GeoModBox.jl, setting up the required environments, and using the package as a user, student, or developer, see the Installation guide.
Selected GeoModBox.jl exercises and examples can be executed directly in Google Colab without a local Julia installation.
-
Exercise 02 – 1-D Heat Diffusion (Explicit)
-
Exercise 10 – 2-D Falling Block (time-dep.)
To properly solve the governing equations, a staggered finite difference scheme is chosen for the energy and momentum equations. A staggered grid enables a correct and straightforward implementation of boundary conditions and ensures conservation of stress between nodes in cases of variable viscosity. This requires certain parameters to be defined on different grids. For more information regarding the physical and numerical background, please refer to this.
Within the GeoModBox.jl, temperature, density, pressure, normal deviatoric stresses, and heat production rate are defined on the centroids. The deviatoric shear stresses are defined on the vertices, and velocities are defined between the vertices. Viscosity is required on both.
For further details on the implementation in GeoModBox.jl, see the individual documentations for each governing equation.
In geodynamics, the energy is described by the temperature and needs to be conserved within a closed system. Within the GeoModBox.jl, the temperature conservation equation, or temperature equation, is solved using an operator splitting method, that is, first the advective part of the temperature equation is solved, followed by the diffusive part.
GeoModBox.jl provides several finite difference schemes for solving the diffusive part of the time-dependent or steady-state temperature equation, including radioactive heating, in both 1-D and 2-D. The solvers are located in src/HeatEquation. Currently, only Dirichlet and Neumann thermal boundary conditions are supported. Most functions assume constant thermal parameters (with the exception of the 1-D solvers and the 2-D, iterative implicit solver, called iterative defect correction method).
GeoModBox.jl provides various methods to advect properties within the model domain. The routines are structured so that any property defined on centroids (including ghost nodes at all boundaries) can be advected using the described solvers. Using passive tracers, one may choose to advect either the absolute temperature or the phase ID.
On geological timescales, Earth's mantle and lithosphere deform slowly due to their high viscosity, allowing us to neglect inertial forces. This simplifies the Navier-Stokes equation into the Stokes equation. GeoModBox.jl provides two main methods to solve the Stokes equation in 1-D and 2-D: the direct method and the defect correction method, applicable for both constant and variable viscosity fields. Velocity and pressure are defined on a staggered grid, and ghost nodes are included to ensure proper implementation of free-slip and no-slip boundary conditions.
The following are visualizations of selected examples provided by GeoModBox.jl. For further details, refer to the documentation linked in each title. Each runtime can be found in the documentation of the examples and exercises.
Figure 1. Gaussian Diffusion. Time-dependent, diffusive solution of a 2-D Gaussian temperature anomaly at a resolution of 120 × 120, using the special solver with the Crank-Nicholson discretization, compared to the analytical solution. a) 2-D temperature field with numerical isotherms (solid black) and analytical isotherms (dashed yellow). b) Total deviation from the analytical solution. c) 1-D y-profile along
Figure 2. Resolution test. a) Maximum RMS error
Figure 3. Rigid-Body-Rotation. Time-dependent advection of a rotating circular temperature anomaly using the upwind (top), semi-Lagrangian (middle), and tracer (bottom) methods on a 100 × 100 grid. Within a circular region, the velocity field follows rigid rotation; outside, it is zero.
Figure 4. Isoviscous Falling Block. Time-dependent simulation of an isoviscous falling block at 50 × 50 resolution with 9 tracers per cell. The solver handles variable viscosities. Tracers advect the phase ID, which is used to interpolate density and viscosity on centroids and vertices, respectively.
Figure 5. Falling Block Sinking Velocity. Block sinking velocity vs. initial viscosity ratio
Figure 6. Falling Block Benchmark. Tracer distribution at the final stage for selected viscosity ratios
Figure 7. Rayleigh-Taylor Instability. Evolution of two-layered Rayleigh-Taylor instability.
Figure 8. Growth rate of an initial cosinusoidal perturbation in a two-layer system across various wavelengths
Figure 9. Evolution of the dimensional Van Keken benchmark. The panels show the density field, tracer distribution, viscosity, and velocity magnitude together with the velocity vectors. The initially perturbed interface evolves into the characteristic Rayleigh-Taylor instability as the denser lower material sinks beneath the lighter upper layer.
Figure 10. Comparison between the numerical and analytical solutions for the horizontal velocity, vertical velocity, and pressure fields. The third column shows the corresponding relative error distributions. The largest errors are localized at the viscosity interface, where the material properties are discontinuous, while excellent agreement is obtained throughout the remainder of the domain.
Figure 11. Isoviscous, bottom-heated thermal convection for
The initial condition is a sinusoidally perturbed conductive temperature field.
The background color shows the non-dimensional temperature, overlaid by temperature isolines (every 0.05) and centroid velocity vectors. Heat diffusion is solved using the defect correction with a Crank–Nicolson discretization, the Stokes equation using the defect correction method, and temperature advection with the semi-Lagrangian method.
Figure 12. Summary of the resolution study for a basal Rayleigh number of
Figure 13. Evolution of the two-dimensional Blankenbach benchmark with temperature-dependent viscosity for a resolution of
Figure 14. Bottom-Heated, Isoviscous Convection for
Solvers: defect correction(momentum), semi-Lagrangian (advection), defect correction + Crank-Nicolson discretization (heat diffusion).
Boundary conditions: Dirichlet (top/bottom), Neumann (sides), free-slip (velocity, all sides).
Figure 15. Internally Heated Convection for
Same setup as above, but with Neumann boundary at the bottom (zero heat flux) and constant internal volumetric heat production
Figure 16. Mixed-Heated Convection for a basal and internal-heating Rayleigh number of
Combination of the above two setups (bottom heating + internal heating).
Figure 17. Bottom-Heated, variable viscosity convection for
Figure 18. Evolution of thermo-mechanical shear localization in the pure-shear benchmark using shear heating. The model employs the general defect-correction energy solver with a Crank–Nicolson discretization (
Figure 19. Evolution and quantitative characterization of thermo-mechanical shear localization for the fixed-profile diagnostic with arithmetic phase and vertex viscosity averaging. Panels (a)–(c) show the second invariant of the strain-rate field at approximately 5%, 15%, and 25% bulk shortening, including the weak inclusion and the profile used to evaluate localization. Panels (d)–(f) show the the strain-rate amplification, temperature increase, shear-band orientation, and shear-band thickness as functions of bulk shortening. Line color distinguishes the upwind, semi-Lagrangian, and tracer advection methods, while line style distinguishes backward Euler (θ = 0), Crank–Nicolson (θ = 0.5), and forward Euler (θ = 1) within the general defect-correction formulation.




















