pyMelt Code Documentation

Modules

pyMelt

A python package for performing mantle melting calculations.

Developed and maintained by Simon Matthews (simonm@hi.is), Kevin Wong, and Matthew Gleeson.

This module facilitates calculations for melting of heterogeneous mantle, based on empirical parameterisations of the melting functions. The calculations assume complete thermal equilibrium and complete chemical disequilibrium between adjacent mantle lithologies. Various tools are provided for performing decompression melting calculations.

class pyMelt.hydrousLithology(lithology, H2O, D=0.01, K=43.0, gamma=0.75, chi1=12.0, chi2=1.0, l=0.6, continuous=False, phi=0.005, threshold_F=None)[source]

The hydrous lithology class modifies the melting expressions in a given lithology class so that water-present melting can be modelled.

Parameters
  • lithology (pyMelt.lithology_classes.lithology instance) – The anhydrous lithology for which hydrous melting should be modelled.

  • H2O (float) – The water content of the lithology in wt%.

  • D (float, default: 0.01) – Partition coefficient for water partitioning between melt and the (bulk) residue.

  • K (float, default: 43.0) – Parameter controlling hydrous solidus position, from Katz et al. (2003). See notes.

  • gamma (float, default: 0.75) – Parameter controlling the hydrous solidus position, from Katz et al. (2003). Must take a value between 0 and 1. See notes.

  • chi1 (float, default: 12.0) – Parameter controlling the H2O content of melt at H2O-satuation, in wt% GPa^(-l).

  • chi2 (float, default: 1.0) – Parameter controlling the H2O content of melt at H2O-satuation, in wt% GPa^(-1).

  • l (float, default: 0.6) – Parameter controlling the H2O content of melt at H2O-satuation.

  • continuous (bool, default: False) – Controls whether water extracted to melt is kept or removed from the system. If False, melting will be done assuming batch closed-system melting. If True, the water contents are modelled according to continuous melting, i.e., near-fractional melting, with the porosity controlled by the phi argument.

  • phi (float, default: 0.005) – The porosity to use during continuous melting, if applicable. The default value is 0.5%.

  • threshold_F (float or None, default: None) – If set, when the melt fraction goes above the chosen threshold, the hydrous extension will be skipped. Doing so may help speed up the calculations, but a threshold melt fraction should be chosen with care.

Notes

The parameters controlling the position of the hydrous solidus are defined by eqn. 16 from Katz et al. (2003):

\Delta T(X_{H2O}) = K X^\gamma_{H2O}

Where X_{H2O} is the water content in the melt.

The water content at saturation is controlled by eqn. 17 of Katz et al. (2003):

X^{sat}_{H2O} = \chi_1 P^\lambda + \chi_2 P

F(P, T, **kwargs)[source]

Returns the melt fraction of the hydrated lithology, by iteratively finding the value of F which provides the amount of water to the melt such that the same value of F is returned by the calculation. This is equivalent to Eqn 19 of Katz et al. (2003), but its form will depend on the lithology being used.

The numerical problem is solved using the SciPy method root_scalar from the optimize module. The method used is brentq, so that the problem may be constrained between a melt fraction of 0 and 1.

Parameters
  • P (float) – Pressure in GPa

  • T (float) – Temperature in degC.

Returns

The melt fraction.

Return type

float

H2O_saturation(P)[source]

The H2O content of the melt at H2O saturation. This is Eqn 17 of Katz et al. (2003).

Parameters

P (float) – Pressure in GPa

Returns

The H2O content of the melt at H2O-saturation, in wt%.

Return type

float

TLiquidus(P, **kwargs)[source]

Returns the temperature of the liquidus at any given pressure. :Parameters: P (float) – Pressure (GPa).

Returns

Liquidus temperature (degC).

Return type

float

TSolidus(P, F=0.0)[source]

Returns the temperature of the solidus at any given pressure. Since the solidus is a function of the water content of the bulk, the effective solidus position will shift during melting.

Parameters
  • P (float) – Pressure (GPa).

  • F (float, default: 0.0) – Melt fraction, between 0 and 1.

Returns

Solidus temperature (degC).

Return type

float

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P) for the hydrated lithology numerically.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

dT/dF(const. P) (K).

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F) for the hydrated lithology numerically.

The method uses the root_scalar method of the scipy.optimize module to find the curve of T-P for which F=const. The scipy derivative method is then used to numerically differentiate this curve.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dP(const. F) (K GPa-1).

Return type

float

melt_H2O(F, P=None)[source]

Returns the H2O content of the melt at a particular melt fraction, assuming either batch or continuous melting, and H2O saturation controlled by the H2O_saturation method. If H2O is saturated, it will remain in the bulk system.

Parameters
  • F (float) – The melt fraction. Must be between 0 and 1.

  • P (float or None, default: None) – The pressure in GPa. Used for checking for H2O saturation. If set to None this check will be bypassed.

Returns

The H2O content of the melt, in wt%.

Return type

float

class pyMelt.mantle(lithologies, proportions, names=None)[source]

The mantle class consists of one or more lithology classes, in a particular proportion. The mantle class contains the methods used for doing melting calculations and for calculating the properties of a heterogeneous mantle.

Parameters
  • lithologies (list of lithology objects) – A list of lithology instances.

  • proportions (list or numpy.array of floats) – The mass ratios of the lithologies, doesn’t need to be normalised.

  • names (list of strings or None, default: None) – The names of the lithologies. If False, default names will be chosen.

Variables
  • number_lithologies (int) – the number of lithologies in the mantle class

  • CP (list of floats) – the heat capacities of the lithologies

  • alphaf (list of floats) – the thermal expansion coefficients of the melts produced by each lithology.

  • alphas (list of floats) – the thermal expansion coefficients of each lithology

  • rhof (list of floats) – the densities of the melts produced by each lithology

  • rhos (list of floats) – the densities of each lithology

  • DeltaS (list of floats) – the entropy change on melting of each lithology.

F(P, T)[source]

Calculates the melt fraction of each lithology at a given pressure and temperature.

Parameters
  • P (float) – Pressure in GPa

  • T (float) – Temperature in degC

Returns

Array containing the melt fraction of each lithology.

Return type

numpy.Array

adiabat(P, Tp)[source]

Calculates the actual temperature of the solid mantle at a given pressure, given the potential temperature.

Parameters
  • P (float or numpy.array) – Pressure in GPa.

  • Tp (float or numpy.array) – Potential temperature in degC.

Returns

Temperature of the mantle at the given pressure and Tp.

Return type

float or numpy.array

adiabaticGradient(P, T)[source]

Calculates dTdP if melting has gone to completion (or hasn’t started) for the bulk mantle.

Parameters
  • P (float) – Pressure in GPa.

  • T (float) – Temperature in degC.

Returns

The adiabatic gradient in C/GPa

Return type

float

adiabaticMelt(Tp, Pstart=None, Pend=0.01, dP=- 0.004, steps=None, ReportSSS=True, adjust_pressure=True, prevent_freezing=True, warn_prevent_freezing=True)[source]

Performs simultaneous integration of dFdP and dTdP to obtain the thermal gradient through the melting region. F of each lithology is then calculated using the P,T path. Integration is performed using a 4th order Runge-Kutta algorithm.

The T-P path is allowed to overstep the solidus on the step prior to the start of melting.

Parameters
  • Tp (float) – The potential temperature (degC) at which to perform the calculation.

  • Pstart (float or None, default: None) – The pressure (in GPa) at which to begin upwelling. If None, the calculation will start at the solidus.

  • Pend (float, default: 0.0) – The pressure (in GPa) at which to stop upwelling.

  • dP (float, default: -0.004) – The step size in pressure (GPa) to use in the calculation. If the argument steps is set, dP will be ignored.

  • steps (None or int, default: None) – The number of dP increments to split the melting region into. If set to None, the number of steps is determined by dP.

  • ReportSSS (bool, default: True) – Print to the console if the start is above the solidus of one of the lithologies. Either way the code will calculate the melt fraction at this point by conserving entropy. Set to False if you don’t want to be warned.

  • adjust_pressure (bool, default: True) – If True, the pressure range will be adjusted slightly so that one point coincides with the solidus. This should avoid issues with discretisation.

  • prevent_freezing (bool, default: True) – In some melting regions heat extraction by one lithology can cause another’s melts to partially freeze (releasing some heat). If set to True this is prevented from happening. This is most useful when modelling fractional melt extraction.

  • warn_prevent_freezing (bool, default: True) – If set to True, when a melt is prevented from freezing, a warning will be raised.

Returns

The results are returned in a 1D Melting Column instance, further calculations, e.g. crustal thickness may then be performed on this instance, if desired.

Return type

pyMelt.meltingColumn

bulkProperties(P=None, T=None)[source]

Calculates the bulk thermodynamic properties of the solid or partially molten mantle.

Parameters
  • P (float or None, default: None) – The pressure of interest. If None, the properties of the solid mantle will be returned.

  • T (float or None, default: None) – The temperature of interest. If None, the properties of the solid mantle will be returned.

Returns

The bulk alpha, CP and rho for the mantle at the given P and T, labelled as such.

Return type

dict

dFdP(P, T, prevent_freezing=False, F_prev=None)[source]

Calculates the value of dFdP for each lithology at the given pressure and temperature, using Eq(26) of Phipps Morgan (2001).

Parameters
  • P (float) – Pressure in GPa.

  • T (float) – Temperature in degC.

  • prevent_freezing (bool, default: False) – If set to True, any dFdP values > 0 will be set to 0.

  • F_prev (numpy.Array or None, default:None) – If preventing freezing, this is the melt fraction on the previous step to use when checking for freezing.

Returns

Array of dFdP values for each lithology.

Return type

numpy.Array

dTdP(P, T, dFdP=None)[source]

