Overview: Why Pyrrhenius?
Pyrrhenius provides a powerful, flexible, and intuitive framework for working with mineral electrical conductivity models and data in Python. It introduces a modular, object-oriented approach that allows scientists to efficiently compute conductivities while seamlessly keeping track of metadata about mineral experimental conditions and model parameters.
Motivation
Over the past two decades, electromagnetic geophysical techniques have greatly improved in resolution and spatial extent. At the same time, mineral physicists have produced hundreds of models relating the physiochemical state of common minerals to their electrical conductivity.
Pyrrhenius was designed to provide a means to tractably merge geophysical modeling with laboratory observations, allowing geoscientists to flexibly use, compare, validate, and extend what is currently a heterogeneous corpus of mineral physics research. By abstracting away the implementation details and unit conversions, Pyrrhenius enables researchers to focus on science.
The choice of Python and integration with the scientific Python ecosystem makes Pyrrhenius accessible to a wide audience and interoperable with existing electromagnetic geophysics libraries like MtPy and SimPEG. The open-source, object-oriented design also facilitates community contributions to expand the database and functionality over time.
The Arrhenius Equation
The Arrhenius equation (1) is a fundamental formula in chemistry that describes the temperature dependence of reaction rates \((K)\) based on an activation energy \(\Delta H\). As it turns out, the movement of electrons is a type of reaction, and thus can be described in a similar manner
Where:
Symbol |
Description |
Units |
|---|---|---|
\(\sigma\) |
Electric Conductivity |
Siements per meter (S/m) |
\(\sigma_0\) |
The Preexponental Factor |
Siements per meter (S/m) |
\(\Delta H\) |
The Reaction Enthalpy |
Electron-Volts (eV) |
\(k_b\) |
Boltzmann’s Constant |
Electron-Volts per Kelvin (eV/K) |
\(T\) |
Absolute Temperature |
Kelvin (K) |
An alternate formulation of the Arrhenius equation uses the gas constant \(R\) instead of \(k_b\). This substitution results in a unit change for \(\Delta H\), but otherwise the relationship is the same.
An Arrhenian Catastrophe
The values of both \(\Delta H\) and \(\sigma_0\) may themselves be dependent on \(\mathbf{PX}\) Physiochemical state (redox state, electron carrier density, pressure, and other thermodynamic parameters), such that it is more appropriate to rewrite (2) as
Within a single geologic material multiple reactions may result in the movement of electrons. The linear combination of several of these mechanisms is then needed to describe the mineral’s total conductivity
While an arrhenius equation can be used to describe the conductivity of materials, there are numerous complexities arising from observed depenence on \(\mathbf{PX}\). This presents several design challenges, as there is a large hereogeneity in both the published parameter values and mathematical form of arrhenian-type equations. Lets look at a few type examples of these where numerical constants have been replaced with subscripted \(\alpha_i\)’s. Also,the following symbols are used:
\(X_{fe}\) for Iron Fraction
\(C_w\) for Water Content
\(P\) for Pressure
Omphacite
Liu et al., (2021) “Electrical conductivity of omphacite and garnet indicates limited deep water recycling by crust subduction”.10.1016/j.epsl.2021.116784
Orthopyroxene
Zhang & Yoshino (2016) “Effect of temperature, pressure and iron content on the electrical conductivity of orthopyroxene”. 10.1007/s00410-016-1315-z
Silicate Melt
Pommier & Le-Trong (2011). “SIGMELTS: A web portal for electrical conductivity calculations in geosciences”. 10.1016/j.cageo.2011.01.002
It should be evident that suggested parameterizations may take a wide variety of functional forms. The upside of such parameterizations is that the sensitivity of electric conductivity to mineral-relevant factors can be modeled. The downside is that it becomes hard to create a non hard coded database of parameterizations.
One way to simplify the matter is to encapsulate all Enthalpy and preexponential-like constants into a object oriented hierarchy. Lets apply this concept to the previous equations and see what happens. Each bolded constant is assumed to depend on Physiochemical states. Their subscripts indicate a unique category of meta-parameter
Omphacite
Orthopyroxene
Silicate Melt
So as long as each meta preexponential constand and enthalpy is handled appropriately, even complicated mineral laws can be represented by a simplified arrhenian equation.
We can do one better though. Each arrhenian-type equation can be substituted by an Arrhenian object:
Omphacite
Orthopyroxene
Silicate Melt
Use of the arrhenian object seems to simplify the relationships to either linear superpositions of equations, or single equation objects, provided the input parameters are implemented correctly. Thus we can see that by adopting an object oriented approach, representing a heterogeneous inventory of possible conductivity parameterizations can be simplified.
Simplifying Design with Objects
Object-oriented programming (OOP) is a programming paradigm that organizes software design around data, or objects, rather than functions and logic. The main principles of OOP include encapsulation (aggregating behaviors in isolation), abstraction (providing high-level interfaces to more complex operations), inheritance (providing variants of objects with small changes in behavior), and polymorphism (enforcement of a single outward-facing structure to several heterogeneous internal ones). Use of OOP can allow for simplified, maintainable, extensible, and debuggable code.
Pyrrhenius utilizes OOP design across four levels of abstraction:
Level 1 Empirically-fitted constants (
pyrrhenius.mechanisms.StochasticConstants) are objects, allowing for both mean value sampling and random sampling via bootstraping using a single keyword-argument.Level 2 Variants of the Arrhenius equation (
pyrrhenius.mechanisms.Mechanismand children) are coded in an inheritance heirarchy, usingpyrrhenius.mechanisms.StochasticConstantsto calculate arrhenian equation parameters. Most child class differences revolve around providing a more complex enthalpy or preexponential constant.Level 3 Mineral physics models are represented by
pyrrhenius.model.Modelobjects, which contain a singlepyrrhenius.mechanisms.Mechanismor otherpyrrhenius.model.Modelobjects.pyrrhenius.model.Model’s also use a metadata property objectpyrrhenius.model.PublicationMetadata, taking care of metadata management so you don’t have to.Level 4 A database object
pyrrhenius.database.Databasewhich provides a flexible interface to access specificpyrrhenius.model.Model’s reported by the literature.
Because each level of abstraction utilizes a near-identical interface, more complicated mineral models involving compound mechanisms or models are easily created using the + operator. These unified interfaces also allow for easy application of mineral mixing models. Thus, adapting pyrrhenius to your needs is usually easy to express in-code and does not require modifications to the codebase.
Key Features
Pyrrhenius offers several key features that enable expressive and efficient computations of mineral electric conductivity:
A curated collection of over 100 models spanning a wide range of minerals and conditions
An extensible spreadsheet-based database framework for accessing models and associated metadata, so substituting your own work-groups database is as easy as providing an alternate
.csvfile.Calculate electric conductivity across any mechanism combinations of mechanisms, model or combinations of models using the
get_conductivity(*args,**kwargs)method.Linearly combine metadata, mechanisms, and models using the
+operatorStochastic sample model parameters by using the optional keyword-argument
sample=TrueEasily apply Cubes, Tubes, hashinStrikman, Effective Medium Theory, and Archie’s Law phase mixing Variants
Access human readable metadata via the
.metadataproperty of all objectsIntegration with the broader scientific Python ecosystem including NumPy, SciPy, and Pandas
With Pyrrhenius, you can go from a scattered collection of published conductivity models to science-driven insights in just a few lines of code The immediate payoff of using Pyrrhenius is that you’ll write less code while worrying less about errors. The long-term payoff is that you’ll be able to entertain more advanced geophysical analyses while easily recognizing what you did weeks to months ago.