Melting Parameterizations
Methods
A number of melting parameterisations are implemented, which can be set with:
GeoParams.MeltingParam.MeltingParam_Caricchi Type
MeltingParam_Caricchi()Implements the T-dependent melting parameterisation used by Caricchi, Simpson et al. (as for example described in Simpson)
Note that T is in Kelvin. As default parameters we employ:
Which gives a reasonable fit to experimental data of granodioritic composition (Piwinskii and Wyllie, 1968):

References
- Simpson G. (2017) Practical finite element modelling in Earth Sciences Using MATLAB.
GeoParams.MeltingParam.MeltingParam_Smooth3rdOrder Type
MeltingParam_Smooth3rdOrder()Implements the a smooth 3rd order T-dependent melting parameterisation (as used by Melnik and coworkers)
Note that T is in Kelvin.
As default parameters we employ:
which gives a reasonable fit to experimental data for basalt.
Data for rhyolite are:
Red: Rhyolite, Blue: Basalt
References
sourceGeoParams.MeltingParam.MeltingParam_5thOrder Type
MeltingParam_5thOrder(a,b,c,d,e,f,T_s,T_l)Uses a 5th order polynomial to describe the melt fraction phi between solidus temperature T_s and liquidus temperature T_l
Temperature T is in Kelvin.