Calculates dTdP using Eq(28) of Phipps Morgan (2001). Picks the lithology to use by the one with the largest increase in melt fraction with decompression (though this choice shouldn’t matter).

Parameters
  • P (float) – Pressure in GPa.

  • T (float) – Temperature in degC.

  • dFdP (numpy.Array or None, default: None) – The value of dFdP at the same T and P. If None, the dFdP method will be called. In most melting calculations the value will already have been calculated, so passing the value will save computational time.

Returns

The thermal gradient in the melting region at the P and T of interest.

Return type

float

isobaricMelt(Tstart, P, dT=0.1)[source]

Calculates the amount of melt generated, and the mantle’s temperature, after an interval of melting occuring due to mantle being instantaneously placed above its solidus.

The intention of this function was to handle high Tp cases where the solidus is always exceeded, not to produce physically meaningful results, but to allow the tails of Tp distributions to be approximated reasonably when inverting.

Parameters
  • Tstart (float) – The temperature (degC) at which to place the solid mantle.

  • P (float) – The pressure at which to perform the calculation.

  • dT (float) – The interval of discretisation of temperature increase from the solidus.

Returns

Temperature of mantle following the melting step.

Return type

float

solidusIntersection(Tp)[source]

Finds the pressure at which each lithology’s solidus will be intersected, assuming the mantle follows the solid adiabat up until that point.

Parameters

Tp (float) – The mantle potential temperature in degC.

Returns

The pressure of solidus intersection of each lithology.

Return type

numpy.array

solidusIntersectionIsobaric(P)[source]

Finds the pressure at which each lithology’s solidus will be intersected, assuming the mantle is heated isobarically.

Parameters

P (loat) – The pressure of interest in GPa

Returns

The temperature of solidus intersection of each lithology.

Return type

numpy.Array

Lithology classes

The lithology classes module provides the lithology class for implementing melting models, and the hydrous_lithology class for converting an anhydrous lithology to a hydrous lithology.

class pyMelt.lithology_classes.hydrousLithology(lithology, H2O, D=0.01, K=43.0, gamma=0.75, chi1=12.0, chi2=1.0, l=0.6, continuous=False, phi=0.005, threshold_F=None)[source]

The hydrous lithology class modifies the melting expressions in a given lithology class so that water-present melting can be modelled.

Parameters
  • lithology (pyMelt.lithology_classes.lithology instance) – The anhydrous lithology for which hydrous melting should be modelled.

  • H2O (float) – The water content of the lithology in wt%.

  • D (float, default: 0.01) – Partition coefficient for water partitioning between melt and the (bulk) residue.

  • K (float, default: 43.0) – Parameter controlling hydrous solidus position, from Katz et al. (2003). See notes.

  • gamma (float, default: 0.75) – Parameter controlling the hydrous solidus position, from Katz et al. (2003). Must take a value between 0 and 1. See notes.

  • chi1 (float, default: 12.0) – Parameter controlling the H2O content of melt at H2O-satuation, in wt% GPa^(-l).

  • chi2 (float, default: 1.0) – Parameter controlling the H2O content of melt at H2O-satuation, in wt% GPa^(-1).

  • l (float, default: 0.6) – Parameter controlling the H2O content of melt at H2O-satuation.

  • continuous (bool, default: False) – Controls whether water extracted to melt is kept or removed from the system. If False, melting will be done assuming batch closed-system melting. If True, the water contents are modelled according to continuous melting, i.e., near-fractional melting, with the porosity controlled by the phi argument.

  • phi (float, default: 0.005) – The porosity to use during continuous melting, if applicable. The default value is 0.5%.

  • threshold_F (float or None, default: None) – If set, when the melt fraction goes above the chosen threshold, the hydrous extension will be skipped. Doing so may help speed up the calculations, but a threshold melt fraction should be chosen with care.

Notes

The parameters controlling the position of the hydrous solidus are defined by eqn. 16 from Katz et al. (2003):

\Delta T(X_{H2O}) = K X^\gamma_{H2O}

Where X_{H2O} is the water content in the melt.

The water content at saturation is controlled by eqn. 17 of Katz et al. (2003):

X^{sat}_{H2O} = \chi_1 P^\lambda + \chi_2 P

F(P, T, **kwargs)[source]

Returns the melt fraction of the hydrated lithology, by iteratively finding the value of F which provides the amount of water to the melt such that the same value of F is returned by the calculation. This is equivalent to Eqn 19 of Katz et al. (2003), but its form will depend on the lithology being used.

The numerical problem is solved using the SciPy method root_scalar from the optimize module. The method used is brentq, so that the problem may be constrained between a melt fraction of 0 and 1.

Parameters
  • P (float) – Pressure in GPa

  • T (float) – Temperature in degC.

Returns

The melt fraction.

Return type

float

H2O_saturation(P)[source]

The H2O content of the melt at H2O saturation. This is Eqn 17 of Katz et al. (2003).

Parameters

P (float) – Pressure in GPa

Returns

The H2O content of the melt at H2O-saturation, in wt%.

Return type

float

TLiquidus(P, **kwargs)[source]

Returns the temperature of the liquidus at any given pressure. :Parameters: P (float) – Pressure (GPa).

Returns

Liquidus temperature (degC).

Return type

float

TSolidus(P, F=0.0)[source]

Returns the temperature of the solidus at any given pressure. Since the solidus is a function of the water content of the bulk, the effective solidus position will shift during melting.

Parameters
  • P (float) – Pressure (GPa).

  • F (float, default: 0.0) – Melt fraction, between 0 and 1.

Returns

Solidus temperature (degC).

Return type

float

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P) for the hydrated lithology numerically.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

dT/dF(const. P) (K).

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F) for the hydrated lithology numerically.

The method uses the root_scalar method of the scipy.optimize module to find the curve of T-P for which F=const. The scipy derivative method is then used to numerically differentiate this curve.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dP(const. F) (K GPa-1).

Return type

float

melt_H2O(F, P=None)[source]

Returns the H2O content of the melt at a particular melt fraction, assuming either batch or continuous melting, and H2O saturation controlled by the H2O_saturation method. If H2O is saturated, it will remain in the bulk system.

Parameters
  • F (float) – The melt fraction. Must be between 0 and 1.

  • P (float or None, default: None) – The pressure in GPa. Used for checking for H2O saturation. If set to None this check will be bypassed.

Returns

The H2O content of the melt, in wt%.

Return type

float

class pyMelt.lithology_classes.lithology(CP=1000.0, alphas=40.0, alphaf=68.0, rhos=3.3, rhof=2.9, DeltaS=300.0, parameters={})[source]

Lithology base class. This class contains all the parameters and methods required to calculate the melting behaviour of a single mantle component.

Parameters
  • CP (float) – Heat capacity (J Kg-1 K-1). Default is 1000.0.

  • alphas (float) – Thermal expansivity of the solid (K-1). Default is 40.0.

  • alphaf (float) – Thermal expansivity of the melt (K-1). Default is 68.0.

  • rhos (float) – Density of the solid (g cm-3). Default is 3.3.

  • rhof (float) – Density of the melt (g cm-3). Default is 2.9.

  • DeltaS (float) – Entropy of fusion. (J kg-1 K-1). Default is 300.0.

  • parameters (dict) – A dictionary of the parameters required by the lithology.

F(P, T)[source]

Returns the melt fraction at any given pressure and temperature.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

Melt fraction.

Return type

float

TLiquidus(P)[source]

Returns the temperature of the liquidus at any given pressure.

Parameters

P (float) – Pressure (GPa).

Returns

The default lithology never melts.

Return type

None

TSolidus(P)[source]

Returns the temperature of the solidus at any given pressure.

Parameters

P (float) – Pressure (GPa).

Returns

The default lithology never melts.

Return type

None

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P) numerically. For faster and more accurate results redefine this method.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

dT/dF(const. P) (K).

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F) numerically. For faster and more accurate results redefine this method.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dP(const. F) (K GPa-1).

Return type

float

Melting Columns

the meltingcolumn_classes module provides the melting column classes. At the moment it consists of a single melting column- a simple 1D melting column.

class pyMelt.meltingcolumn_classes.meltingColumn(calculation_results, mantle, Tp=None)[source]

Class for storing the results of a 1D multi-lithology melting model.

Parameters
  • calculation_results (pandas.DataFrame) – Dataframe with columns ‘P’ for Pressure in GPa, ‘T’ for Temperature in degrees C, Remaining columns for melt fraction from each lithology.

  • mantle (pyMelt.Mantle) – The mantle class used to generate the melting column.

  • Tp (float) – The potential temperature used to generate the melting column, if applicable.

Variables
  • calculation_results (pandas.DataFrame) – The stored raw calculation results.

  • mantle (pyMelt.Mantle) – The mantle class used to generate the melting column.

  • Tp (float) – The potential temperature used to generate the melting column, if applicable.

  • P (pandas.Series) – The pressure steps in GPa

  • T (pandas.Series) – The temperature steps in degC.

calculateChemistry(elements=None, species_objects=None, method='default', **kwargs)[source]

Calculate the composition of the melt according to default (or user defined) chemical models. The method may be run with default options if the mantle consists of only one lithology. Otherwise the parameters for each lithology must be specified, or pre-defined species objects must be provided.

If elements is not set and the mantle is made of one lithology, the composition will be set to the depleted mantle of Workman & Hart (2005). The INVMEL forward model is used by default, except for Ba and Rb which are modelled using continuous_instantaneous. The mineral-specific partition coefficients for INVMEL are the constant values compiled by Gibson & Geist (2010). The bulk partition coefficients for Ba and Rb are from Workman & Hart (2005).

Unless passing the species objects directly, the parameters used by the trace element model must be given also. If a constant value should be used for every lithology and every element (e.g., phi for continuous melting) it can be passed as a float. If a value varies for each element, but not each lithology, for example a mineral-specific D, a dict can be passed with each element name as a key. If the parameter varies for each element and lithology, it can be supplied as a nested-dictionary, much like the elements parameter. See Notes for a list of parameters for the default models.

