Simulating multi-stage magma intrusion in ASPECT: How to dynamically update T & composition in specific spacetime domains?

Hi all
I’m working on a 2D melt transport model to simulate multi-stage magma intrusion events. A key requirement is instantaneous thermal/compositional changes in localized zones at predefined times (e.g., rapid magma injection at t=1 Myr and t=2 Myr within 10 km radius areas).
I’ve explored two approaches with limitations:
Approach 1: Time-dependent boundary conditions
subsection Boundary temperature model
set Model name = function
subsection Function
set Variable names = x,y,t
set Function constants = T_magma, T_background, t_start, t_end
set Function expression = if((t >= t_start && t <= t_end) && (sqrt((x-1e5)^2 + (y-5e4)^2) < 1e4, T_magma, T_background)
end
end
Problem:Heat diffusion physics makes temperature changes too gradual, while magmatic intrusions require near-instantaneous thermal pulses.
Approach 2: Modify MaterialModel::evaluate()
Attempted direct source code modification in MeltGlobal<dim>::evaluate() :
// Pseudocode concept
for (unsigned int i=0; i<in.n_evaluation_points(); ++i) {
if (intrusion_active(in.current_time) && within_intrusion_zone(in.position[i])) {
out.temperature[i] = ***; // NOT WORKING - no write access
out.composition[i][peridotite_idx] = … ; // Composition modification?
}
}
Problem:
in objects (MaterialModelInputs) are read-only (ASPECT: aspect::MaterialModel::MaterialModelInputs< dim > Class Template Reference)
out.temperature doesn’t exist in MaterialModelOutputs (ASPECT: aspect::MaterialModel::MaterialModelOutputs< dim > Class Template Reference)
Request:
What is the ASPECT-correct way to implement:

  1. Instantaneous temperature spikes (not gradual diffusion-controlled)
  2. Compositional source terms in spacetime-defined zones
  3. Multi-stage events (distinct intrusion episodes)?
    Thanks in advance!

Hi @3Faker3,

If I understand correctly, you would like to modify ASPECT’s internal solution (temperature, composition) at various points in time.

There are ways to to this, and the prescribed velocity cookbook shows how define to prescribe internal velocities for a subduction corner flow problem. This approach can be applied to temperature and composition fields, and be adapted to have temporal dependence.

However, some things to keep in mind:

  1. Modifying the internal solution can lead to significant solver instabilities, especially for a problem with highly nonlinear reactive melt transport.
  2. Accordingly, it will take a large amount of testing and debugging to get this to work properly (if at all).

As such, I recommend first considering whether you can achieve the same time-dependent behavior through changes to boundary conditions, which already have the ability to handle time-dependent functions.

Cheers,
John

Hi @3Faker3,

My suggestion for this type of problem: Use an existing heating plugin or write your own heating plugin. For example, the function heating model allows you to specify the heating rate in your model in dependence of time and space. Therefore, you can specify the area to be heated, and you can make sure the heating only occurs during specific time periods. It’s not instantaneous (i.e., the heating rate has to be finite), but you can make the heating rate very large, which I think should be sufficient for your application.

Best,
Juliane

Thank you very much for your reply.

Thank you very much for your reply.