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:
- Instantaneous temperature spikes (not gradual diffusion-controlled)
- Compositional source terms in spacetime-defined zones
- Multi-stage events (distinct intrusion episodes)?
Thanks in advance!