Parameters
  • elements (dict of dicts of floats (optional)) – A dictionary with each lithology as a key, the values are themselves dictionaries with species names as keys, and their concentrations as the values. The elements must be among the default element list. Ignore if supplying the species objects directly in the species_objects argument.

  • species_objects (dict or None, default: None) – Each lithology name is a key of the dictionary, the values are a list of pyMelt.chemical_classes.species objects. If None, the species objects will be generated from the elements argument.

  • method (string or dict or dict of dicts, default: ‘default’) – One of ‘default’, ‘batch’, ‘continuous_accumulated’, ‘continuous_instantaneous’, ‘invmel’. If using different models for different elements, specify them as a dictionary. This can be nested within another dictionary if you wish to use different combinations for each lithology.

Notes

The ‘batch’ melting routine uses:
  • D, the bulk partition coefficient

The ‘continuous’ melting routine uses:
  • D, the bulk partition coefficient

  • phi, the porosity during melting (as a fraction, not percent).

The ‘invmel’ melting routine uses:
  • olv_D, the olivine-melt partition coefficient

  • cpx_D, the olivine-melt partition coefficient

  • opx_D, the olivine-melt partition coefficient

  • spn_D, the olivine-melt partition coefficient

  • grt_D, the olivine-melt partition coefficient

  • plg_D, the olivine-melt partition coefficient

  • MineralProportions, the mass fraction of each mineral present (prior to melting) in the spinel, plagioclase, and garnet field.

  • cpxExhaustion, the melt fraction at which cpx (and grt/plg/spn) are exhausted.

  • garnetInCoeffs, coefficients controlling the P and T of the garnet in reaction

  • spinelOutCoeffs, coefficients controlling the P and T of the spinel out reaction

  • plagioclaseInInterval, The plagioclase in interval (in km).

plot()[source]

Generates a plot showing the thermal gradient and melt fractions ofeach lithology.

Returns

The generated figure and axes objects.

Return type

(matplotlib.figure, matplotlib.axes)

Geological Settings

The geological settings module provides the classes required for extracting setting-specific information from the melting columns, e.g., the crustal thickness and average melt composition at a spreading centre.

class pyMelt.geosettings.geoSetting[source]

Base clase for geological settings.

Parameters
  • MeltingColumn (pyMelt.meltingcolumn_classes.MeltingColumn) – The melting column from which to construct the geological setting.

  • weightingFunction (function or None, default: None) – A function used to apply an additional weighting to melts during homogenisation, perhaps for simulating the behaviour of active upwelling. The result from the function will be added to the triangular weighting applied already. The function must take the melting region pressures (as a numpy array or pandas Series) as its first argument, any other arguments will be passed in kwargs.

Variables
  • MeltingColumn (pyMelt.meltingcolumn_classes.MeltingColumn) – The melting column from which the geological setting was constructed

  • lithologies (dict) – Dictionary containing the DataFrames of the states of each lithology during melting.

  • mantle (pyMelt.Mantle) – The mantle object from which the melting column was calculated.

crystallisationChemistry(mineralProportions, fractionate=True, D=         olv     cpx       opx    plg      grt     spn Rb  0.000300  0.0004  0.000200  0.030  0.00020  0.0001 Ba  0.000005  0.0004  0.000006  0.330  0.00007  0.0001 Th  0.000050  0.0059  0.002000  0.050  0.00900  0.0000 U   0.000380  0.0094  0.002000  0.110  0.02800  0.0000 Nb  0.000500  0.0150  0.004000  0.010  0.01500  0.0000 Ta  0.000500  0.0150  0.004000  0.000  0.01500  0.0000 La  0.000500  0.0490  0.003100  0.270  0.00100  0.0100 Ce  0.000500  0.0800  0.004000  0.200  0.00500  0.0100 Pb  0.003000  0.0120  0.009000  0.360  0.00500  0.0000 Pr  0.000800  0.1260  0.004800  0.170  0.01400  0.0100 Nd  0.000420  0.1780  0.012000  0.140  0.05200  0.0100 Sr  0.000040  0.0910  0.000700  2.000  0.00070  0.0000 Zr  0.003300  0.1190  0.013000  0.010  0.27000  0.0000 Hf  0.002200  0.2840  0.030000  0.010  0.40000  0.0000 Sm  0.001100  0.2930  0.020000  0.110  0.25000  0.0100 Eu  0.001600  0.3350  0.013000  0.730  0.49600  0.0100 Ti  0.015000  0.3500  0.086000  0.040  0.60000  0.1500 Gd  0.001100  0.3500  0.013000  0.066  0.84800  0.0100 Tb  0.001500  0.4030  0.019000  0.060  1.47700  0.0100 Dy  0.002700  0.4000  0.011000  0.055  2.20000  0.0100 Ho  0.001600  0.4270  0.006500  0.048  3.31500  0.0100 Y   0.009900  0.4260  0.052000  0.030  3.10000  0.0100 Er  0.013000  0.4200  0.045000  0.010  4.40000  0.0100 Yb  0.020000  0.4000  0.080000  0.031  6.60000  0.0100 Lu  0.020000  0.3760  0.120000  0.025  7.10000  0.0100)[source]

Calculates the concentrations of elements in the homogenised magma following an interval of crystallisation.

Parameters
  • fractionate (bool, default: True) – If True, the calculation will follow fractional crystallisation.

  • mineralProportions (dict) – The proportions of each mineral, relative to the system total (1.0). The minerals must have the same name as used in the D argument. If the default partition coefficients are used the mineral labels are olv, cpx, opx, plg, spn, grt.

  • D (pandas.DataFrame, default: pyMelt.chemistry.defaultD) – The partition coefficients for each element and mineral. Columns are minerals, rows are elements.

Returns

The concentrations of the trace elements in the evolved melt.

Return type

pandas.Series

plotSpider(normalisation='PM', plot_instantaneous=False, plot_original=True, crystal_fraction=None, element_order=None, **kwargs)[source]

Plot a basic spider diagram of the chemical composition, optionally alongside the instantaneous melts and/or an evolved melt.

Parameters
  • normalisation (dict or str, default: ‘PM’) – How to normalise the values. To use the built in default options pass a string: - ‘PM’ gives the Primitive Mantle of Palme and O’Neill (2013) - ‘CI’ gives the chondritic composition of Palme and O’Neill (2013) - ‘DM’ gives the depleted mantle composition of Workman and Hart (2005)

    Otherwise, pass a dict of elements (keys) and their concentrations.

  • plot_instantaneous (bool, default: False) – Plot the range of the instantaneous melts (or accumulated melts at each step) as a field.

  • plot_original (bool, default: True) – Plot the original homogenised chemistry.

  • crystal_fraction (None or dict, default: None) – Plot an evolved melt having crystallised crystals in the proportions passed. If using non-default options for geoSetting.crystallisationChemistry() pass these as additional arguments

  • element_order (None or list, default: None) – Use to adjust the order of the elements, otherwise they will be given in the order of the chemistry attribute.

Return type

matplotlib.figure, matplotlib.axes

class pyMelt.geosettings.intraPlate(MeltingColumn, P_lithosphere, relative_density=None, viscosity=1e+19, radius=100000.0, weightingFunction=None, **kwargs)[source]

Implementation of an intra-plate volcanic province, representing mantle upwelling beneath lithosphere. The melt flux is calculated assuming flow in a deformable plume conduit (Turcotte and Schubert, 2002). At present a constant rate of decompression throughout the conduit is assumed, likely leading to inaccuracies in the estimated melt chemistry.

Parameters
  • MeltingColumn (pyMelt.meltingcolumn_classes.MeltingColumn) – The melting column from which to construct the geological setting.

  • P_lithosphere (float, default: 0.0) – The pressure at the base of the lithosphere in a continental rift. If this includes the igneous crust, set extract_melt to True. Defaults to 0.0, the case of a a mid-ocean ridge.

  • relative_density (float or None, default: None) – The value of (ambient-density - plume-density) in kg m-3.

  • viscosity (float, default: 1e19) – The viscosity of the mantle plume in Pa s. Default value is 1e19 Pa s, after Shorttle et al. (2014).

  • radius (float, default: 1e5) – The plume radius in m. Default is 1e5 m (or 100 km), after Shorttle et al. (2014).

  • weighting_function (function or None) – A function of pressure allowing non-uniform weighting of melts throughout the melting region. Useful for simulating active upwelling, for example.

Variables
  • MeltingColumn (pyMelt.meltingcolumn_classes.MeltingColumn) – The melting column from which the geological setting was constructed

  • lithologies (dict) – Dictionary containing the DataFrames of the states of each lithology during melting.

  • mantle (pyMelt.Mantle) – The mantle object from which the melting column was calculated.

  • P_lithosphere (float) – The pressure at the base of the lithosphere.

  • melt_flux (float or None) – If the melt flux has been calculated, it will be stored here, in m3 s-1.

  • lithology_contributions (dict) – The relative contributions of each lithology to the pooled melt.

  • chemistry (pandas.Series) – The homogenised melt composition

calcMeltFlux(relative_density, viscosity, radius)[source]

Calculates the melt flux for given plume conduit parameters. Assumes a deformable conduit with constant upwelling velocity, after Turcotte & Schubert (2002).

Parameters
  • relative_density (float) – The value of (plume-density - ambient-density) in kg m-3.

  • viscosity (float) – The viscosity of the mantle plume in Pa s. Default value is 1e19 Pa s, after Shorttle et al. (2014).

  • radius (float) – The plume radius in m. Default is 1e5 m (or 100 km), after Shorttle et al. (2014).

Notes

The volume flux is obtained from the equation:

