Skip to content

Add GWB to Underworld3 subduction workflow example - #987

Open
ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:feature/gwb-uw3-subduction
Open

ss2098 wants to merge 1 commit into
underworldcode:developmentfrom
ss2098:feature/gwb-uw3-subduction

Conversation

@ss2098

@ss2098 ss2098 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a reproducible example for initializing a two-dimensional Underworld3 Stokes model using Geodynamic World Builder.

The example starts from the GWB v1.1.0 simple subduction cookbook, transfers temperature and four geological material classes into Underworld3, and compares coupled and prescribed weak-interface Stokes models.

GWB is an optional external dependency. No changes to the Underworld3 numerical solver implementation are required.

Motivation

I developed this workflow to test whether GWB geological initial conditions could be transferred consistently into Underworld3 while retaining the original temperature and compositional fields.

The example also demonstrates how a separate weak slab-top region can be represented through a particle mask without changing the geological material classification.

Implementation

The contribution includes:

  1. A derived four-material GWB input.
  2. Functions for constructing the slab geometry and querying GWB.
  3. Explicit validation of the GWB v1.1.0 composition output format.
  4. Temperature and material transfer to UW3 mesh and swarm fields.
  5. Two instantaneous Stokes calculations using rotated free-slip and custom FMG.
  6. A prescribed weak slab-top viscosity region.
  7. Numerical diagnostics and reproducible scientific figures.
  8. Offline regression tests and an independent post-run verification script.
  9. Documentation covering configuration, methods, assumptions, and limitations.

The example is designed for single-rank execution and uses the standalone GWB executable.

Numerical verification

The validated configuration contains 13,041 temperature DOFs and 115,200 particles.

All four geological materials are represented. Temperature preservation and material-mask mismatch checks pass.

The coupled model produces a maximum velocity of approximately 21.7031 cm/year.

The prescribed weak-interface model produces a maximum velocity of approximately 24.6207 cm/year.

The weak-band strain-rate proxy increases by approximately 7.56 times.

Both Stokes systems converge using the custom FMG velocity preconditioner, with the expected boundary constraints.

The independent post-run audit also checks saved numerical arrays against the archived reference values.

Tests

The following checks passed locally on macOS arm64 using the Pixi environment:

  1. Python compilation.
  2. All 17 offline GWB regression tests.
  3. Complete GWB v1.1.0 field transfer.
  4. Both UW3 Stokes solves.
  5. Temperature and composition preservation.
  6. Numerical reference comparison.
  7. Saved velocity and particle-array checks.
  8. Generated figure-file validation.

The complete Underworld3 serial and MPI test suites have not been rerun for this contribution.

Scientific scope

This is a controlled fixed-geometry numerical demonstration.

The weak region represents a prescribed finite-width viscosity reduction, not a dynamically evolving fault or fault-contact formulation.

The calculation is not presented as a transient subduction simulation, a mesh-converged solution, or a calibrated plate-tectonic model.

The reported strain-rate diagnostic is a nodal kinematic proxy.

Related packaging fix

PR #986 addresses Python package discovery in source-layout wheel builds.

This example remains an independent contribution, but fresh-install test environments may require that packaging fix until it is included in development.

I am opening this as a draft for feedback on the example's placement, scope, and documentation.

@ss2098
ss2098 marked this pull request as ready for review November 12, 2026 20:43
@ss2098
ss2098 requested a review from lmoresi as a code owner November 12, 2026 20:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant