DIPRA: A user-friendly program to model multi-element diffusion in olivine with applications to timescales of magmatic processes



[1] Modeling the diffusion of elements in olivine from volcanic rocks has recently become one of the most useful techniques to determine the timescales of the processes that occur in magma reservoirs before eruptions. However, many potential users are not versed in the numerical methods needed to solve the diffusion equation for timescale determinations. Here we present DIPRA (Diffusion Process Analysis), a user-friendly computer tool that models easily and intuitively the olivine chemical zoning by performing an automatic, visual, and quick fit to the natural profiles. The code is developed under a finite difference scheme and allows simultaneous modeling of diffusion of Fe, Mg, Mn, Ni, and Ca. DIPRA accounts for most variables that affect the diffusivity, including temperature, pressure, oxygen fugacity, major element composition, and anisotropy. Initial and boundary conditions can be done as complex as desired, including changing boundary composition with time. Such versatility allows modeling the large variety of scenarios that are characteristic of volcanic systems. We also have implemented a methodology to estimate objectively the uncertainties of the timescales from the uncertainties of the data and temperature. We expect that our application will increase the number and quality of timescale determinations from crystal zoning studies. It may be also useful as a teaching resource for higher education courses.

1 Introduction

[2] One of the most innovative recent advances in volcanology and igneous petrology has been to be able to quantify the timescales and rates of magmatic processes [e.g., Turner and Costa, 2007]. A good knowledge of these timescales is generally important for understanding a wide range of phenomena, from the time of magma transport through the crust, to magma differentiation and mixing, to the processes that occur right before an eruption [e.g., Dosseto et al., 2010].

[3] These timescales have been traditionally obtained by using radiogenic techniques, and great advances have been made with precise measurements of short-lived isotopes of the so-called U-Th disequilibria series [e.g., Condomines et al., 2003; Cooper and Reid, 2008; Schmitt, 2011]. A complementary methodology is the modeling of concentration gradients in minerals [e.g., Costa et al., 2008; Costa and Morgan, 2010], which is based on chemical diffusion within the crystals. This approach is increasingly being used thanks to the larger number of precise determinations of diffusion coefficients [e.g., Zhang and Cherniak, 2010] and the possibility of determining chemical gradients very quickly and with a good spatial resolution using micro or nano beam analytical techniques [e.g., Sylvester, 2008; Fayek, 2009].

[4] Application of diffusion modeling in volcanic rocks is relatively straightforward because the diffusion clock is stopped at the time of eruption due to the fast cooling, in contrast to metamorphic rocks. Most determinations have been obtained using minor trace elements or isotope profiles in feldspar [Mg, Sr and isotopes, Ba; e.g., Zellmer et al., 1999; Costa et al., 2003, Costa et al., 2010; Morgan et al., 2006; Davidson et al., 2007; Druitt et al., 2012], olivine [Fe, Mg, Ni, Ca, Mn; e.g., Nakamura, 1995; Pan and Batiza, 2002; Costa and Chakraborty, 2004; Costa and Dungan, 2005; Holzapfel et al., 2007; Kahl et al., 2011], pyroxenes [Fe, Mg, Ca; e.g., Morgan et al., 2004, Morgan et al., 2006; Saunders et al., 2012], and quartz [Ti, Li; Wark et al., 2007; Charlier et al., 2012; Matthews et al., 2012].

[5] Despite the availability of diffusion data in minerals and the ease of measurements of chemical gradients, the number of studies that determine the timescales of magmatic processes by modeling the crystal composition is still limited. This is probably due in part to the lack of a user-friendly tool to solve the diffusion equation in natural crystals. In this contribution, we aim to alleviate this situation by providing a user-friendly program to model the chemical zoning in olivine. We choose this mineral because it is widespread in igneous rocks, its major and minor elements can be measured precisely and with a good spatial resolution using an electron microprobe, and the diffusion coefficients of several major and minor elements have been determined at the conditions of interest [e.g., review in Chakraborty, 2010]. Therefore, multiple time determinations can be obtained from a single traverse in a crystal thin section [e.g., Costa and Dungan, 2005], allowing for more robust results than approaches based on a single element.

[6] The code that we present (DIPRA - Diffusion Process Analysis-) allows modeling multi-element diffusion in olivine interactively, where the fits to the data, initial and boundary conditions, and other parameters can be visualized directly on the screen. As in any other program, the results are only meaningful if the premises of the modeling are based on good constraints of the magmatic system [Costa et al., 2008]. The program, a user guide, and some solved examples are provided as auxiliary material.1

2 Diffusion Model in Olivine Crystal

[7] The random motion of the molecules of a given component i in a mixture leads to a particle flux density Ji (m−2s−1) proportional to the gradient of concentration (First Ficks' Law; see Figure 1):

display math(1)

where θi is the number of particles per unit volume of the mixture (m−3); and Di is the diffusivity or the diffusion coefficient (m2s−1). The differential equation of matter conservation states that:

display math(2)

which asserts that the number of particles inside a control volume changes with time only accordingly to the diffusive flux. Complexities, such as mechanical mixing, crystal growth, or diffusive flux by pressure or temperature gradients, are not modeled here [e.g., Lasaga, 1998, and references therein for more complex cases]. The above equation can be expressed in other concentration units (as mole fraction χi) if we assume that the density distribution of the mixture does not change significantly with time during chemical mixing.

Figure 1.

Schematic illustration of a zoned olivine crystal surrounded by a melt (top panels) and typical zoning profiles (bottom). Lighter color means lower concentration of a given component, and darker color means higher concentrations. The red line is the track of concentrations measured by analytical apparatus. (a) Distribution of concentration before the diffusion begins at the initial conditions (t = 0); (b) zoning of the same crystal after diffusion in the crystal (t > 0). This figure shows only one possibility of initial and boundary conditions that may drive diffusion. See other figures for more examples.

[8] Here we aim to model the diffusion of Fe – Mg (as forsterite, Fo = Mg/(Mg + Fe), in mole fraction), Mn, Ni, and Ca in olivine because their concentrations can be easily measured with an electron microprobe, and their diffusivities have been determined in the laboratory [e.g., Petry et al., 2004; Coogan et al., 2005; Dohmen and Chakraborty, 2007a, 2007b; Dohmen et al., 2007]. The diffusivities of Mn and Ni depend on the concentration of Fo. The diffusivity of Ca probably is also dependent on Fo, but its dependence has not been yet characterized (Table 1). Therefore, equation (2) can be written as:

display math(3)

where we have considered a one-dimensional approach; i subscript stands for Fo, Mn, Ni, or Ca; and θFo is the concentration of Fo. Other elements for which their diffusivities have also been determined [e.g., review in Chakraborty, 2010] are Cr [Ito and Ganguly, 2006], Li [Dohmen et al.., 2010], and H [e.g., Demouchy and Mackwell, 2006], but they require much more sophisticated equipment to be measured (e.g., ion microprobe, laser ablation inductively coupled plasma–mass spectrometry, and Fourier transform infrared spectroscopy) and often have lower spatial resolution. Thus, they have not been considered here.

Table 1. Experimentally Determined Diffusion Coefficients Used in DIPRA
ElementsDiffusion Coefficientsa
  1. aDiffusion coefficients are given in m2s−1, where fO2 represents the oxygen fugacity in Pa and is calculated in DIPRA from the NNO buffer as reference; χFo is the mole fraction of Fo; p is the pressure in Pa; T is the temperature in absolute degrees, and R is the ideal gas constant also in SI units. For Fo, Mn, and Ni, the diffusion parallel to [001] is six times faster than parallel to [100] and [010] (D[100] ~ D[010]  ~ (1/6)D[001]). Ei  is the activation energy, and its value is for Fo: EFo = 201,000 J/mol; for Mn: EMn = 201,000 J/mol; for Ni: ENi = 220,000 J/mol; and for Ca: ECa,[100] = 193,000 J/mol, ECa,[010] = 201,000 J/mol, ECa,[001] = 207,000 J/mol. Note that the diffusivities of Mn and Ni depend on the Fo mole fraction [see Dohmen and Chakraborty, 2007a, 2007b; Chakraborty, 2010; Dohmen et al., 2007; Holzapfel et al., 2007].
Fe–Mg (Fo)inline image
Mninline image
Niinline image
Cainline image
inline image
inline image

[9] There is a strong anisotropy in the diffusion according to the crystalline structure of the olivine that has also been experimentally investigated [e.g., Dohmen and Chakraborty, 2007a, Dohmen and Chakraborty, 2007b, Dohmen et al., 2007]. Thus, Di along the direction of the electron microprobe traverse depends on its orientation respect to the crystallographic axes of olivine and can be calculated from [e.g., Costa and Chakraborty, 2004]:

display math(4)

being Di,[1 0 0] the diffusivity of the component i parallel to the crystallographic axis [100] of olivine, and analogously for Di, [0 1 0] and Di,[0 0 1]. α, β, and γ are the angles between the direction of the track of the electron microprobe and the axes [100], [010], and [001], respectively. First, the orientation of the crystallographic axes has to be determined, which can be readily done in situ with electron backscattered diffraction [e.g., Prior et al., 1999]. Then, α, β, and γ can be obtained by means of a stereographic projection. If the crystal orientation cannot be quantitatively determined, it might be possible to make an approximation by using the crystal morphology and optical properties.

3 Method of Solution

3.1 Discretization

[10] A numerical method is needed to solve equation (3) for a general case. Here we use finite differences explicit in time because it is computationally fast for our purposes, and implicit approaches are rather more complicated when the diffusivity is not constant. We use the scheme of forward difference in time and second-order accurate central difference for the space derivative [e.g., Press et al., 2007]. The discretized diffusion equation once written in one forward time step is (see auxiliary material for details):

math image(5)

whereas above i represents Fo, Mn, Ni, or Ca; k and j refer to the spatial and time steps indexes, respectively; Δx is the size of the one-dimensional cell; and Δt is the size of the time step. In the above equation, we have already considered that the diffusivities in DIPRA are programmed as functions of the concentration of Fo in units of mole fraction (χFo). On the contrary, concentration of Mn, Ni, and Ca can be given according to the user choice (Ci). The diffusivity inline image and its derivative inline image are evaluated in inline image without being discretized by using the empirical relationships of Table 1.

[11] The handicap of using an explicit method is that the numerical scheme is not stable for every combination of Δt and Δx. However, the time and spatial steps can be selected by the user to reach a compromise between runtime and compliance of the stability condition:

display math(6)

3.2 Initial and Boundary Conditions

[12] The diffusion equation can be solved as an initial-value problem: moving forward in time given initial and boundary concentrations. This is the approach commonly used to model diffusion in volcanic crystals. Initial conditions are typically associated with the maximum concentration measured in the olivine crystal or in the largest crystals, and boundary conditions are usually fixed by the concentrations measured at the crystal rim, which is thought to be in equilibrium with the liquid or the environment where the crystal resides [Costa et al., 2008].

[13] Both nonuniform initial conditions Ci (x, t = 0) and constant or time-dependent boundary conditions [Ci (x = 0, t), Ci (x = xmax,t)] may be directly chosen by using the DIPRA interface. A typical case thought to be a good approximation to many real situations consists in considering that at t = 0 the concentration is distributed as a series of steps or plateaus of different concentrations. For an arbitrary number of plateaus M (see Figure 2 for details):

display math(7)

where s(φ) is the step function:

display math(8)

az is the concentration of the plateau z, while xz marks the position that separates the plateau z from the plateau z + 1. In DIPRA, the user only has to supply the values az, xz in a text file, and the program can read it. Time-dependent boundary conditions can be also modeled by using a sequence of time steps (Figure 2b). Other types of initial and boundary conditions, such as those applicable for equilibrium or fractional crystallization [e.g., Costa et al., 2008], can also be incorporated by typing in the appropriated equation that better describes the zoning (e.g., a polynomial of concentration and distance).

Figure 2.

Examples of how to describe complex initial and boundary conditions. (a) Step initial conditions. az is the concentration of the plateau z, and xz is the position which separates the plateau z from the plateau z + 1; (b) time-dependent boundary conditions can also be modeled as a sequence of time steps. bz is the concentration of the plateau z, and tz is the time which separates the plateau z from the plateau z + 1. P1–P6 is the number of plateaus in the sequence of steps.

3.3 Best Fit to the Natural Data

[14] Natural chemical profiles are plotted as curves of concentration against position. By comparing natural with theoretical curves, we can determine the times of diffusion and from there obtain the timescale of the processes that we think created the zoning. Previously, best fits have been done visually, but DIPRA selects automatically the model with minimum root mean square (rms) within a range of times chosen by the user:

display math(9)

being N the total number of data; inline image is the experimental concentration of the component i measured at the position p; and inline image is the theoretical concentration of the component i computed at the position p and time jΔt. inline image is calculated from a simple interpolation between inline image and inline image and it is met that kΔx < p < (k + 1)Δx. This interpolation process is necessary because in general the position where the concentration is measured in the natural crystal does not correspond to those of the model. The program automatically chooses the curve with the value of j which minimizes equation (9).

3.4 Uncertainties in the Diffusion Times

[15] Another difficulty that potential users find is to assign an uncertainty to the diffusion time that best fit the natural data. We have implemented in DIPRA a new error analysis of the best time that includes those uncertainties related to the concentration and temperature [Costa et al., 2008]. Errors associated to the cell size and to the interpolation cited above are not considered, but the results will be more accurate for finer meshes as in any other numerical scheme and can be easily minimized as to be negligible. As a measure of the goodness of the best fit, we use the ratio between the number of theoretical concentrations inline image which are not inside the error bars of the data inline image and the total number of data (N). We call discrepancy to this ratio, which should be zero in an ideal case for appropriate boundary and initial conditions. The error bar size is chosen by the user according to the natural data noise and analytical uncertainty (see Figure 3). In summary, DIPRA calculates automatically the following uncertainty for the diffusion time (see auxiliary material for details):

display math(10)

where n and m are the number of theoretical curves with lower and larger diffusion time than the best fit for which the discrepancy is the same as in the best fit (see Figure 3 for details). The second term comes from considering that time and diffusion coefficient scale as t ∝ 1/D while D ∝ exp(−τi/T). τi depends on the component i and includes the exponential term of the diffusion coefficient (e.g., activation energy, pressure, and gas constant) except for temperature (see Table 1 for details). σ(T) is the uncertainty of the temperature, which can reach values up to ±50°C depending on the geothermometers [e.g., Putirka, 2008]. The error of the diffusion time is higher for larger times and lower for higher temperatures. It is not symmetrical in general. The second term of equation (10) becomes dominant for larger uncertainties in the temperature and lower uncertainties in the concentrations measured in the laboratory.

Figure 3.

Illustration of how DIPRA calculates the first term of the error in equation (10) and the discrepancy of the model. DIPRA determines the best fit by selecting the curve with the smallest rms (green curve). It also calculates the number of theoretical concentrations (inline image; green dots) which are not inside the error bars (red bars) of the data (inline image; red dots). We call discrepancy of the model to the ratio between this number and the total number of measured data (for the ideal case of the illustration: discrepancy = 0/16 = 0). The program calculates the number of curves above (m) and below (n) the best fit that have the same discrepancy as the best fit (and for the same initial and boundary conditions). In this example, m = n = 2. Therefore, the diffusion time ranges between [t − (m + 1)Δt] and [t + (n + 1)Δt] if we do not consider uncertainty in the temperature. The term +1 is added to ensure that all the possible models with the same discrepancy than the best fit are included.

4 Some Examples

[16] One of the strengths of DIPRA is that it can fit Fe – Mg, Mn, Ni, and Ca concentrations by displaying the best fit on the screen (Figure 4). Users can interact with the program by uploading new natural data, by adjusting an uncertainty to the concentrations according to the instrumentation or data noise, and by examining the effect of the different parameters of the physical model. The program calculates a matrix of concentrations for all the different times and positions, and the user can visualize an animation with the different profiles with which the code seeks the best fit to the natural data. The final settings, results, and graphs can be saved after modeling for a further treatment. We show below two illustrative simulations computed with DIPRA for different zoning patterns, two components (Fo and Mn), and different initial and boundary conditions. The examples are also representative of natural zoning profiles in olivine of mafic volcanic rocks.

Figure 4.

The graphic interface of DIPRA consists of plots of the natural data, initial conditions, range of curves between which the program looks for the best fit, and best fit. Initial and boundary conditions, thermodynamic variables, uncertainty of the concentrations, and numerical parameters, can be directly entered on the screen (see Supporting Information for instructions of use).

4.1 Simple Initial and Boundary Conditions

[17] We model a crystal with normal zoning (decreasing concentration from core to rim) as being initially homogeneous (Figure 5 and 6). Diffusion is driven by a different concentration at the boundary as if the crystal is immersed in a melt in equilibrium with a lower Fo and Mn content. This could be the case of a simple olivine xenocryst immersed in a more evolved melt from which it grew. We assume a time-invariant concentration at the boundary, as if the melt composition had not changed with time. This is representative of a much larger volume of liquid with regards to the crystal. Other initial conditions are possible to reproduce the profile, and the interested reader can see Costa et al. [2008] or Costa and Morgan [2010] for a discussion of how to infer the most appropriated initial and boundary conditions. Table 2 reports the conditions and results from modeling the Fo and Mn concentrations. We choose T = 1125°C with uncertainty of 10°C, P = 101,325 Pa, fO2 = 3.4 ⋅ 10−4 Pa (NNO buffer), a cell size of ∆x = 6 µm, a time step of ∆t = 30,000 s, and assume that the electron microprobe traverse is parallel to [001]. The computed diffusion time is between 1320 and 1750 days for Fo, and between 1610 and 2300 days for Mn. The time obtained from the two elements overlaps, which suggest that the models are realistic. Figures 5 and 6 are an output from DIPRA including the natural data, initial conditions, the minimum and maximum time among which the code seeks the best fit, and the best curve together with the natural data.

Figure 5.

Diffusion model of Fo (C = concentration in mole fraction) computed with DIPRA. (a) Natural data; (b) Natural data (black) together with the initial condition (purple); (c) Natural data with error bars and calculated diffusion curves for t = 0.3 days (blue) and t = 4.5 days (green); (d) Best fit to Fo natural data is shown in red.

Table 2. Results and Key Parameters Used to Model the Diffusion Profiles Shown in Figures 5 and 6
Uncertainty in concentration0.0050.022
Initial conditions0.8150.197
Boundary conditions (xmin)0.7140.079
Boundary conditions (xmax)0.8150.199
Diffusion time (days)15401940
Uncertainty time (− days)220330
Uncertainty time (+ days)210360
Discrepancy (%)00
Figure 6.

Diffusion model of Mn (C = concentration in wt %) for the same traverse as for the Fo content shown in Figure 5. (a) Natural data in wt%; (b) Natural data (black) together with the initial condition (purple); (c) Natural data with error bars, and theoretical curves for t = 0.3 days (blue) and t = 4.5 days (green). Note that the error bars for Mn are larger than for Fo, which leads to a larger uncertainty on the diffusion time (see Table 2); (d) Best fit to Mn natural data is shown in red.

4.2 Nonhomogeneous Initial Conditions and Time-Dependent Boundaries

[18] Another common type of compositional zoning in olivine is multiple zones with normal and reverse trends, as can be induced by multiple magma mixing events [e.g., Kahl et al., 2011; Figure 7]. Such zoning can be modeled by considering nonhomogeneous initial conditions and time-dependent concentrations at the boundaries. Here we have done a model where first we fit the inner part of the zoning and the condition at the boundary stays the same as the initial, and then the boundary changes to the measured rim composition in order to fit the full profile. The exact time at which the condition is changed is done by a trial and error iterative process by the user. We consider T = 1125°C with uncertainty of 10°C, P = 101,325 Pa, fO2 = 3.4 ⋅ 10−4 Pa, cell size of Δx = 2 µm, a time step of Δt = 7000 s, and we assume diffusion parallel to the [001] crystallographic axis as above. Initial conditions, boundary conditions, and final results are shown in Table 3. Figure 8 shows the matrix of solutions in the whole grid (also an output from DIPRA) where it can be clearly seen the time-dependent boundary conditions.

Figure 7.

Diffusion model for Fo (C = concentration in mole fraction) with step initial conditions and time step boundary conditions. As for Figures 5 and 6: (a) Natural data; (b) Natural data (black) with details on how to set up the initial conditions (purple; –Table 3–); (c) Natural data with error bars (± 0.003), and theoretical curves for t = 0.08 days (blue) and t = 405 days (green); (d) Best fit to Fo natural data is shown in red.

Table 3. Results and Key Parameters Used to Model the Diffusion Profile Shown in Figure 7
Uncertainty of Concentration0.003
Initial conditions a10.848
Initial conditions a20.840
Initial conditions a30.850
Initial conditions x1 (µm)145
Initial conditions x2 (µm)345
Boundary conditions -xmin- b10.848
Boundary conditions -xmin- b20.830
Boundary conditions -xmin- t1 (s)10,000,000
Boundary conditions -xmax- b10.850
Boundary conditions -xmax- b20.803
Boundary conditions -xmax- t1 (s)10,000,000
Diffusion time (days)124
Uncertainty time (− days)16
Uncertainty time (+ days)18
Discrepancy (%)1
Figure 8.

(a) Map of solutions (a) for the diffusion of Fo (C = concentration in mole fraction). (b) Details of the parameters we have used in the boundary conditions. The initial conditions are shown in Figure 7b.

5 Summary

[19] The program with a graphic interface that we have built allows modeling diffusion of multiple elements in olivine (Fe, Mg, Ca, Ni, and Mn) using any choice of initial and boundary conditions, and incorporates the main thermodynamic parameters that control diffusion. The program does an automatic fit and provides the error associated, but the user can visually control the result and interact with the program by changing the different variables directly on the screen. Given the ease and quality of the major and minor element concentration profiles in olivine that can be obtained with an electron microprobe, we think that the program can be used to generate many models of multiple elements, which should increase the number of timescale determinations of magmatic processes. The ease of use of DIPRA makes it a potentially useful tool for teaching petrology, kinetics of chemical reequilibration, and timescales of magmatic processes in higher education courses.


[20] F. Costa acknowledges many discussions about diffusion modeling in olivine with S. Chakraborty, R. Dohmen, and D. Morgan. Reviews of M. Streck and anonymous helped to improve the manuscript. Thanks to C. Bouvet de Maisonneuve for testing of the code and suggestions. This work was started thanks to a fellowship of Introduction to Research (2008) granted to Társilo Girona by Consejo Superior de Investigaciones Científicas, included into the JAE INTRO program. Support from A*STAR and EOS-NTU (Magma Plumbing system project) is also acknowledged.

  1. 1

    Software and Supporting Information can be downloaded from www.tgirona.com and www.earthobservatory.sg.