Q_v = \frac{\pi}{8} \frac{\Delta \rho g r^4}{\mu_p}

Where \rho is the density, g is the acceleration due to gravity, r is the plume conduit radius and \mu_p is the viscosity of the plume.

The melt flux is then obtained from:

Q_m = Q_v \times F

Where F is the total melt fraction obtained.

meltCrystallisationT(ShallowMeltP=None, MeltStorageP=None, liqdTdP=39.16)[source]

Identifies the crystallisation temperature of the deepest and shallowest melts, according to the technique used by Matthews et al. (2016).

Parameters
  • ShallowMeltP (float or None, default: None) – The pressure (in GPa) at which the shallowest melt should be extracted. If set to None (as is default) this will be taken as the base of the crust. If integration has not been performed, this will result in an error.

  • MeltStorageP (float, default: None) – The pressure at which crystallisation is happening. If set to False (as is default), the base of the crust will be used. If triangular integration has not been done, this will result in an error.

  • liqdTdP (float, default: 39.16) – The clapeyron slope of the liquidus (K GPa-1), the default value is 39.16, from equation (15) of Putirka (2008).

Returns

  • float – The minimum crystallisation temperature (degC)

  • float – The maximum crystallisation temperature (degC)

class pyMelt.geosettings.spreadingCentre(MeltingColumn, P_lithosphere=0.0, extract_melt=False, steps=10001, weightingFunction=None, **kwargs)[source]

Implementation of a spreading centre, representing either mid-ocean ridge spreading or continental rift spreading. The crustal thickness is calculated assuming a triangular melting region.

Parameters
  • MeltingColumn (pyMelt.meltingcolumn_classes.MeltingColumn) – The melting column from which to construct the geological setting.

  • P_lithosphere (float, default: 0.0) – The pressure at the base of the lithosphere in a continental rift. If this includes the igneous crust, set extract_melt to True. Defaults to 0.0, the case of a a mid-ocean ridge.

  • extract_melt (bool, default: False) – Should integration continue beyond the calculated igneous crustal thickness (+ lithosphere)? Set to False for modelling a mid-ocean ridge.

  • steps (int or None, default: 10001) – The number of steps over which to perform the crustal thickness calculation. If None, the same number of steps as the melting calculation will be used. Otherwise, the melting results will be interpolated over the new number of steps. This primarily controls how finely the crustal thickness is determined, i.e., the size of the P overstep in obtaining the crustal thickness.

  • weightingFunction (function or None, default: None) – A function used to apply an additional weighting to melts during homogenisation, perhaps for simulating the behaviour of active upwelling. The result from the function will be added to the triangular weighting applied already. The function must take the melting region pressures (as a numpy array or pandas Series) as its first argument, any other arguments will be passed in kwargs.

Variables
  • MeltingColumn (pyMelt.meltingcolumn_classes.MeltingColumn) – The melting column from which the geological setting was constructed

  • lithologies (dict) – Dictionary containing the DataFrames of the states of each lithology during melting.

  • mantle (pyMelt.Mantle) – The mantle object from which the melting column was calculated.

  • P_lithosphere (float) – The pressure at the base of the lithosphere.

  • tc (float) – The crustal thickness, in km.

  • P_base_of_crust (float) – The pressure at the base of the crust, in GPa.

  • lithology_contributions (pandas.Series) – The relative contributions of each lithology to the pooled melt.

  • chemistry (pandas.Series) – The homogenised melt composition

meltCrystallisationT(ShallowMeltP=None, MeltStorageP=None, liqdTdP=39.16)[source]

Identifies the crystallisation temperature of the deepest and shallowest melts, according to the technique used by Matthews et al. (2016).

Parameters
  • ShallowMeltP (float or None, default: None) – The pressure (in GPa) at which the shallowest melt should be extracted. If set to None (as is default) this will be taken as the base of the crust. If integration has not been performed, this will result in an error.

  • MeltStorageP (float, default: None) – The pressure at which crystallisation is happening. If set to False (as is default), the base of the crust will be used. If triangular integration has not been done, this will result in an error.

  • liqdTdP (float, default: 39.16) – The clapeyron slope of the liquidus (K GPa-1), the default value is 39.16, from equation (15) of Putirka (2008).

Returns

  • float – The minimum crystallisation temperature (degC)

  • float – The maximum crystallisation temperature (degC)

pyMelt.geosettings.weighting_expdecay(P, weighting_wavelength, weighting_amplitude=1.0)[source]

Weights melts according to an exponential decay function, with the greatest weighting at the base of the melting region, and zero weighting at the top.

Parameters
  • P (numpy.array or pandas.Series) – The complete set of pressure values for the melting region.

  • weighting_wavelength (float) – The wavelength of the exponential decay (applied to pressures normalised to vary between 0 and 1).

  • weighting_amplitude (float, default: 1.0) – The amplitude of the exponential function.

Chemistry

The chemistry module provides the base classes for defining chemical elements/species for inclusion in pyMelt calculations, alongside default implementations.

class pyMelt.chemistry.batchSpecies(name, c0, D, **kwargs)[source]

Implementation of the species class for batch melting with a constant partition coefficient.

Parameters
  • name (str) – The name of the species.

  • c0 (float) – The concentration of the species in the solid. Must be the same units as required in the output.

  • D (float) – The partition coefficient

D(state)[source]

The partition coefficient. If a constant partition coefficient is used it will return that value. If a variable coefficient is used it will call the function to calculate it.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

Returns

The partition coefficient

Return type

float

composition(state)[source]

Returns the concentration in the melt during batch melting.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

class pyMelt.chemistry.continuousSpecies_accumulated(name, c0, D, phi=0.005, **kwargs)[source]

Implementation of the species class for batch melting with a constant partition coefficient.

Parameters
  • name (str) – The name of the species.

  • c0 (float) – The concentration of the species in the solid. Must be the same units as required in the output.

  • D (float) – The partition coefficient

D(state)[source]

The partition coefficient. If a constant partition coefficient is used it will return that value. If a variable coefficient is used it will call the function to calculate it.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

Returns

The partition coefficient

Return type

float

composition(state)[source]

Returns the concentration in the melt during batch melting.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

class pyMelt.chemistry.continuousSpecies_instantaneous(name, c0, D, phi=0.005, **kwargs)[source]

Implementation of the species class for batch melting with a constant partition coefficient.

Parameters
  • name (str) – The name of the species.

  • c0 (float) – The concentration of the species in the solid. Must be the same units as required in the output.

  • D (float) – The partition coefficient

D(state)[source]

The partition coefficient. If a constant partition coefficient is used it will return that value. If a variable coefficient is used it will call the function to calculate it.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

Returns

The partition coefficient

Return type

float

composition(state)[source]

Returns the instantaneous concentration in the melt during near-fractional (continuous) melting.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

pyMelt.chemistry.cpx_D = {'Ba': 0.0004, 'Ce': 0.08, 'Dy': 0.4, 'Er': 0.42, 'Eu': 0.335, 'Gd': 0.35, 'Hf': 0.284, 'Ho': 0.427, 'La': 0.049, 'Lu': 0.376, 'Nb': 0.015, 'Nd': 0.178, 'Pb': 0.012, 'Pr': 0.126, 'Rb': 0.0004, 'Sm': 0.293, 'Sr': 0.091, 'Ta': 0.015, 'Tb': 0.403, 'Th': 0.0059, 'Ti': 0.35, 'U': 0.0094, 'Y': 0.426, 'Yb': 0.4, 'Zr': 0.119}

Trace element partition coefficients between clinopyroxene and melt, compiled by Gibson & Geist (2010).

pyMelt.chemistry.defaultD = olv     cpx       opx    plg      grt     spn Rb  0.000300  0.0004  0.000200  0.030  0.00020  0.0001 Ba  0.000005  0.0004  0.000006  0.330  0.00007  0.0001 Th  0.000050  0.0059  0.002000  0.050  0.00900  0.0000 U   0.000380  0.0094  0.002000  0.110  0.02800  0.0000 Nb  0.000500  0.0150  0.004000  0.010  0.01500  0.0000 Ta  0.000500  0.0150  0.004000  0.000  0.01500  0.0000 La  0.000500  0.0490  0.003100  0.270  0.00100  0.0100 Ce  0.000500  0.0800  0.004000  0.200  0.00500  0.0100 Pb  0.003000  0.0120  0.009000  0.360  0.00500  0.0000 Pr  0.000800  0.1260  0.004800  0.170  0.01400  0.0100 Nd  0.000420  0.1780  0.012000  0.140  0.05200  0.0100 Sr  0.000040  0.0910  0.000700  2.000  0.00070  0.0000 Zr  0.003300  0.1190  0.013000  0.010  0.27000  0.0000 Hf  0.002200  0.2840  0.030000  0.010  0.40000  0.0000 Sm  0.001100  0.2930  0.020000  0.110  0.25000  0.0100 Eu  0.001600  0.3350  0.013000  0.730  0.49600  0.0100 Ti  0.015000  0.3500  0.086000  0.040  0.60000  0.1500 Gd  0.001100  0.3500  0.013000  0.066  0.84800  0.0100 Tb  0.001500  0.4030  0.019000  0.060  1.47700  0.0100 Dy  0.002700  0.4000  0.011000  0.055  2.20000  0.0100 Ho  0.001600  0.4270  0.006500  0.048  3.31500  0.0100 Y   0.009900  0.4260  0.052000  0.030  3.10000  0.0100 Er  0.013000  0.4200  0.045000  0.010  4.40000  0.0100 Yb  0.020000  0.4000  0.080000  0.031  6.60000  0.0100 Lu  0.020000  0.3760  0.120000  0.025  7.10000  0.0100

Dataframe containing the partition coefficients for each phase in INVMEL.

