GD
Geodynamics

Simulating the Deep Earth with MAGEMin: A Toolkit for Thermodynamic Modeling in Geodynamics

Simulating the Deep Earth with MAGEMin: A Toolkit for Thermodynamic Modeling in Geodynamics

Understanding how rocks melt, deform, and evolve within Earth’s interior is a central challenge in geoscience. These processes span a wide range of spatial and temporal scales and are governed by complex interactions between temperature, pressure, composition, and phase stability. Capturing this complexity in numerical models requires integrating mineral thermodynamics directly into geodynamic modeling frameworks. MAGEMin (Mineral Assemblage Gibbs Energy Minimization) is designed to meet this need. It’s an open-source software package that calculates phase equilibria in multi-component systems by minimizing the Gibbs free energy of the system. Developed in C for maximum speed (Riel et al., 2022) and interfaced in Julia for flexibility, MAGEMin is built to interface with geodynamic models, offering a high-performance solution for simulating deep Earth processes. As such, in today’s blog post, we delve into the world of MAGEMin to explore its outstanding potential for unraveling deep Earth dynamics.

 

Dr. Nicolas Riel is a Post-doctoral Researcher at the Geodynamics & Geophysics group at Johannes Gutenberg University Mainz. Currently working on computational thermodynamics and magma migration, his research interests range from large-scale geodynamic processes to magma dynamics. You can reach out to him at: nriel@uni-mainz.de; or visit his page (https://nicolasriel.github.io/)

The Need for Thermodynamic Modeling in Geodynamics

Geodynamic models have become increasingly sophisticated, but many still treat key rock properties, such as density, latent heat, melt fraction, or seismic velocity, as static or overly simplified. In reality, these properties depend on mineral assemblages, which are governed by thermodynamic equilibrium.

While traditional Gibbs minimizers can simulate these equilibria under specific pressure-temperature-composition (P–T–X) conditions, they are often too slow or difficult to integrate directly into dynamic simulations. The challenge lies in bridging static petrological modeling with time-evolving geodynamic processes, a gap MAGEMin is designed to fill.

 

 

 

 

What Is MAGEMin?

MAGEMin computes stable mineral assemblages by minimizing the Gibbs free energy of a system, given its pressure, temperature, and bulk composition. Although this method is well established in petrology (such as used in Perple_X, Theriak-Domino, MELTS and THERMOCALC), MAGEMin introduces several features that make it particularly effective for geodynamic modeling:

  • Efficiency: Fast and robust optimization algorithms outperform many traditional tools in both serial and parallel execution.
  • Scalability: Its architecture supports large-scale simulations across P–T–X grids.
  • Modularity: The Julia interface (MAGEMin_C.jl) enables scripting, customization, and integration with other Julia-based tools.
  • Open Source: Released under the GNU General Public License, MAGEMin encourages collaboration, adaptation, and transparency.

Whether modeling subduction zones, crustal melting during orogeny, or planetary interiors, MAGEMin provides a reliable, high-speed engine for simulating mineralogical changes.

Why MAGEMin Matters in Geodynamics?

Speed

MAGEMin’s optimization framework allows it to compute in parallel thousands, or even millions, of equilibrium points rapidly, making it well suited for time-dependent geodynamic simulations.

Flexibility

With MAGEMin_C.jl, users can define custom thermodynamic systems and select from a variety of datasets covering crustal, mantle, and igneous environments. Bulk compositions, pressure-temperature grids, and outputs like melt fraction, density, viscosity, and seismic velocity can all be customized and extracted efficiently.

Coupling with Geodynamic Models

MAGEMin is built for integration with multiphase thermo-mechanical codes, enabling real-time feedback between thermodynamics and geodynamic processes. This allows simulations to account for:

  • Fluid release and transport in subduction zones
  • Deformation-driven metamorphism
  • Partial melting and magmatic differentiation

These dynamic feedback are critical for accurately modeling lithospheric and mantle evolution, where mineral transformations directly affect buoyancy, rheology, and heat transfer.

Figure 1. Example of Julia script to perform a single point stable phase equilibrium with MAGEMin_C.jl

MAGEMinApp: A GUI for Visual Exploration

For users who prefer a graphical interface, MAGEMinApp provides a web-based platform to interact with MAGEMin without coding. It supports a wide range of phase diagram types and advanced visualizations:

  • P–T iso-chemical phase diagrams
  • P–X, T–X, PT–X, and polymetamorphic diagrams
  • Trace element partitioning at suprasolidus conditions (including Zr saturation)
  • P–T–X paths simulating melting, crystallization, and compositional evolution
  • Isentropic and adiabatic paths
  • Contour plots of melt fraction, phase proportions, density, seismic velocity, and more

MAGEMinApp also features automatic labeling of stable mineral assemblages, even in small or complex fields, making diagrams easier to interpret. Results can be exported as SVG vector graphics or CSV files for publication or further analysis.

Getting Started

Figure 2. Example of P-T iso-chemical diagram obtained using MAGEMinApp and the metabasite activity-composition models of Green et al. (2016).

Extensive documentation, tutorials, and examples are available on the official MAGEMin site. The package supports workflows ranging from petrological projects to full-scale geodynamic simulations:

  • Constructing phase diagrams for educational or research purposes
  • Generating lookup tables for large-scale simulations
  • Modeling melt generation and evolution pathways
  • Tracking trace element partitioning during metamorphism or melting

MAGEMin runs efficiently on both standard workstations and high-performance computing clusters. Its emphasis on accessibility, reproducibility, and integration makes it a practical tool for researchers across disciplines.

Looking Ahead

As Earth system modeling becomes more integrated, the need for tools that unify thermodynamics and geodynamics continues to grow. MAGEMin makes it possible to embed accurate, real-time mineralogical calculations into models of tectonic, magmatic, and metamorphic evolution, bridging the gap between petrology and large-scale Earth modeling.

By moving beyond static rock properties and enabling dynamic feedback, MAGEMin helps researchers build more realistic, physically grounded models of how Earth’s interior behaves and evolves.

In a Nutshell

MAGEMin is part of a new generation of thermodynamic modeling tools, fast, flexible, and designed for geodynamic applications. With its high-performance solver, open-source framework, and easy integration, it’s becoming an essential tool for exploring deep Earth processes and advancing geoscientific modeling.

 

Asimow, P. D., Ghiorso, M. S. (1998). Algorithmic modifications extending MELTS to calculate subsolidus phase relations. American Mineralogist, 83 (9-10): 1127–1132. https://doi.org/10.2138/am-1998-9-1022

Capitani, C. & Petrakakis, K. (2010). The computation of equilibrium assemblage diagrams with Theriak/Domino software. American Mineralogist, 95(7), 1006-1016. https://doi.org/10.2138/am.2010.3354 

Connolly, J. A. D. (2005). Computation of phase equilibria by linear programming: A tool for geodynamic modeling and its application to subduction zone decarbonation. Earth and Planetary Science Letters, 236(1), 524–541. https://doi.org/https://doi.org/10.1016/j.epsl.2005.04.033

Green, E. C. R., White, R. W., Diener, J. F. A., Powell, R., Holland, T. J. B., & Palin, R. M. (2016). Activity-composition relations for the calculation of partial melting equilibria in metabasic rocks. Journal of Metamorphic Geology34(9), 845-869. https://doi.org/10.1111/jmg.12211

Powell, R., & Holland, T. (1993). On the formulation of simple mixing models for complex phases. American Mineralogist78, 1174–1180.

Riel, N.Kaus, B. J. P.Green, E. C. R., & Berlie, N. (2022). MAGEMin, an efficient Gibbs energy minimizer: Application to igneous systemsGeochemistry, Geophysics, Geosystems23, e2022GC010427. https://doi.org/10.1029/2022GC010427
Dr. Nicolas Riel is a Post-doctoral Researcher at the Geodynamics & Geophysics group at Johannes Gutenberg University Mainz. Currently working on computational thermodynamics and magma migration, his research interests range from large-scale geodynamic processes to magma dynamics. You can reach out to him at: nriel@uni-mainz.de; or visit his page (https://nicolasriel.github.io/)


Nuno Rodrigues is a PhD student in the Department of Geology at the University of Lisbon and is associated with the Solid Earth Dynamics research group at Instituto Dom Luiz. His work focuses on numerical modelling of collisional systems, but all research fields within geodynamics are of interest to him.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*