Skip to content

3D Subduction example ​

This is a 3D subduction example for LaMEM.jl that illustrates how to use the julia interface. This is very similar to the setup described by Schellart and coworkers in a 2007 nature paper in which they demonstrate that toroidal flow changes the slab curvature during subduction as a function of slab width.

1. Generate main model setup ​

We first load the packages:

julia
using LaMEM, GeophysicalModelGenerator

Next, we generate the main model setup, specifying the resolution and grid dimensions. Note that a range of default values will be set, depending on the parameters you specify.

julia
model = Model(
                # Define the grid
                Grid(nel=(128,32,64), x=[-3960, 500], y=[0,2640], z=[-660 ,0]),

                # No slip lower boundary; the rest is free slip
                BoundaryConditions(noslip = [0, 0, 0, 0, 1, 0]),

                # We use a multigrid solver with 4 levels:
                Solver(stokes_solver="coupled_mg", num_mg_levels=4,
                        coarse_solver="direct", direct_solver_type="mumps",
                        set_linear_problem=1, monitor_solvers=1,
                        linear_tolerances=[1e-3, 1e-4, 200]),

                # Output filename
                Output(out_file_name="Subduction_3D", out_dir="Subduction_3D"),

                # Timestepping etc
                Time(nstep_max=200, nstep_out=5, time_end=100, dt_min=1e-5),

                # Scaling:
                Scaling(GEO_units(length=1km, stress=1e9Pa) )
            )

2. Define geometry ​

Next, we specify the geometry of the model, using the AddBox! function from GeophysicalModelGenerator. We start with the horizontal part of the slab. The function AddBox! allows you to specify a layered lithosphere; here we have a crust and mantle. It also allows specifying a thermal structure. Since the current setup is only mechanical, we don't specify that here.

julia
add_box!(model, xlim=(-3000,-1000), ylim=(0,1000), zlim=(-80,0), phase=LithosphericPhases(Layers=[20,60], Phases=[1,2]))

The inclined part of the slab is generate by giving it a dip:

julia
add_box!(model, xlim=(-1000,-810), ylim=(0,1000), zlim=(-80,0), phase=LithosphericPhases(Layers=[20,60], Phases=[1,2]), DipAngle=16)

There is a simple way to have a quick look at this setup, with the interactive viewer:

julia
using GLMakie
view_model(model, field=:phase, y=100)

The cross-section at y = 100 is on the left and a 3D view of the slab on the right, with a blue plane marking where the section is cut. Nothing has been run yet – the viewer reads the setup straight from model. See Interactive viewer for what else the window can do.

3. Add material properties: ​

We can specify material properties by using the Phase function

julia
mantle = Phase(Name="mantle",ID=0,eta=1e21,rho=3200)
crust  = Phase(Name="crust", ID=1,eta=1e21,rho=3280)
slab   = Phase(Name="slab",  ID=2,eta=2e23,rho=3280)

and we can add them to the model with:

julia
add_phase!(model, mantle, slab, crust)

You can check that this is set with:

julia
model
julia
LaMEM Model setup
|
|-- Scaling             :  GeoParams.Units.GeoUnits{GEO}
|-- Grid                :  nel=(128, 32, 64); xϵ(-3960.0, 500.0), yϵ(0.0, 2640.0), zϵ(-660.0, 0.0)
|-- Time                :  nstep_max=200; nstep_out=5; time_end=100.0; dt=0.05
|-- Boundary conditions :  noslip=[0, 0, 0, 0, 1, 0]
|-- Solution parameters :  eta_min=1.0e18; eta_max=1.0e25; eta_ref=1.0e20; act_temp_diff=0
|-- Solver options      :  multigrid solver; coarse grid solver=mumps; 4 levels
|-- Model setup options :  Type=files;
|-- Output options      :  filename=Subduction_3D; pvd=1; avd=0; surf=0
|-- Materials           :  3 phases;

4. Run the model ​

Add this stage, we are ready to run the simulation. On my machine it takes around 4 seconds per timestep on 8 cores:

julia
try testing == true

if we run this as part of the test suite, use fewer timesteps

julia
    run_lamem(model, 8, "-nstep_max 2 -nstep_out 1")
catch
    run_lamem(model, 8)       # run on 8 cores (if possible)
end

The results looks like this with paraview: Note that this is a significantly higher resolution than the original paper, which was run on an HPC system (admittedly, this was 20 years ago).

The file Subduction_3D.jl in /scripts reproduces this example

Markdown page generation ​

julia
#This file was generated using Literate:
#Literate.markdown("Subduction3D.jl","../docs/src/",keepcomments=true, execute=false, codefence = "```julia" => "```")

This page was generated using Literate.jl.