pyMelt.chemistry.default_methods = {'Ba': 'continuous_instantaneous', 'Ce': 'invmel', 'Dy': 'invmel', 'Er': 'invmel', 'Eu': 'invmel', 'Gd': 'invmel', 'Hf': 'invmel', 'Ho': 'invmel', 'La': 'invmel', 'Lu': 'invmel', 'Nb': 'invmel', 'Nd': 'invmel', 'Pb': 'invmel', 'Pr': 'invmel', 'Rb': 'continuous_instantaneous', 'Sm': 'invmel', 'Sr': 'invmel', 'Ta': 'invmel', 'Tb': 'invmel', 'Th': 'invmel', 'Ti': 'invmel', 'U': 'invmel', 'Y': 'invmel', 'Yb': 'invmel', 'Zr': 'invmel'}

The method to use for each element when a method isn’t otherwise specified.

pyMelt.chemistry.grt_D = {'Ba': 7e-05, 'Ce': 0.005, 'Dy': 2.2, 'Er': 4.4, 'Eu': 0.496, 'Gd': 0.848, 'Hf': 0.4, 'Ho': 3.315, 'La': 0.001, 'Lu': 7.1, 'Nb': 0.015, 'Nd': 0.052, 'Pb': 0.005, 'Pr': 0.014, 'Rb': 0.0002, 'Sm': 0.25, 'Sr': 0.0007, 'Ta': 0.015, 'Tb': 1.477, 'Th': 0.009, 'Ti': 0.6, 'U': 0.028, 'Y': 3.1, 'Yb': 6.6, 'Zr': 0.27}

Trace element partition coefficients between garnet and melt, compiled by Gibson & Geist (2010).

class pyMelt.chemistry.invmelSpecies(name, c0, olv_D, cpx_D, opx_D, spn_D, grt_D, plg_D, mineralProportions=             olv    opx    cpx    grt    spn    plg grt_field  0.598  0.221  0.076  0.115  0.000  0.000 spn_field  0.578  0.270  0.119  0.000  0.033  0.000 plg_field  0.636  0.263  0.012  0.000  0.000  0.089, density=3.3, cpxExhaustion=0.18, garnetOut=<pyMelt.chemistry.mineralTransition_linear object>, spinelIn=<pyMelt.chemistry.mineralTransition_linear object>, spinelOut=<pyMelt.chemistry.mineralTransition_isobaric object>, plagioclaseIn=<pyMelt.chemistry.mineralTransition_isobaric object>, **kwargs)[source]

Implementation of the forward trace element model used by invmel (McKenzie & O’Nions, 1991).

The default values of the mineral-melt partition coefficients are taken from REFERENCE.

Parameters
  • name (str) – The name of the species.

  • c0 (float) – The concentration of the species in the solid. Must be the same units as required in the output.

  • olv_D (float) – The partition coefficient for olivine-melt.

  • cpx_D (float) – The partition coefficient for clinopyroxene-melt.

  • opx_D (float) – The partition coefficient for orthopyroxene-melt.

  • spn_D (float) – The partition coefficient for spinel-melt.

  • grt_D (float) – The partition coefficient for garnet-melt.

  • plg_D (float) – The partition coefficient for plagioclase-melt.

  • MineralProportions (pandas.DataFrame, default: pyMelt.chemistry.mo91_MineralProportions) – A dataframe with the proportions of each mineral phase (columns) in the garnet-, spinel-, and plagioclase-field for the lithology. See built in defaults for formatting of keys and columns: mo91_MineralProportions, klb1_MineralProportions, kg1_MineralProportions.

  • density (float, default: 3.3) – The density of the mantle (g cm-3)

  • cpxExhaustion (int, default: 0.18) – The melt fraction at which cpx (and grt/plg/spn) are exhausted.

  • garnetOut (mineralTransition, default: 1/666.7*T + 400/666.7 GPa) – The garnet-out reaction (decompression).

  • spinelIn (mineralTransition, default: 1/666.7*T + 533/666.7 GPa) – The spinel-in reaction (decompression).

  • spinelOut (mineralTransition, default: 25*0.033 GPa) – The spinel-out reaction (decompression).

  • plagioclaseIn (mineralTransition, default: 35*0.033 GPa) – The plagioclase-in reaction (decompression).

Variables
  • name (str) – Name of the species

  • c0 (float) – Concentration of the species in the solid.

  • D (numpy.Array) – The partition coefficients in the order: olivine, cpx, opx, spinel, garnet, plag.

  • MineralProportions_solid (pandas.DataFrame) – See parameters above.

  • density (float) – The density of the mantle (g cm-3)

D(state)[source]

The partition coefficient. If a constant partition coefficient is used it will return that value. If a variable coefficient is used it will call the function to calculate it.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

Returns

The partition coefficient

Return type

float

composition(state)[source]

Returns the concentration of the species in the melt for the specified state. This function should be redefined according to the chemical model being used.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

Returns

The concentration of the species in the melt.

Return type

float

pyMelt.chemistry.kg1_MineralProportions = olv    opx    cpx    grt    spn    plg grt_field  0.181  0.012  0.422  0.385  0.000  0.000 spn_field  0.110  0.178  0.641  0.000  0.071  0.000 plg_field  0.118  0.150  0.655  0.000  0.000  0.067

Mineral proportions (Wt%) for KG1 in the garnet-, spinel-, and plagioclase-field (estimated from Matthews et al., 2021).

pyMelt.chemistry.klb1_MineralProportions = olv    opx    cpx    grt    spn   plg grt_field  0.609  0.125  0.119  0.147  0.000  0.00 spn_field  0.597  0.233  0.158  0.000  0.012  0.00 plg_field  0.646  0.208  0.076  0.000  0.000  0.07

Mineral proportions (Wt%) for KLB1 in the garnet-, spinel-, and plagioclase-field (estimated from Jennings and Holland, 2015).

class pyMelt.chemistry.mineralTransition(parameters={})[source]

Template for the mineralTransition class used to define mineral transitions in the invMEL chemistry model (and perhaps other models in the future).

Parameters

parameters (dict) – A dictionary of parameters required by the transition function.

transition(T)[source]

Template transition method. Must be a function of temperature using parameters contained in the parameters dictionary.

Parameters

T (float) – Temperature (in degC).

Returns

Transition pressure (in GPa).

Return type

float

class pyMelt.chemistry.mineralTransition_isobaric(parameters={})[source]

Representation of a mineral transition that does not depend on temperature. Temperature is still taken as an argument for uniformity.

The parameters dictionary must contain items:
  • ‘transition_pressure’: the transition pressure in GPa

transition(T)[source]

Template transition method. Must be a function of temperature using parameters contained in the parameters dictionary.

Parameters

T (float) – Temperature (in degC).

Returns

Transition pressure (in GPa).

Return type

float

class pyMelt.chemistry.mineralTransition_linear(parameters={})[source]

Representation of a mineral transition (e.g. garnet-in) as a linear function of temperature.

The parameters dictionary must contain items:
  • ‘intercept’: the intercept pressure (T=0) in GPa

  • ‘gradient’: the gradient of the line (GPa/degC)

transition(T)[source]

Template transition method. Must be a function of temperature using parameters contained in the parameters dictionary.

Parameters

T (float) – Temperature (in degC).

Returns

Transition pressure (in GPa).

Return type

float

pyMelt.chemistry.mo91_MineralProportions = olv    opx    cpx    grt    spn    plg grt_field  0.598  0.221  0.076  0.115  0.000  0.000 spn_field  0.578  0.270  0.119  0.000  0.033  0.000 plg_field  0.636  0.263  0.012  0.000  0.000  0.089

Mineral proportions (Wt%) for lherzolite in the garnet-, spinel-, and plagioclase-field, from McKenzie & O’Nions (1991).

pyMelt.chemistry.olv_D = {'Ba': 5e-06, 'Ce': 0.0005, 'Dy': 0.0027, 'Er': 0.013, 'Eu': 0.0016, 'Gd': 0.0011, 'Hf': 0.0022, 'Ho': 0.0016, 'La': 0.0005, 'Lu': 0.02, 'Nb': 0.0005, 'Nd': 0.00042, 'Pb': 0.003, 'Pr': 0.0008, 'Rb': 0.0003, 'Sm': 0.0011, 'Sr': 4e-05, 'Ta': 0.0005, 'Tb': 0.0015, 'Th': 5e-05, 'Ti': 0.015, 'U': 0.00038, 'Y': 0.0099, 'Yb': 0.02, 'Zr': 0.0033}

Trace element partition coefficients between olivine and melt, compiled by Gibson & Geist (2010).

pyMelt.chemistry.opx_D = {'Ba': 6e-06, 'Ce': 0.004, 'Dy': 0.011, 'Er': 0.045, 'Eu': 0.013, 'Gd': 0.013, 'Hf': 0.03, 'Ho': 0.0065, 'La': 0.0031, 'Lu': 0.12, 'Nb': 0.004, 'Nd': 0.012, 'Pb': 0.009, 'Pr': 0.0048, 'Rb': 0.0002, 'Sm': 0.02, 'Sr': 0.0007, 'Ta': 0.004, 'Tb': 0.019, 'Th': 0.002, 'Ti': 0.086, 'U': 0.002, 'Y': 0.052, 'Yb': 0.08, 'Zr': 0.013}

Trace element partition coefficients between orthopyroxene and melt, compiled by Gibson & Geist (2010).

pyMelt.chemistry.palme13_ci = {'Ba': 2.42, 'Ce': 0.6194, 'Dy': 0.2558, 'Er': 0.1655, 'Eu': 0.05883, 'Gd': 0.2069, 'Hf': 0.1065, 'Ho': 0.05644, 'La': 0.2414, 'Lu': 0.02503, 'Nb': 0.283, 'Nd': 0.4737, 'Pb': 2.62, 'Pr': 0.0939, 'Rb': 2.32, 'Sm': 0.1536, 'Sr': 7.79, 'Ta': 0.015, 'Tb': 0.03797, 'Th': 0.03, 'Ti': 447.0, 'U': 0.0081, 'Y': 1.46, 'Yb': 0.1687, 'Zr': 3.63}

