Melting
Partial melting is computed per marker by apply_melting! (src/materials/Melting.jl), called from apply_marker_phase_and_melt! (src/time_stepping/Driver.jl) in the same pass as phase changes. Enable it with do_melting in the [physics] section (default false) and declare one [[melt]] block per meltable rock type (find_melt_entry matches on rock_id).
Solidus, liquidus and melt fraction (Katz lite)
The parameterization follows Katz, Spiegelman & Langmuir (2003), simplified to a linear melt fraction between a quadratic-in-melt_fraction in src/materials/Melting.jl):
(The full Katz 2003 model uses a non-linear
Units. a_sol/a_liq are in K/Pa (e.g. 132.9e-9 ≈ 133 K/GPa from Katz 2003) and b_sol/b_liq in K/Pa². The marker pressure arrives in bar and is converted to Pa inside melt_fraction (P_Pa = P_bar * 1e5); a previous version skipped this conversion, flattening the solidus's depth dependence and spuriously melting the deep mantle — the comment in the source records the bug. As for phase changes,
Volatile solidus offset. melt_fraction accepts an optional T_sol_offset (positive K) that lowers the dry solidus, volatile_solidus_depression only when do_volatile = true; the volatile module is not included in this release, so the offset is 0.0 and the dry solidus applies.
Latent heat
apply_melting! returns the latent heat exchanged since the marker's last update,
positive when melt fraction grows (endothermic; melting absorbs heat) and negative on crystallisation. The driver converts it to a volumetric source for the next heat solve,
accumulated into the per-cell H_marker_latent vector and averaged over the markers in each cell — averaging (not summing) keeps the source independent of marker packing (the module header documents the over-counting bug this fixed). The vector enters the heat equation through build_heat_source (src/physics/HeatSources.jl); see Heat transport. The default latent heat is the global constant L_MELT = 4e5 J/kg (src/core/Constants.jl).
What happens to the melt
The marker melt fraction mk.F_melt (Float32, exported to the markers VTU as melt_fraction) can be routed two ways.
Threshold extraction (default)
When extract_threshold, apply_melting! switches the marker's rock type to rock_after_extract (a "depleted residue" type) and resets
While melt is retained (
Buoyancy —
compute_density(src/materials/Density.jl) mixes solid and melt densities and applies residue depletion:with
= density_melt(default 2800 kg/m³).Melt weakening —
compute_VEP_viscosity(src/materials/Rheology.jl) supports(Mei et al. 2002) via its melt_factorargument. Thenu_factorkey (default 25.0) is parsed intoMeltPropfor this purpose, but the marker projection currently calls the rheology withmelt_factor = 0.0(src/particles/Projection.jl), so retained-melt weakening is active only through the two-phase porosity closure below.
Two-phase porosity routing (do_two_phase = true)
With McKenzie two-phase flow enabled, a melt-fraction change sources the marker porosity instead of being deleted by extraction (apply_marker_phase_and_melt!):
with twophase_phi_max (default 0.5). The melt then stays in the pores and percolates via the three-field solve_twophase! in src/physics/TwoPhase.jl); freezing (melt_weakened_viscosity, key alpha_phi in [twophase], default 27).
Threshold extraction still fires in this mode — and because the porosity source uses extract_threshold = 1.0 if all melt should remain in the porosity field and be transported solely by the two-phase solve.
Configuration
[[melt]] keys parsed by src/io/TOMLLoader.jl (one block per meltable rock; the user file's [[melt]] array replaces the defaults):
| Key | Default | Units | Meaning |
|---|---|---|---|
rock_id | — (required) | – | rock type this law applies to |
T_sol0 | 1373.0 | K | solidus at |
a_sol | 0.0 | K/Pa | linear solidus slope |
b_sol | 0.0 | K/Pa² | quadratic solidus coefficient |
T_liq0 | 1973.0 | K | liquidus at |
a_liq | 0.0 | K/Pa | linear liquidus slope |
b_liq | 0.0 | K/Pa² | quadratic liquidus coefficient |
latent | 4e5 (L_MELT) | J/kg | latent heat of fusion |
extract_threshold | 0.05 | – | |
rock_after_extract | rock_id | – | residue rock type after extraction |
density_melt | 2800.0 | kg/m³ | melt density for the two-phase mixture |
nu_factor | 25.0 | – | reserved |
Example (from cases/subduction_thermomech.toml):
[physics]
do_melting = true
[[melt]]
rock_id = 5 # asthenospheric mantle
T_sol0 = 1085.0
a_sol = 132.9e-9 # ≈ 133 K/GPa (Katz et al. 2003)
T_liq0 = 1780.0
a_liq = 89.0e-9
latent = 4e5 # J/kg
extract_threshold = 0.3 # 30 % melt → extract
rock_after_extract = 5Related pages
Two-phase flow — porosity transport, Darcy percolation, compaction and the melt-segregation CFL limit.
Phase changes — the companion per-marker pass and the shared latent-heat accumulator.
Heat transport — heat-source assembly (
build_heat_source).Rheology — the effective viscosity that melt and porosity weaken.