The default values are for a composite liquid-line-of-descent:
the upper part is for Andesite from: (Blatter, D. L. & Carmichael, I. S. (2001) Hydrous phase equilibria of a Mexican highsilica andesite: a candidate for a mantle origin? Geochim. Cosmochim. Acta 65, 4043–4065
the lower part is extrapolated to the granitic minimum using the Marxer & Ulmer LLD for Andesite (Marxer, F. & Ulmer, P. (2019) Crystallisation and zircon saturation of calc-alkaline tonalite from the Adamello Batholith at upper crustal conditions: an experimental study. Contributions Mineral. Petrol. 174, 84)
GeoParams.MeltingParam.MeltingParam_4thOrder Type
MeltingParam_4thOrder(b,c,d,e,f,T_s,T_l)Uses a 4th order polynomial to describe the melt fraction phi between solidus temperature T_s and liquidus temperature T_l
Temperature T is in Kelvin.

The default values are for Tonalite experiments from Marxer and Ulmer (2019):
- Marxer, F. & Ulmer, P. (2019) Crystallisation and zircon saturation of calc-alkaline tonalite from the Adamello Batholith at upper crustal conditions: an experimental study. Contributions Mineral. Petrol. 174, 84
GeoParams.MeltingParam.MeltingParam_Quadratic Type
MeltingParam_Quadratic(T_s,T_l)Quadratic melt fraction parameterisation where melt fraction
Temperature T is in Kelvin.

This was used, among others, in Tierney et al. (2016) Geology
sourceGeoParams.MeltingParam.MeltingParam_Assimilation Type
MeltingParam_Assimilation(T_s,T_l,a)Melt fraction parameterisation that takes the assimilation of crustal host rocks into account, as used by Tierney et al. (2016) based upon a parameterisation of Spera and Bohrson (2001)
Here, the fraction of molten and assimilated host rocks
Temperature T is in Kelvin.

This was used, among others, in Tierney et al. (2016), who employed as default parameters:
References
Spera, F.J., and Bohrson, W.A., 2001, Energy-Constrained Open-System Magmatic Processes I: General Model and Energy-Constrained Assimilation and Fractional Crystallization (EC- AFC) Formulation: Journal of Petrology, v. 42, p. 999–1018.
Tierney, C.R., Schmitt, A.K., Lovera, O.M., de Silva, S.L., 2016. Voluminous plutonism during volcanic quiescence revealed by thermochemical modeling of zircon. Geology 44, 683–686. https://doi.org/10.1130/G37968.1
GeoParams.MeltingParam.MeltingParam_Volatile Type
MeltingParam_Volatile(; a_coeffs, b_coeffs, c_coeffs, T0=273K, Tref=1K, Pref=1e6Pa)Volatile-dependent silicic crystallinity-temperature curve fitted by Scholz et al. (2023) to rhyolite-MELTS runs, for use in Degruyter & Huber (2014)-type magma-chamber box models. The crystal fraction follows a complementary error function whose amplitude a, width b, and centre c depend on the dissolved water and CO2 contents and pressure:
with
The fit is calibrated only over crystal fractions from 0 up to ~0.5-0.6 (the "eruptible" range these box models track); 2a is the crystal fraction at the cold end of the fit and is bounded to [0.5, 1] by construction, so ϕ has a positive floor 1 - 2a rather than reaching 0 — this is intentional, not a missing clamp.
The dimensionless polynomial coefficients are stored as plain NTuples; only the reference scales T0, Tref, Pref are GeoUnits, so the parameterisation nondimensionalizes. Dissolved contents mH2O, mCO2 are dimensionless and pass through args.

References
Scholz, K., Townsend, M., Huber, C., Troch, J., Bachmann, O., Coonin, A.N. (2023), Investigating the impact of an exsolved H2O-CO2 phase on magma chamber growth and longevity: A thermomechanical model, G-cubed 24, e2023GC011151, https://doi.org/10.1029/2023GC011151 (Eq. 9-12, silicic crystallinity-temperature curve)
Degruyter, W., Huber, C. (2014), A model for the eruption frequency of upper crustal silicic magma chambers, EPSL 403, 117-130, https://doi.org/10.1016/j.epsl.2014.06.047
GeoParams.MeltingParam.MeltingParam_MaficVolatile Type
MeltingParam_MaficVolatile(; a_coeffs, b_coeffs, T0=273K, Tref=1K, Pref=1e6Pa)Volatile-dependent mafic crystallinity-temperature curve fitted by Scholz et al. (2023) to rhyolite-MELTS runs, for use in Degruyter & Huber (2014)-type magma-chamber box models: linear in temperature, ε_x = a*T_C + b, with slope a and intercept b each a degree-2 polynomial in (100*mH2O, 100*mCO2, P/Pref) — the same polynomial form as MeltingParam_Volatile's a/b/c, just combined linearly instead of through erfc. ϕ = 1 - ε_x (ε_g is added by the solver, not here).
A linear model has no saturation, so ε_x leaves [0,1] outside a narrow temperature window (~100-200 K wide; at 200 MPa: 1337-1443 K dry, 1221-1436 K at 1 wt% H2O, 1010-1417 K at 2 wt%). compute_meltfraction clamps ε_x to [0,1] there instead of returning it as computed:
colder than the window, the fit predicts
, clamped to ( , fully solid); hotter than the window, it predicts
, clamped to ( , fully liquid).
Both clamps are the physically sensible reading, but the value is still an extrapolation past the fit's calibration, not a measurement — no warning is raised when this triggers.
References
Scholz, K., Townsend, M., Huber, C., Troch, J., Bachmann, O., Coonin, A.N. (2023), Investigating the impact of an exsolved H2O-CO2 phase on magma chamber growth and longevity: A thermomechanical model, G-cubed 24, e2023GC011151, https://doi.org/10.1029/2023GC011151 (Eq. 14-16, mafic crystallinity-temperature curve)
Degruyter, W., Huber, C. (2014), A model for the eruption frequency of upper crustal silicic magma chambers, EPSL 403, 117-130, https://doi.org/10.1016/j.epsl.2014.06.047
GeoParams.MeltingParam.SmoothMelting Type
SmoothMelting(; p=MeltingParam_4thOrder(), k_sol=0.2/K, k_liq=0.2/K)This smoothens the melting parameterisation
and liquidus:
The resulting melt fraction
The width of the smoothening zones is controlled by
This is important, as jumps in the derivative
Example
Smoothening a 4th order parameterisation, with a sharper liquidus than solidus:
julia> p_s = SmoothMelting(p = MeltingParam_4thOrder(), k_liq = 0.21/K)
4th order polynomial melting curve: phi = -7.594512597174117e-10T^4 + 3.469192091489447e-6T^3 + -0.00592352980926T^2 + 4.482855645604745T + -1268.730161921053 963.15 K ≤ T ≤ 1270.15 K with smooth Heaviside function smoothening using k_sol=0.2 K⁻¹·⁰, k_liq=0.21 K⁻¹·⁰With a Makie backend loaded, PlotMeltFraction returns the curve and its derivative for both the original and the smoothened parameterisation:
using GLMakie, GeoParams
p = MeltingParam_4thOrder()
T = collect(650.0:1:1050.0) .+ 273.15
T, phi, dϕdT = PlotMeltFraction(p, T = T)
T_s, phi_s, dϕdT_s = PlotMeltFraction(p_s, T = T)The derivative no longer has a jump now:

Computational routines
To compute the melt fraction at given T and P, use:
GeoParams.MeltingParam.compute_meltfraction! Function
compute_meltfraction!(ϕ::AbstractArray{<:AbstractFloat}, P::AbstractArray{<:AbstractFloat},T:AbstractArray{<:AbstractFloat}, p::AbstractPhaseDiagramsStruct)In-place computation of melt fraction in case we use a phase diagram lookup table. The table should have the column :meltFrac specified.
compute_meltfraction(ϕ::AbstractArray{<:AbstractFloat}, Phases::AbstractArray{<:Integer}, P::AbstractArray{<:AbstractFloat},T::AbstractArray{<:AbstractFloat}, MatParam::AbstractArray{<:AbstractMaterialParamsStruct})In-place computation of melt fraction ϕ for the whole domain and all phases, in case an array with phase properties MatParam is provided, along with P and T arrays.
GeoParams.MeltingParam.compute_meltfraction Function
compute_meltfraction(P,T, p::AbstractPhaseDiagramsStruct)Computes melt fraction in case we use a phase diagram lookup table. The table should have the column :meltFrac specified.
ϕ = compute_meltfraction(Phases::AbstractArray{<:Integer}, P::AbstractArray{<:AbstractFloat},T::AbstractArray{<:AbstractFloat}, MatParam::AbstractArray{<:AbstractMaterialParamsStruct})Computation of melt fraction ϕ for the whole domain and all phases, in case an array with phase properties MatParam is provided, along with P and T arrays.
You can also obtain the derivative of melt fraction versus temperature with (useful to compute latent heat effects):
GeoParams.MeltingParam.compute_dϕdT! Function
compute_dϕdT!(ϕ::AbstractArray{<:AbstractFloat}, Phases::AbstractArray{<:Integer}, P::AbstractArray{<:AbstractFloat},T::AbstractArray{<:AbstractFloat}, MatParam::AbstractArray{<:AbstractMaterialParamsStruct})Computes the derivative of melt fraction ϕ versus temperature T, \frac{\partial \phi}{\partial T} for the whole domain and all phases, in case an array with phase properties MatParam is provided, along with P and T arrays. This is employed, for example, in computing latent heat terms in an implicit manner.
GeoParams.MeltingParam.compute_dϕdT Function
compute_dϕdT(P,T, p::AbstractPhaseDiagramsStruct)Computes derivative of melt fraction vs T in case we use a phase diagram lookup table. The table should have the column :meltFrac specified. The derivative is computed by finite differencing.
ϕ = compute_dϕdT(Phases::AbstractArray{<:Integer}, P::AbstractArray{<:AbstractFloat},T::AbstractArray{<:AbstractFloat}, MatParam::AbstractArray{<:AbstractMaterialParamsStruct})Computates the derivative of melt fraction ϕ versus temperature T for the whole domain and all phases, in case an array with phase properties MatParam is provided, along with P and T arrays. This is employed in computing latent heat terms in an implicit manner, for example
Also note that phase diagrams can be imported using PerpleX_LaMEM_Diagram, which may also have melt content information. The computational routines work with that as well.
Plotting routines
You can use the routine PlotMeltFraction to create a plot, provided that a Makie backend has been loaded.