Trace element concentrations in a CI chondrite (ppmw) from Palme & O’Neill (2013).

pyMelt.chemistry.palme13_pm = {'Ba': 6.85, 'Ce': 1.7529, 'Dy': 0.7239, 'Er': 0.4684, 'Eu': 0.1665, 'Gd': 0.5855, 'Hf': 0.3014, 'Ho': 0.1597, 'La': 0.6832, 'Lu': 0.07083, 'Nb': 0.595, 'Nd': 1.341, 'Pb': 0.185, 'Pr': 0.2657, 'Rb': 0.605, 'Sm': 0.4347, 'Sr': 22.0, 'Ta': 0.043, 'Tb': 0.1075, 'Th': 0.0849, 'Ti': 1265.0, 'U': 0.0229, 'Y': 4.13, 'Yb': 0.4774, 'Zr': 10.3}

The composition of the primitive mantle (ppmw) from Palme & O’Neill (2013).

pyMelt.chemistry.plg_D = {'Ba': 0.33, 'Ce': 0.2, 'Dy': 0.055, 'Er': 0.01, 'Eu': 0.73, 'Gd': 0.066, 'Hf': 0.01, 'Ho': 0.048, 'La': 0.27, 'Lu': 0.025, 'Nb': 0.01, 'Nd': 0.14, 'Pb': 0.36, 'Pr': 0.17, 'Rb': 0.03, 'Sm': 0.11, 'Sr': 2.0, 'Ta': 0.0, 'Tb': 0.06, 'Th': 0.05, 'Ti': 0.04, 'U': 0.11, 'Y': 0.03, 'Yb': 0.031, 'Zr': 0.01}

Trace element partition coefficients between plagioclase and melt, compiled by Gibson & Geist (2010).

class pyMelt.chemistry.species(name, c0, **kwargs)[source]

The species base class. The class contains all the parameters and methods required to calculate the concentration of chemical species in melts, given T, P, F, etc.

Parameters
  • name (str) – The name of the species.

  • c0 (float) – The concentration of the species in the solid. Must be the same units as required in the output.

composition(state)[source]

Returns the concentration of the species in the melt for the specified state. This function should be redefined according to the chemical model being used.

Parameters

state (pandas.Series) – The state of the system, e.g. temperature (T), pressure (P), melt fraction (F). This will most likely be generated automatically by the MeltingColumn_1D class.

Returns

The concentration of the species in the melt.

Return type

float

pyMelt.chemistry.spn_D = {'Ba': 0.0001, 'Ce': 0.01, 'Dy': 0.01, 'Er': 0.01, 'Eu': 0.01, 'Gd': 0.01, 'Hf': 0.0, 'Ho': 0.01, 'La': 0.01, 'Lu': 0.01, 'Nb': 0.0, 'Nd': 0.01, 'Pb': 0.0, 'Pr': 0.01, 'Rb': 0.0001, 'Sm': 0.01, 'Sr': 0.0, 'Ta': 0.0, 'Tb': 0.01, 'Th': 0.0, 'Ti': 0.15, 'U': 0.0, 'Y': 0.01, 'Yb': 0.01, 'Zr': 0.0}

Trace element partition coefficients between spinel and melt, compiled by Gibson & Geist (2010).

pyMelt.chemistry.stracke03_bsic = {'Ba': 6.59, 'Ce': 5.89, 'Dy': 5.01, 'Er': 3.13, 'Eu': 1.04, 'Gd': 4.03, 'Hf': 1.78, 'La': 1.68, 'Lu': 0.45, 'Nb': 1.95, 'Nd': 7.45, 'Pb': 0.09, 'Rb': 0.57, 'Sm': 2.69, 'Sr': 81.0, 'Ta': 0.124, 'Th': 0.088, 'Ti': 7735.0, 'U': 0.027, 'Y': 28.5, 'Yb': 2.99, 'Zr': 64.0}

The trace element concentrations (ppmw) in bulk subducted igneous crust from Stracke et al. (2003).

pyMelt.chemistry.workman05_D = {'Ba': 0.00012, 'Ce': 0.022, 'Dy': 0.079, 'Er': 0.097, 'Eu': 0.05, 'Gd': 0.056, 'Hf': 0.035, 'Ho': 0.084, 'La': 0.01, 'Lu': 0.12, 'Nb': 0.0034, 'Nd': 0.031, 'Pb': 0.014, 'Pr': 0.027, 'Rb': 1e-05, 'Sm': 0.045, 'Sr': 0.025, 'Ta': 0.0034, 'Tb': 0.068, 'Th': 0.001, 'Ti': 0.058, 'U': 0.0011, 'Y': 0.088, 'Yb': 0.115, 'Zr': 0.033}

The bulk partition coefficients for MORB production from Workman & Hart (2005).

pyMelt.chemistry.workman05_dmm = {'Ba': 0.563, 'Ce': 0.55, 'Dy': 0.505, 'Er': 0.348, 'Eu': 0.096, 'Gd': 0.358, 'Hf': 0.157, 'Ho': 0.115, 'La': 0.192, 'Lu': 0.058, 'Nb': 0.1485, 'Nd': 0.581, 'Pb': 0.018, 'Pr': 0.107, 'Rb': 0.05, 'Sm': 0.239, 'Sr': 7.664, 'Ta': 0.0096, 'Tb': 0.07, 'Th': 0.0079, 'Ti': 716.3, 'U': 0.0032, 'Y': 3.328, 'Yb': 0.365, 'Zr': 5.082}

The trace element concentrations in the depleted MORB mantle from Workman & Hart (2005). All concentrations are in ppmw.

Lithologies

The lithologies module provides lithology objects representing different bulk compositions, with models published by a number of authors.

Matthews et al. (2021)

Implentation of the melting models developed by Matthews et al. (2021).

class pyMelt.lithologies.matthews.eclogite(CP=1000.0, alphas=40.0, alphaf=68.0, rhos=3.3, rhof=2.9, DeltaS=300.0, parameters={'C1': 533.842, 'C2': 4.921, 'C3': 20.148, 'C4': 80.879, 'D1': 994.149, 'D2': 8.092, 'D3': - 11.778, 'D4': - 862.641, 'beta': 2.134})[source]

Implementation of the silica-saturated pyroxenite (or eclogite) melting model from Matthews et al. (2021).

To use the same format of parameterisation for another lithology, the parameter values may be changed. They are provided as a dictionary during initialisation of the class.

  • C1: Parameter used in solidus definition.

  • C2: Parameter used in solidus definition.

  • C3: Parameter used in solidus definition.

  • C4: Parameter used in solidus definition.

  • D1: Parameter used in liquidus definition.

  • D2: Parameter used in liquidus definition.

  • D3: Parameter used in liquidus definition.

  • D4: Parameter used in liquidus definition.

  • beta: Parameter used in melt fraction definition.

The thermal expansivities, the heat capacity, the densities, and the entropy of fusion may also be changed during class initialisation.

Parameters
  • CP (float, default: pyMelt.default_properties[‘CP’]) – The heat capacity (J K-1 kg-1)

  • alphas (float, default: pyMelt.default_properties[‘alphas’]) – The thermal expansivity of the solid (1e-6 K-1)

  • alphaf (float, default: pyMelt.default_properties[‘alphaf’]) – The thermal expansivity of the melt (1e-6 K-1)

  • rhos (float, default: pyMelt.default_properties[‘rhos’]) – The density of the solid (kg m-3)

  • rhof (float, default: pyMelt.default_properties[‘rhof’]) – The density of the melt (kg m-3)

  • DeltaS (float, default: pyMelt.default_properties[‘DeltaS’]) – The entropy of fusion J K-1 kg-1

  • parameters (dict, default: parameters from Matthews et al. (2021)) – The model parameters described above

F(P, T, **kwargs)[source]

Calculates melt fraction at a given pressure and temperature using T’**beta, where T is the normalised temperature: (T-Tsolidus)/(T-Tliquidus). If P and T are below the the solidus, 0 is returned, if they are above the liquidus, 1 is returned.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

Melt fraction.

Return type

float

TLiquidus(P, **kwargs)[source]

Calculates the liquidus temperature at a given pressure.

Parameters

P (float) – Pressure (GPa)

Returns

Liquidus temperature (degC).

Return type

float

TSolidus(P, **kwargs)[source]

Calculates the solidus temperature at a given pressure.

Parameters

P (float) – Pressure (GPa).

Returns

Solidus temperature (degC).

Return type

float

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P) at a given pressure and temperature.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dF(const. P) (K)

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F) at a given pressure and temperature.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dTdP(const. F) (K GPa-1)

Return type

float

class pyMelt.lithologies.matthews.kg1(CP=1000.0, alphas=40.0, alphaf=68.0, rhos=3.3, rhof=2.9, DeltaS=300.0, parameters={'A1': 450.0, 'A2': 2.098, 'A3': 17.0, 'A4': 623.828, 'B1': 174.566, 'B2': 336.833, 'B3': 66.762, 'B4': 503.101, 'C': 0.506, 'Mcpx': 0.342, 'beta1': 1.382, 'beta2': 1.8, 'r1': 0.342, 'r2': 0.191})[source]

Implementation of the KG1 melting model from Matthews et al. (2021).

To use the same format of parameterisation for another lithology, the parameter values may be changed. They are provided as a dictionary during initialisation of the class.

  • Mcpx: Mass fraction of cpx in the source. Controls the transition to low-productivity harzburgite-type melting.

  • A1: Parameter used to define solidus.

  • A2: Parameter used to define solidus.

  • A3: Parameter used to define solidus.

  • A4: Parameter used to define solidus.

  • B1: Parameter used to define liquidus.

  • B2: Parameter used to define liquidus.

  • B3: Parameter used to define liquidus.

  • B4: Parameter used to define liquidus.

  • C: Parameter used to define lherzolite-liquidus.

  • beta1: Parameter used to calculate melt fraction during cpx-present melting.

  • beta2: Parameter used to calculate melt fraction during cpx-absent melting.

  • r1: Parameter used to define cpx reaction coefficient.

  • r2: Parameter used to define cpx reaction coefficient.

The thermal expansivities, the heat capacity, the densities, and the entropy of fusion may also be changed during class initialisation.

Parameters
  • CP (float, default: pyMelt.default_properties[‘CP’]) – The heat capacity (J K-1 kg-1)

  • alphas (float, default: pyMelt.default_properties[‘alphas’]) – The thermal expansivity of the solid (1e-6 K-1)

  • alphaf (float, default: pyMelt.default_properties[‘alphaf’]) – The thermal expansivity of the melt (1e-6 K-1)

  • rhos (float, default: pyMelt.default_properties[‘rhos’]) – The density of the solid (kg m-3)

  • rhof (float, default: pyMelt.default_properties[‘rhof’]) – The density of the melt (kg m-3)

  • DeltaS (float, default: pyMelt.default_properties[‘DeltaS’]) – The entropy of fusion J K-1 kg-1

  • parameters (dict, default: parameters from Matthews et al. (2021)) – The model parameters described above

F(P, T, **kwargs)[source]

Wrapper for the melt fraction functions. If T and P are below the solidus, returns 0, if they are above the liquidus, returns 1. If below the temperature of cpx-exhaustion, calls the Fcpx function, otherwise calls the Fopx function.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

Melt fraction.

Return type

float

TLiquidus(P, **kwargs)[source]

Returns the temperature of the liquidus at any given pressure.

Parameters

P (float) – Pressure (GPa).

Returns

Liquidus temperature (degC).

Return type

float

TSolidus(P, **kwargs)[source]

Returns the temperature of the solidus at any given pressure.

Parameters

P (float) – Pressure (GPa).

Returns

Solidus temperature (degC).

Return type

float

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P). First calculates the melt fraction. If F is zero, returns _np.inf. If F is 1, returns _np.inf. Otherwise uses the appropriate expressions for cpx present or absent melting.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

dT/dF(const. P) (K).

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F). First calculates F, then chooses the appropriate expression for cpx present or absent melting.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dP(const. F) (K GPa-1).

Return type

float

class pyMelt.lithologies.matthews.klb1(CP=1000.0, alphas=40.0, alphaf=68.0, rhos=3.3, rhof=2.9, DeltaS=300.0, parameters={'A1': 2445.754, 'A2': 9.511, 'A3': - 99.782, 'A4': - 4378.581, 'B1': 480.403, 'B2': 672.391, 'B3': 12.275, 'B4': - 1242.536, 'C': 0.6873, 'Mcpx': 0.15, 'beta1': 1.5, 'beta2': 1.5, 'r1': 0.5, 'r2': 0.08})[source]

Implementation of the KLB1 melting model from Matthews et al. (2021).

To use the same format of parameterisation for another lithology, the parameter values may be changed. They are provided as a dictionary during initialisation of the class.

  • Mcpx: Mass fraction of cpx in the source. Controls the transition to low-productivity harzburgite-type melting.

  • A1: Parameter used to define solidus.

  • A2: Parameter used to define solidus.

  • A3: Parameter used to define solidus.

  • A4: Parameter used to define solidus.

  • B1: Parameter used to define liquidus.

  • B2: Parameter used to define liquidus.

  • B3: Parameter used to define liquidus.

  • B4: Parameter used to define liquidus.

  • C: Parameter used to define lherzolite-liquidus.

  • beta1: Parameter used to calculate melt fraction during cpx-present melting.

  • beta2: Parameter used to calculate melt fraction during cpx-absent melting.

  • r1: Parameter used to define cpx reaction coefficient.

  • r2: Parameter used to define cpx reaction coefficient.

The thermal expansivities, the heat capacity, the densities, and the entropy of fusion may also be changed during class initialisation.

Parameters
  • CP (float, default: pyMelt.default_properties[‘CP’]) – The heat capacity (J K-1 kg-1)

  • alphas (float, default: pyMelt.default_properties[‘alphas’]) – The thermal expansivity of the solid (1e-6 K-1)

  • alphaf (float, default: pyMelt.default_properties[‘alphaf’]) – The thermal expansivity of the melt (1e-6 K-1)

  • rhos (float, default: pyMelt.default_properties[‘rhos’]) – The density of the solid (kg m-3)

  • rhof (float, default: pyMelt.default_properties[‘rhof’]) – The density of the melt (kg m-3)

  • DeltaS (float, default: pyMelt.default_properties[‘DeltaS’]) – The entropy of fusion J K-1 kg-1

  • parameters (dict, default: parameters from Matthews et al. (2021))

F(P, T, **kwargs)[source]

Wrapper for the melt fraction functions. If T and P are below the solidus, returns 0, if they are above the liquidus, returns 1. If below the temperature of cpx-exhaustion, calls the Fcpx function, otherwise calls the Fopx function.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

Melt fraction.

Return type

float

TLiquidus(P, **kwargs)[source]

Returns the temperature of the liquidus at any given pressure.

Parameters

P (float) – Pressure (GPa).

Returns

Liquidus temperature (degC).

Return type

float

TSolidus(P, **kwargs)[source]

Returns the temperature of the solidus at any given pressure.

Parameters

P (float) – Pressure (GPa).

Returns

Solidus temperature (degC).

Return type

float

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P). First calculates the melt fraction. If F is zero, returns _np.inf. If F is 1, returns _np.inf. Otherwise uses the appropriate expressions for cpx present or absent melting.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

dT/dF(const. P) (K).

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F). First calculates F, then chooses the appropriate expression for cpx present or absent melting.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dP(const. F) (K GPa-1).

Return type

float

Shorttle et al. (2014)

Implementation of the new lithologies in Shorttle et al. (2014).

class pyMelt.lithologies.shorttle.harzburgite(CP=1000.0, alphas=30.0, alphaf=30.0, rhos=3.25, rhof=2.9, DeltaS=300, parameters={})[source]

Material that does not melt, i.e. Harzburgite in Shorttle et al. (2014) and Matthews et al. (2016). Default constants as defined by Shorttle et al. (2014).

The thermal expansivities, the heat capacity, the densities, and the entropy of fusion may be changed during class initialisation.

Parameters
  • CP (float, default: 1000.0) – The heat capacity (J K-1 kg-1)

  • alphas (float, default: 30.0) – The thermal expansivity of the solid (1e-6 K-1)

  • alphaf (float, default: 30.0) – Melt thermal expansivity, not used, here for consistency.

  • rhos (float, default: 3.25) – The density of the solid (kg m-3)

  • rhof (float, default: 2.9) – Melt density, not used, here for consistency.

  • DeltaS (float, default: 300) – The entropy of fusion, not used, here for consistency.

  • parameters (dict, default: {}) – This model does not use any parameters, here for consistency.

F(P, T, **kwargs)[source]

Melt Fraction. Returns 0.0.

Parameters
  • P (float) – Pressure. There to maintain consistancy within lithology definitions.

  • T (float) – Temperature. There to maintain consistancy within lithology definitions.

Returns

Melt fraction will always be 0.0.

Return type

float

TLiquidus(P, **kwargs)[source]

Liquidus temperature. Returns _np.inf

Parameters

P (float) – Pressure. There to maintain consistancy within lithology definitions.

Returns

The value will always be infinite.

Return type

numpy.inf

TSolidus(P, **kwargs)[source]

Solidus temperature. Returns _np.inf.

Parameters

P (float) – Pressure. There to maintain consistancy within lithology definitions.

Returns

The value will always be infinite.

Return type

numpy.inf

dTdF(P, T, **kwargs)[source]

dTdF(constP). Returns _np.inf.

Parameters
  • P (float) – Pressure. There to maintain consistancy within lithology definitions.

  • T (float) – Temperature. There to maintain consistancy within lithology definitions.

Returns

The value will always be infinite.

Return type

numpy.inf

dTdP(P, T, **kwargs)[source]

dTdP(constF). Returns 0.0.

Parameters
  • P (float) – Pressure. There to maintain consistancy within lithology definitions.

  • T (float) – Temperature. There to maintain consistancy within lithology definitions.

Returns

The value will always be 0.0.

Return type

float

class pyMelt.lithologies.shorttle.kg1(CP=1140.0, alphas=30.0, alphaf=68.0, rhos=3.3, rhof=2.9, DeltaS=380.0, parameters={'A1': 1095.4, 'A2': 124.1, 'A3': - 4.7, 'B1': 1179.6, 'B2': 157.2, 'B3': - 11.1, 'C1': 1780.0, 'C2': 45.0, 'C3': - 2.0, 'a': 0.3187864, 'alpha': 2.0, 'b': 0.4154, 'beta': 1.5, 'c': 0.7341864, 'd': 0.2658136})[source]

Implementation of the KG1 parameterisation by Shorttle et al. (2014).

To use the same format of parameterisation for another lithology, the parameter values may be changed. They are provided as a dictionary during initialisation of the class, with values:

  • A1: Constant used in solidus expression.

  • A2: Constant used in solidus expression.

  • A3: Constant used in solidus expression.

  • B1: Constant used in cpx-out expression.

  • B2: Constant used in cpx-out expression.

  • B3: Constant used in cpx-out expression.

  • C1: Constant used in liquidus expression.

  • C2: Constant used in liquidus expression.

  • C3: Constant used in liquidus expression.

  • a: Constant used in cpx-present melt fraction expression.

  • b: Constant used in cpx-present melt fraction expression.

  • c: Constant used in cpx-absent melt fraction expression.

  • d: Constant used in cpx-absent melt fraction expression.

  • alpha: Exponent used in the cpx-present melt fraction expression.

  • beta: Exponent used in the cpx-absent melt fraction expression.

The thermal expansivities, the heat capacity, the densities, and the entropy of fusion may also be changed during class initialisation.

Parameters
  • CP (float, default: 1140.0) – The heat capacity (J K-1 kg-1)

  • alphas (float, default: 30.0) – The thermal expansivity of the solid (1e-6 K-1)

  • alphaf (float, default: 68.0) – The thermal expansivity of the melt (1e-6 K-1)

  • rhos (float, default: 3.3) – The density of the solid (kg m-3)

  • rhof (float, default: 2.9) – The density of the melt (kg m-3)

  • DeltaS (float, default: 380.0) – The entropy of fusion J K-1 kg-1

  • parameters (dict, default: parameters from Shorttle et al. (2014)) – The model parameters described above

F(P, T, **kwargs)[source]

Returns melt fraction at a given pressure and temperature. If below the solidus, returns 0. If above the liquidus, returns 1.

Prior to cpx exhaustion: F = a*(Tr)**alpha _ b*Tr Tr = (T-Tsol)/(Tliq-Tsol)

After cpx exhaustion: F = d*(Tr)**beta + c Tr = (T-Tcpx)/(Tliq-Tcpx)

Parameters
  • P (float) – Pressure in GPa.

  • T (float) – Temperature in degC.

Returns

Melt fraction between 0 and 1.

Return type

float

TLiquidus(P, **kwargs)[source]

Returns liquidus temperature at a given pressure. T = C1 + C2*P + C3*P**2.

Parameters

P (float, or list like) – Pressure in GPa.

Returns

Liquidus temperature in degC.

Return type

float, or list like

TSolidus(P, **kwargs)[source]

Returns solidus temperature at a given pressure. T = A1 + A2*P + A3*P**2.

Parameters

P (float, or list like) – Pressure in GPa.

Returns

Solidus Temperature in degC.

Return type

float, or list like

dTdF(P, T, **kwargs)[source]

Returns dT/dF (constant P) at a given pressure and temperature. If below the solidus, or above the liquidus, _np.inf is returned.

Parameters
  • P (float) – Pressure in GPa.

  • T (float) – Temperature in degC.

Returns

dT/dF (constant P) in K.

Return type

float

dTdP(P, T, **kwargs)[source]

Returns dT/dP (constant F) at a given pressure and temperature.

Parameters
  • P (float) – Pressure in GPa.

  • T (float) – Temperature in degC.

Returns

dT/dP (constant F) in K GPa-1.

Return type

float

Katz et al. (2003)

Implementation of the anhydrous melting model presented by Katz et al. (2003).

class pyMelt.lithologies.katz.lherzolite(CP=1000.0, alphas=40.0, alphaf=68.0, rhos=3.3, rhof=2.9, DeltaS=300.0, parameters={'A1': 1085.7, 'A2': 132.9, 'A3': - 5.1, 'B1': 1475.0, 'B2': 80.0, 'B3': - 3.2, 'C1': 1780.0, 'C2': 45.0, 'C3': - 2.0, 'Mcpx': 0.17, 'beta1': 1.5, 'beta2': 1.5, 'r1': 0.5, 'r2': 0.08})[source]

Implementation of the Katz et al. (2003) anhydrous lherzolite melting model.

To use the same format of parameterisation for another lithology, the parameter values may be changed. They are provided as a dictionary during initialisation of the class.

  • Mcpx: Mass fraction of cpx in the source. Controls the transition to low-productivity harzburgite-type melting.

  • A1: Parameter used to define solidus.

  • A2: Parameter used to define solidus.

  • A3: Parameter used to define solidus.

  • B1: Parameter used to define lherzolite-liquidus.

  • B2: Parameter used to define lherzolite-liquidus.

  • B3: Parameter used to define lherzolite-liquidus.

  • C1: Parameter used to define liquidus.

  • C2: Parameter used to define liquidus.

  • C3: Parameter used to define liquidus.

  • beta1: Parameter used to calculate melt fraction during cpx-present melting.

  • beta2: Parameter used to calculate melt fraction during cpx-absent melting.

  • r1: Parameter used to define cpx reaction coefficient.

  • r2: Parameter used to define cpx reaction coefficient.

The thermal expansivities, the heat capacity, the densities, and the entropy of fusion may also be changed during class initialisation.

Parameters
  • CP (float, default: pyMelt.lithology_class.default_properties[‘CP’]) – The heat capacity (J K-1 kg-1)

  • alphas (float, default: pyMelt.lithology_class.default_properties[‘alphas’]) – The thermal expansivity of the solid (1e-6 K-1)

  • alphaf (float, default: pyMelt.lithology_class.default_properties[‘alphaf’]) – The thermal expansivity of the melt (1e-6 K-1)

  • rhos (float, default: pyMelt.lithology_class.default_properties[‘rhos’]) – The density of the solid (kg m-3)

  • rhof (float, default: pyMelt.lithology_class.default_properties[‘rhof’]) – The density of the melt (kg m-3)

  • DeltaS (float, default: pyMelt.lithology_class.default_properties[‘DeltaS’]) – The entropy of fusion J K-1 kg-1

  • parameters (dict, default: parameters from Katz et al. (2003)) – The model parameters described above

F(P, T, **kwargs)[source]

Wrapper for the melt fraction functions. If T and P are below the solidus, returns 0, if they are above the liquidus, returns 1. If below the temperature of cpx-exhaustion, calls the Fcpx function, otherwise calls the Fopx function.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

Melt fraction.

Return type

float

TLiquidus(P, **kwargs)[source]

Returns the temperature of the liquidus at any given pressure. Eqn(10).

Parameters

P (float) – Pressure (GPa).

Returns

Liquidus temperature (degC).

Return type

float

TSolidus(P, **kwargs)[source]

Returns the temperature of the solidus at any given pressure. Eqn(4).

Parameters

P (float) – Pressure (GPa).

Returns

Solidus temperature (degC).

Return type

float

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P). First calculates the melt fraction. If F is zero, returns _np.inf. If F is 1, returns _np.inf. Otherwise uses the appropriate expressions for cpx present or absent melting.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

dT/dF(const. P) (K).

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F). First calculates F, then chooses the appropriate expression for cpx present or absent melting.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dP(const. F) (K GPa-1).

Return type

float

Pertermann and Hirschmann (2003, JGR)

The pertermann module implements the G2 model.

class pyMelt.lithologies.pertermann.g2(CP=1000.0, alphas=40.0, alphaf=68.0, rhos=3.3, rhof=2.9, DeltaS=300.0, parameters={'a': 0.7368, 'b': 0.2632, 'c': 1175.0, 'd': 114.0, 'e': 920.0, 'f': 130.0})[source]

Implementation of the Pertermann and Hirschmann (2003, JGR) G2 melting model. To use the same format of parameterisation for another lithology, the parameter values may be changed. They are provided as a dictionary during initialisation of the class, with values:

  • a: Parameter used in calculating melt fraction.

  • b: Parameter used in calculating melt fraction.

  • c: Parameter used in liquidus definition.

  • d: Parameter used in liquidus definition.

  • e: Parameter used in solidus definition.

  • f: Parameter used in solidus definition.

The thermal expansivities, the heat capacity, the densities, and the entropy of fusion may also be changed during class initialisation.

Parameters
  • CP (float, default: pyMelt.lithology_class.default_properties[‘CP’]) – The heat capacity (J K-1 kg-1)

  • alphas (float, default: pyMelt.lithology_class.default_properties[‘alphas’]) – The thermal expansivity of the solid (1e-6 K-1)

  • alphaf (float, default: pyMelt.lithology_class.default_properties[‘alphaf’]) – The thermal expansivity of the melt (1e-6 K-1)

  • rhos (float, default: pyMelt.lithology_class.default_properties[‘rhos’]) – The density of the solid (kg m-3)

  • rhof (float, default: pyMelt.lithology_class.default_properties[‘rhof’]) – The density of the melt (kg m-3)

  • DeltaS (float, default: pyMelt.lithology_class.default_properties[‘DeltaS’]) – The entropy of fusion J K-1 kg-1

  • parameters (dict, default: parameters from Pertermann and Hirschmann (2003, JGR)) – The model parameters described above

F(P, T, **kwargs)[source]
Calculates melt fraction at a given pressure and temperature using Equation 1:

a*T’**2 + b*T’,

where T is the normalised temperature (Equation 2):

(T-Tsolidus)/(Tliquidus-Tsolidus).

If P and T are below the the solidus, 0 is returned, if they are above the liquidus, 1 is returned.

Parameters
  • P (float) – Pressure (GPa)

  • T (float) – Temperature (degC)

Returns

Melt fraction.

Return type

float

TLiquidus(P, **kwargs)[source]
Calculates the liquidus temperature, at a given pressure, using Equation 3:

c + d*P.

Parameters

P (float) – Pressure (GPa).

Returns

Liquidus temperature (degC).

Return type

float

TSolidus(P, **kwargs)[source]
Calculates the solidus temperature, at a given pressure, using Equation 4:

e + f*P.

Parameters

P (float) – Pressure (GPa)

Returns

Solidus temperature (degC).

Return type

float

dTdF(P, T, **kwargs)[source]

Calculates dT/dF(const. P) at a given pressure and temperature.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dT/dF(const. P) (K)

Return type

float

dTdP(P, T, **kwargs)[source]

Calculates dT/dP(const. F) at a given pressure and temperature.

Parameters
  • P (float) – Pressure (GPa).

  • T (float) – Temperature (degC).

Returns

dTdP(const. F) (K GPa-1)

Return type

float