Multiphase Porous Electrode Theory

Porous electrode theory, pioneered by John Newman and collaborators, provides a useful macroscopic description of battery cycling behavior, rooted in microscopic physical models rather than empirical circuit approximations. The theory relies on a separation of length scales to describe transport in the electrode coupled to intercalation within small active material particles. Typically, the active materials are described as solid solution particles with transport and surface reactions driven by concentration fields, and the thermodynamics are incorporated through fitting of the open circuit potential. This approach has fundamental limitations, however, and does not apply to phase-separating materials, for which the voltage is an emergent property of inhomogeneous concentration profiles, even in equilibrium. Here, we present a general theoretical framework for"multiphase porous electrode theory"implemented in an open-source software package called"MPET", based on electrochemical nonequilibrium thermodynamics. Cahn-Hilliard-type phase field models are used to describe the solid active materials with suitably generalized models of interfacial reaction kinetics. Classical concentrated solution theory is implemented for the electrolyte phase, and Newman's porous electrode theory is recovered in the limit of solid-solution active materials with Butler-Volmer kinetics. More general, quantum-mechanical models of Faradaic reactions are also included, such as Marcus-Hush-Chidsey kinetics for electron transfer at metal electrodes, extended for concentrated solutions. The full equations and numerical algorithms are described, and a variety of example calculations are presented to illustrate the novel features of the software compared to existing battery models.


I. INTRODUCTION
Lithium-based batteries have growing importance in global society [1] as a result of increased prevalence of portable electronic devices [2], and their enabling role in the transition toward renewable energy sources [3]. For example, lithium batteries can help mitigate intermittency of renewable energy sources such as solar power, and lithium battery powered electric vehicles are facilitating movement away from liquid fossil fuels for transportation. Each of these growing areas demands high performance batteries, with requirements specific to the particular needs of the application driving specialized battery design for sub-markets. Thus, it is critical that battery models be based on the underlying physics, enabling them to greatly facilitate cell design to take best advantage of the existing battery technologies.
Lithium-ion batteries are generally constructed using two porous electrodes and a porous separator between them. The porous electrodes consist of various interpenetrating phases including electrolyte, active material, binder, and conductive additive. A schematic is shown in Figure 1. In a charged state, most of the lithium in the cell is contained in the active material within the negative electrode. During discharge, the lithium undergoes transport to the surface of the active material, electrochemical reaction to move from the active material to the electrolyte, transport through the electrolyte to the positive electrode, and reaction and transport to move into the active material of the positive electrode [4,5]. Physical models must capture each of these behaviors accurately. Complicating the situation further, the microstructure of the interpenetrating porous media within the electrodes can have a strong effect on the cell behavior [6] as a result of inhomogeneities over a length scale smaller than the electrode but many times the size of a primary active particle [7][8][9][10][11]. The active materials themselves also often have highly non-trivial behavior including poor connectivity with each other and the conductive matrix [12][13][14][15] as well as complex material properties leading to deformations and accompanying stresses [16][17][18][19][20][21][22][23][24][25][26][27] and phase separation [28][29][30][31][32][33][34][35] during the intercalation process. Coupling these behaviors in multi-particle electrode environments leads to further complexities [17,[36][37][38][39][40][41][42][43][44][45][46].
Because capturing all the relevant physical processes from the atomistic length scale to the cell pack level within a single simulation is computationally intractable, various approaches have been developed to simulate aspects of battery behavior [47,48]. In particular, porous electrode theory, pioneered by John Newman and co-workers over the past fifty years, has proven highly successful in describing the practical scale of individual cells [17,[49][50][51][52][53][54][55][56][57][58][59][60][61][62][63][64][65]. This approach is based on volume averaging over a region of the porous electrode large enough to treat it as overlapping, homogeneous, continuous phases to describe the behavior of the electrons in the conductive matrix and the ions in the electrolyte. The behavior of the active material is treated by defining representative particles and placing them within the simulation domain as volumetric source/sink terms for ions and electrons according to the actual volume fraction of active material in the electrode. In this way, details on the length scale of transport within small active material particles can be consistently coupled to volume averaged transport over much larger length scales. Ref. [66] provides an excellent overview of the fundamentals of the theory.
As a result of volume averaging, heterogeneities over intermediate length scales are lost, causing inaccuracies in predictions. Efforts to capture these heterogeneities in simulations have had success in characterizing the consequences of the volume averaging procedure and providing more accurate alternatives, including refinements to microstructural parameters such as tortuosity in the volume averaged approach [7,10,[67][68][69]. Nevertheless, simulations including complete microstructure information are much more computationally expensive than volume averaged approaches, so over the larger, electrode length scales. Thus, the model can be broken down into a number of scales. For the overall cell, we specify either the cell current density or voltage input profiles along with any series resistance. The unspecified current or voltage is an output of the simulation. At the electrode scale, we solve electrolyte transport equations, potential losses in the electron-conducting matrix, and potential drop between particles. At the particle scale, we simulate how they react with the electrolyte and the internal concentration dynamics. We will assume uniform (though not necessarily constant) temperature in the model derivation. The software currently only supports uniform and constant room temperature simulations, but we retain temperature factors here for generality. We will use the convention in referring to electrodes that the electrode which is negative/positive at open circuit and charged conditions is referred to as the anode/cathode.

Electrolyte Model
The general form of the electrolyte model equations arises from statements of conservation of species and conservation of charge within the electrolyte phase of a quasi-neutral porous medium [50,57]. We consider electrolytes of salts defined by i ν i M zi i , with species M i having valence z i , and ν i the number of ions M i in solution from dissolving one molecule of the neutral salt. For example, for CuCl 2 , ν + = 1, M + = Cu, z + = 2, ν − = 2, M − = Cl, and z − = −1.
With electrolyte species flux, F ,i defined per area of porous medium, conservation of species requires where c ,i is the concentration of species i in the electrolyte, is the electrolyte volume fraction (porosity), and R V,i describes a volume-averaged reaction rate which is the result of interfacial electrochemical reactions with the active materials in which ions are added to or removed from the electrolyte. In general, electrolyte transport models for porous media, the macroscopic charge density may be nonzero and varies in response to current imbalances. Diffuse electrolyte charge screens internal charged surfaces of porous membrane materials [99][100][101][102] or conducting porous electrodes [103,104] and provides additional pathways for ion transport by electromigration ("surface conduction") and electro-osmotic flows. In addition to Faradaic reactions, porous electrodes can also undergo capacitive charging by purely electrostatic forces, as in electric double layer capacitors and capacitive deionization systems [103], or hybrid pseudo-capacitors [105]. In batteries, however, such effects are usually neglected [5,49,106], since the focus is on electrochemical, rather than electrostatic, energy storage, using highly concentrated electrolytes.
In these electrolyte models, we will assume they satisfy quasi-neutrality, i.e. there is no net charge in the electrolyte over the simulated length scales [107]. Charge conservation and quasi-neutrality together require where e is the elementary charge, the charge density ρ e = i z i ec ,i , and i is the current density in the electrolyte, related to a sum of ionic fluxes, We will relate fluxes to both concentrations and electrostatic potentials in the electrolyte, so with constitutive flux relationships, Eqs. 1 and 2 fully specify the system for both the set of concentrations and the electrostatic potential field. However, it is convenient to use quasi-neutrality to eliminate one of the species conservation equations using (with arbitrary n) which allows us to neglect Eq. 1 for one species and post-calculate the missing concentration profile. For example, for the case of a binary electrolyte of cations, +, and anions, −, we define the neutral salt concentration, c = and instead simulate one of and In the case of Li-ion batteries for which we will assume a binary electrolyte in which only the Li + ions react, R V,− = 0, so it is particularly convenient to simulate the anion species conservation equation. The boundary conditions for a porous electrode simulation relate the fluxes of the simulated species and current at the anode and cathode current collectors and depend on the simulation. At the current collectors of porous electrodes, n · F ,i = 0 and n · i = 0. However, if a foil (e.g. Li metal electrode) is used for one electrode, the boundary condition at that side is replaced by n · i = i cell , where i cell is the macroscopic current density of the cell, Eq. 60. The species flux boundary conditions depend on which species is being eliminated in the set of species conservation equations, but for the case of anion conservation in a Li-ion battery, n · F ,− = 0 at all current collectors (neglecting side reactions).
The transport in the electrolyte can be simulated using either simple dilute Nernst-Planck equations or a concentrated solution model based on Stefan-Maxwell coupled fluxes. In both cases, we will neglect convection and assume binary electrolytes. Both formulations relate a species flux, F ,i to gradients in electrochemical potentials, µ ,i . The electrochemical potential of a given ion generally has both chemical and electrostatic contributions, and these can be separated a number of ways. For example, it can be separated using an "inner" or Galvani potential [5,108], where k B is the Boltzmann constant, T is the absolute temperature, a ,i is the activity of species i, µ Θ ,i is its reference chemical potential, and φ is the (Galvani) electrostatic potential. The final expression serves as the definition of the excess chemical potential, µ ex ,i , and c ,i is the concentration, c ,i , scaled to some suitable reference. The excess chemical potential contains all of the entropic and enthalpic contributions to the free energy of a concentrated solution beyond that of a dilute solution of a neutral species, such as short-ranged forces, long-ranged electrostatics, and excluded volume effects for finite sized ions [109,110].
An alternative approach common in battery modeling [51,58,106] for separating these contributions is to define the electrostatic potential in the electrolyte as that measured with a suitable reference electrode at a position of interest in the electrolyte with respect to another reference at a fixed position in the solution. This has the advantage, unlike Eq. 7, of being defined entirely by measurable quantities, unlike the activities of individual ions in solution. For example, in a lithium ion battery, this is typically done with a Li/Li + reference electrode. We will refer to this potential as φ r , and we note that it is actually measuring (a combination of) full electrochemical potentials of ions in solution. For the Li/Li + example, Quasi-electrostatic potentials, φ q , can also be used in electrolyte models [5], and they are defined by the excess chemical potential of a particular ion in solution, n, where γ ,i = a ,i c ,i is the activity coefficient of species i. We also note here that the electric potential field is determined in electrolytes either (1) by an assumption of quasineutrality, i.e. i z i c ,i = 0 everywhere, or (2) by solving the Poisson equation, ∇ · (ε∇φ ) = −ρ e with permittivity ε, which could depend on concentration or electric field [109], or capture non-local ion-ion correlations as a differential operator [111]. Throughout this work, we assume quasi-neutrality but make a few comments about the alternative here. Use of the Poisson equation enables physical boundary conditions on the electric potential such as specified surface charge densities at interfaces, and the resulting electric potential is the potential of mean force acting on a test charge in the solution. It captures double-layers of diffuse charge with thickness characterized by the Debye length at interfaces, outside of which the net charge approaches zero. The assumption of quasi-neutrality leads to a different potential field which cannot capture the effects of electric double layers at interfaces. Of note, the form of the chemical potential which can most easily accommodate models with both the quasi-neutral and the Poisson equations is the Galvani potential. Of course, this can lead to further confusion because the potential field obtained by assuming quasi-neutrality need not satisfy the Poisson equation with zero charge density and generally will not; rather, quasi-neutrality in this case is the result of the "outer" solution to a singular perturbation in which the Debye length approaches zero. Thus, we could further distinguish between Galvani potentials obtained via each of those methods, but refrain from complicating the notation here, as the quasi-neutral Galvani potential closely resembles the Poisson-satisfying Galvani potential in the large majority of systems with dimensions much larger than the Debye length.
a. (Semi-)Dilute Electrolyte In the simpler model, we neglect couplings between species fluxes, such that the flux of a given ionic species is a function only of gradients in its own electrochemical potential, where M ,i is the species' mobility. Using the Galvani potential form in Eq. 7, where we have used the Einstein relation between the diffusivity in free solution, D ,i and mobility, D ,i = M ,i k B T , non-dimensionalized the potential by the thermal voltage at some reference temperature, φ = eφ kBT ref , and defined a non and uniform temperature, In a porous medium we use effective transport properties, which are adjusted by the tortuosity of the electrolyte phase, τ . In addition we define the flux per area of porous medium rather than per area of electrolyte requiring a prefactor of the porosity of the electrolyte phase, .
The tortuosity is often described as a function of the porosity, the volume fraction of the electrolyte phase, , commonly by employing the Bruggeman relation τ = a [112]. The value of a is often set to −0.5 but can be adjusted [113] to account for experimentally [10,[114][115][116][117] or theoretically [118][119][120] observed departures from the original derivation. Eq. 13 with Eqs. 3, 5 and 6 define the (semi-)dilute electrolyte model. Although the electrolyte transport model developed in the following section is more reasonable for battery models, we present and retain the (semi-)dilute model here for a number of reasons. Retaining it facilitates comparisons between the models, and the dilute model is easier to extend for electrolytes with more components, even if doing so loses the information related to the extra transport parameters associated with Stefan-Maxwell transport theories. In addition, as mentioned above, it is straightforward to connect the Galvani potential used here to extensions using the Poisson equation to investigate behaviors at interfaces. b. Stefan-Maxwell Concentrated Electrolyte The formulation above assumes that gradients in the electrochemical potential of species i lead to fluxes only of species i. However, the framework can be generalized by assuming that fluxes of a given species are related to gradients in electrochemical potentials of each species in the system, where U ij are the direct (i = j) and indirect (i = j) transport coefficients [121]. This formulation has been used to describe relatively concentrated electrolytes and is the most commonly used model in battery simulation [5,106].
Noting that not all electrochemical potentials are independent (from the Gibbs-Duhem relationship), the above can be reorganized to the more commonly written form in terms of species velocities, v i = F ,i /c ,i , [5] with c T = i c ,i and K ij = K ji . For a binary electrolyte in a porous medium with cations, anions, and solvent (denoted as species 0), assuming uniform temperature and that the solvent concentration varies only negligibly with salt concentration, and again neglecting convection, where, defining γ ν ,± = γ The current density is given by The values of s i are specified by the choice for the reference electrode with reaction For lithium-ion batteries, the typical choice for the reference electrode defining φ r is Li/Li + , so s + = −1, and s − = s 0 = 0. Thus, Eqs. 17 and 21 with Eqs. 5 and 6 define the electrolyte model when using the Stefan-Maxwell concentrated solution theory with a binary electrolyte.

Solid phase electronic model
The solid phase of a porous electrode is composed of several length scales and percolating phases. The active material stores the reduced species (e.g. lithium), conductive additive improves electronic wiring, and binder is added to keep all the components connected. Lithium transport occurs within individual particles, and electrons must reach the surface of those particles via traveling over the length of the electrode. These equations approximately capture the variation in electric potential in the matrix of conductive material, which may be assumed to be identical to that of (well connected) active material. Otherwise, additional relations can be added to describe losses between the conductive matrix and the active materials. Over the length scale of the electrode, we describe conservation of charge as in the electrolyte, or for a binary electrolyte in which cations and/or anions may undergo electrochemical reactions, and where i s is the current density in the solid phase. The sign difference compared to Eq. 6 comes from the observation that charge entering the liquid phase must be leaving the solid phase. The current density in the solid phase is given by assuming a bulk Ohm's law, where σ s is the conductivity of the electronically conductive matrix, φ s is its electrostatic potential, and we have assumed that the volume fraction of the conductive phase is given by the space not occupied by the electrolyte. The boundary conditions for this come from observing no electronic current can flow into the separator, n · i s = 0, and the potential at the current collector is specified by the operating voltage on the system in the macroscopic equations, φ c or φ a (c stands for cathode while a stands for anode). The Bruggeman relation can again be used to estimate the tortuosity in terms of the volume fraction of the conductive matrix.
To avoid the computational and practical difficulties of simulating full microstructures, we describe the behavior of particle interactions with a small number of representative particles, both along the length of the electrode and also in parallel with each other in terms of electrolyte access to capture the effects of particle size distributions. The particles at the same electrode position (interacting in common with the local electrolyte) could be in parallel or in series electronically where parallel wiring would describe them each having direct access via a single resistance to a conductive network and series wiring might describe a comb structure in which some particles (perhaps the edge of a secondary particle) are connected to the conductive backbone, but electrons must pass through poorly conducting particles to get to particles without good contact to the conductive backbone, similar in concept to the hierarchical model of Dargaville and Farrell [37]. We demonstrate use of the parallel case with a distribution of contact resistances in ref. [77]. In the second case of series wiring we implement a simplified version of that developed by Stephenson et al. [12] by imposing a finite conductance between particles in series, indexed by k, within a simulation volume, j, where G j,k is the conductance and I j,k is the current between particle k and k + 1. From charge conservation, where j j,k+1 is the intercalation rate into particle k + 1.

B. Single Particle Equations
A single particle interacts with the electrolyte via an electrochemical reaction, leading to intercalation of neutral species into the solid phase. However the electrochemistry is modeled (see Section II B 1), the reaction serves as a source/removal of species into/from the particle. We will describe several different solid models here. Generally, we begin by postulating a free energy functional describing the important physics of the particle, where G is the total system free energy, V p is the particle volume, g is the free energy density, A S is the particle surface area, and γ S is the surface energy. Typically, we will separate the free energy density into homogeneous, g h and non-homogeneous, g nh , contributions, where the remaining terms could describe the stress state of the system [25,74] or other energetic contributions [122]. Following van der Waals [123] and Cahn and Hilliard [124], we use a simple gradient penalty term to describe the non-homogeneous free energy, where κ is a gradient penalty tensor (assumed to be isotropic here such that κ = κ1 and 1 is the second-order identity tensor) related to interfacial energy between phases, c i is the concentration of species i within a single particle, and c s,ref is a suitable concentration scale for the insertion species in the active material. The diffusional chemical potential can then be obtained form a variational derivative of the free energy,

Electrochemical Reactions
The electrochemical reaction can be described by a number of different models, such as the empirical Butler-Volmer equation [90] or quantum-mechanical models based on Marcus kinetics [94,96,125], which must be consistently generalized for concentrated solutions in nonequilibrium thermodynamics [74,97]. We describe here electrochemical reactions of the form and we will describe the reactions as a function of the activation overpotential, where µ R = j s j,R µ j is the electrochemical potential of the reduced state, µ O = i s i,O µ i is the electrochemical potential of the oxidized state, and µ e is the electrochemical potential of the electrons, which we relate here to the electric potential measured in the conductive matrix, µ e = −eφ s . ∆µ rxn and ∆G rxn indicate the total free energy change of the reaction. In the case of Li + insertion and the Stefan-Maxwell concentrated electrolyte model using Li/Li + as a reference electrode, µ O = eφ r . We adopt the convention here that a positive electrochemical reaction current corresponds to the net rate of reduction. The net reduction current, i, can be related to the intercalation flux, j i , for a given species by the reaction stoichiometry. For example, for lithium intercalation, j i = i/e. Extension to multiple reactions simply involves describing each j i as a sum over the relevant reactions.
It is worth noting that the reaction models currently implemented and discussed below follow the trend in battery modeling to neglect the impact of diffuse charge within double layers on the reaction kinetics. Accounting for this involves using a model of the double layer to adjust the surface concentrations from those outside the double layer to those at the distance of closest approach to the electrode surface (the Stern layer), which actually drive the reaction, as well as accounting for the local electric field driving electron transfer. These changes constitute the Frumkin correction [126,127] to the reaction rate model, and have been recently reviewed [128,129]. Frumkin-corrected Butler-Volmer reaction models have been applied to various electrochemical techniques including steady constant current [127,128,130,131], voltage steps [132], current steps [133], and linear sweep voltammetry [129], as well as nano [134] and porous [103,105] electrodes, with clear indication of departure from models neglecting double layers, especially at low salt concentrations with thick double layers ("Gouy-Chapman limit" [127,128]). To be used consistently with the models developed here, Frumkin reaction kinetics would need to be extended to concentrated electrolyte solutions, including models of individual ionic activities within the double layers, although Frumkin effects are reduced for very thin double layers at high salt concentration ("Helmholtz limit" [127,128]). On the other hand, Frumkin effects that dominate in dilute solutions could be important for practical battery operation at high rates, where severe electrolyte depletion can occur and limit the achievable power density.
a. Butler-Volmer kinetics Butler-Volmer reaction kinetics are described by exponential dependence on the activation overpotential, and the net reduction current can be written as where α is a symmetry coefficient and i 0 is the exchange current density, the rate of reaction in the forward and reverse directions when the reaction is in equilibrium. Depending on the system considered, the exchange current density could be modeled as constant [135] or a function of species concentrations or activities. Introduced in ref. [53], the effective overpotential, η eff , accounts for any film resistance, R film , by Bazant and co-workers proposed a form for i 0 based on reacting species' activities and a transition state activity coefficient, γ ‡ [25,40,71], derived by assuming thermally activated transitions in an excess chemical potential energy surface with an electric field across the reaction coordinate contributing to the transition state [74], , a e is the activity of the electrons (taken to be unity here), and a R = j a s j,R j . The transition state activity coefficient is a postulate about the structure and characteristics of the transition state. For example, for lithium intercalation into LiFePO 4 , Bai et al. originally proposed γ ‡ = (1 − c/c max ) −1 where c max is the maximum concentration of lithium within the solid, to indicate the transition state excludes one site. Of note, although the above expression is defined in terms of the activities of individual ions within the electrolyte, these quantities are difficult to directly measure. Because we have not implemented models to estimate ion activities, the software currently assumes a Li + = c for both electrolyte models.
It is also common to use an exchange current density form based solely on species concentrations [5,106], b. Marcus-Hush-Chidsey kinetics Marcus-Hush electron transfer kinetics describe an electron transfer event in terms of a reaction coordinate corresponding to the collective rearrangement of species involved in the transition state [93][94][95][136][137][138]. The electron transfer event can occur when it is energetically equivalent to occupy the donor or acceptor species, and the fluctuations which lead to this are related to dielectric rearrangement of molecules and charges around the donor-acceptor pair. The Franck-Condon condition is satisfied because the electron transfer event is much faster than the rearrangements of the nearby molecules contributing to the energy of the reacting species. Following the overview of Fedorov and Kornyshev [139], the reductive and oxidative currents at an electrode can be calculated as an integral over the energy levels of the electrons in the electron conducting phase (the electrode), , z represents the energy level of electrons in the electrode, ρ(z) is the density of states, and n e (z) is the Fermi function. W red/ox are the transition probabilities of the elementary reduction/oxidation electron transfer processes. Marcus theory considers the collective motion and reorganization of molecules near the electron transfer event, causing higher or lower energy contributions to the initial or final states of the reaction event via the electrostatic interactions between nearby polarization and the electron donor/acceptor. By treating this collective motion as approximately parabolic around their lowest energy configurations, the following can be derived for the transition probabilities, where k w is a prefactor with explicit dependence on various factors, including the overlap integrals for the wave functions of the various reaction elements [138]. We assume reaction symmetries by the equality of the reductive and oxidative prefactors and treat it as a lumped constant here. w R/O are energies describing the probabilities of the species arriving and orienting at the reaction site. λ is the reorganization energy, related to the force constants or the curvature of the reaction parabolas, which we take to be the same for forward and reverse reactions, i.e. symmetric Marcus theory. It is defined as the energy required to perturb the system to the stable configuration of the product without allowing electron transfer. The driving force is the reaction change in excess free energy, ∆G ex rxn , where we have assumed single-electron transfer, as supported by Marcus theory for elementary reaction events [74].
, with each scaled to its reference concentration (c ,ref for ions in the electrolyte and c s,ref for intercalated species in the active material). Thus, η f is also the departure of the electrode potential from the formal potential. Interestingly, for non-electrode reactions in solution, this predicts a maximum in reaction rate at driving forces given by ±λ, and experimental validation of this so-called "inverted" region of decreasing reaction rate at increasing driving force (i.e. negative differential reaction resistance [75]) paved the way for the Nobel Prize of Marcus [94].
Assuming w R/O are independent of the electron energy level (not necessarily true [138,139]), neglecting variation in the density of states, modifying the driving force to account for the energy levels of electrons along the Fermi distribution, and lumping constants into k M , we can arrive at the Marcus-Hush-Chidsey (MHC) electron transfer reaction model [96], where z is related to the energy level of the electronic states in the metal, and integration is over the Fermi distribution. Reduction/oxidation correspond to the top/bottom signs. Curiously, Marcus-style kinetics were not used to describe electron transfer reactions in batteries until very recently [98], possibly in part because of the complexity of the expressions involving improper integrals, making their computational evaluation cumbersome. But recently, various approaches have been developed to facilitate the evaluation of the MHC expression, including an asymmetric variant with different values of λ for the initial and final states, referred to as "asymmetric Marcus Hush" (AMH) kinetics [125,[140][141][142][143]. We will focus exclusively on the symmetric variant here. As a result, MHC kinetics are now as easy to simulate as Butler-Volmer kinetics, so we include them in this simulation software to facilitate comparison in porous electrode modeling and data fitting. For reviews of (asymmetric) MHC kinetics and applications to experimental data, see refs. [144,145].
We make one final assumption following ref. [97] before arriving at the form we will use. The w R/O functions are related to the probabilities of the system arriving at the state described by the parabolic minima in the theory. As in the derivation of the Butler-Volmer expression by Bazant [74], we postulate that this could capture effects of concentrated solutions beyond simple probabilistic occupation related to the concentration prefactors above. In other words, they are related to the excess chemical potential of the state corresponding to the parabolic minima. Assuming a symmetric approach to the reacting state from the forward and reverse directions, Thus, we arrive at our expressions for MHC kinetics, with and Although the derivation of the Butler-Volmer equation [74] and the approach followed above both lead to some prefactor related to the excess chemical potential of the transition state, we suggest that the two terms are not capturing the same physical phenomena and thus may differ in their functional forms. In this approach to the microscopic Marcus theory, there is some separation between the energetic contributions accounted for in the microscopic reorganization and the "approach" contributions lumped into γ M, ‡ . The Butler-Volmer derivation does not make this distinction, suggesting that the associated contributions in the two theories need not necessarily be equal. Finally, following Zeng et al. [125], we replace Eq. 48 with where tildes indicate scaling by the thermal energy or voltage, k B T or k B T /e, erfc(z) = 1−erf(z) is the complementary error function, and reduction/oxidation corresponds to the top/bottom sign.

Species Conservation
Conservation of the intercalant within the solid particles should be specialized to describe the particular physics of the material being studied. Several options are described below. We will simulate the individual particles by describing neutral species transport within them and their mass exchange with the electrolyte via the electrochemical reactions. This assumes that electron mobility within the active materials is much larger than that of the inserted species [106].
a. Homogeneous When transport within the solid particles is fast, it can be computationally beneficial to approximate the particles with an average concentration, c s [44]. Then, given a reacting surface area, A p , and volume, V p , the dynamics of intercalant i can be described simply by the average intercalation rate from the electrochemical reaction, j p , b. Allen-Cahn Reaction For Allen-Cahn reaction particles, the reaction occurs as a volumetric source term. This arises when particles are assumed to be either homogeneous or depth averaged in the direction normal to the reacting surface, as Bazant and co-workers have employed in models of LiFePO 4 [25,38,71]. Then, neglecting transport, the local rate of change of the concentration at particle location r is c. Cahn-Hilliard Reaction In this model, transport of the intercalant within the particles is described by species conservation, The flux can be modeled using linear irreversible thermodynamics [146], which postulates that fluxes arise from gradients in the diffusional chemical potential, where we have again used the Einstein relation. The diffusional chemical potential is scaled to the thermal energy at some reference temperature, k B T ref , and can be calculated from Eq. 32. Following Bazant [74], D i can be rewritten in terms of tracer diffusivity in the dilute limit, D 0,i , the activity coefficient of species i, γ i = a i / c i , and the activity coefficient of the diffusion transition state, γ d ‡,i , Assuming simple diffusion on a lattice in which the diffusion transition state has similar enthalpic contributions as the diffusing species in lattice sites but in which the transition state excludes two adjacent sites, although other effects could be accounted for in γ d ‡,i including stresses in the transition state [16]. At the particle surface, the flux is given by the electrochemical reaction, n · F i = −j p,i where n is a unit normal vector pointing from the active material to the electrolyte. The natural boundary condition [74,147] imposes a constraint on the concentration at the surface as a function of the surface energy, γ S , n · ∂g ∂∇ ci = n · κ∇ c i = ∂γ S ∂ ci . d. Solid Solution If the free energy can be described as a function of only the concentration (disregarding the effect of gradients and other contributions), then Eq. 54 can be rewritten as Here, it is sufficient to prescribe the flux at the surface, as in the Cahn-Hilliard reaction model, n · F i = −j p,i .

C. Coupling Equations
The general approach we take to simulate the two coupled phases is to simulate, within the same physical and simulated space as the electrolyte, a representative sample of particles, which are duplicated to the appropriate filling fraction of solids within the electrode. Instead of simulating discrete particles, an alternative approach could involve directly simulating the distribution of particles at a given state using a population balance model [148][149][150]. This may improve accuracy at fixed computational cost, especially for simple particle models like the homogeneous approximation. However, for the more complicated particle models which explore only a tiny fraction of their state space, the current approach may be more efficient.
For example, to simulate an electrode with a very narrow particle size distribution, we simulate one particle at each electrode position. For wide distributions, we use multiple particles sampled randomly from a given input distribution, and at each location, multiple simulated particles interact with the same electrolyte. The representative simulated particles at each electrode position are scaled to occupy the specified volume fraction of active material per electrode volume. We allow the simulated particle size distribution to vary as a function of position, as this allows us to sample a broader distribution within the full electrode, but loses accuracy in situations with significant transport losses in the bulk electrolyte or electron-conducting phases. When setting up simulations, the primary consideration is to have a good representation of the full particle size distribution within the macroscopic length scales of interest, which may be the full electrode at low currents or small regions at high currents with strong electrolyte depletion or electronic losses.
The two phases are coupled via the electrochemical reactions. The volumetric reaction rate of species i, R V,i , is related to the electrochemical reactions and the flux of that species out of the solid particles. This can either be done by integrating the reaction rate over particle surfaces or by applying the divergence theorem to relate that to their average rate of filling. For particle p, at a given position in the electrode, Thus, the volumetric source term can be cast as a sum over all the particles at a given position, where P L is the loading percent of active material in the solid phase, V u = p V p , and p indicates properties of particle p, and the summation is over particles at the location where R V,i is evaluated.

D. Macroscopic Equations
The overall current density per electrode area, i cell , is defined as the integral of the net charge consumed by the reactions in the electrodes per unit cross-sectional area, where L a and L c are the lengths of the anode and cathode. We also find it useful to define a current in terms of a C-rate, which is determined by the electrode with the smaller capacity. The capacity of the cell per area, Q A , is given for the case of an electrode with a single intercalating species with maximum concentration c max,k in electrode k by the capacity per area of the limiting electrode, With that, we can define a C-rate current, where τ hr is a conversion factor to ensure units of hr −1 .
The overall utilization (state of charge) of electrode k for species i, u k,i , is defined in terms of the average filling fraction of all the particles in the electrode, where k indicates either the anode or cathode and the summation is evaluated as a function of position, given the selection of particles in the simulated electrode at that position. From above, ξ i = c s,ref /c i,max , and c p,i = c p,i /c s,ref , so the product is the average filling fraction of particle p. The overall cell voltage, ∆φ cell = φ c − φ a is defined as the difference in the electric potential at the cathode and anode current collectors. There is an arbitrary datum for the potential, and we set φ c = 0 in the simulations. We account for series resistance by defining an applied voltage, ∆φ appl , by where R ser is the area specific resistance of the cell.
with ∇ = L ref ∇ and tildes indicating non-dimensionalization by the following scales The (semi-)dilute fluxes are non-dimensionalized by with diffusive scale as that chosen to define t ref above. The binary concentrated solution theory can be nondimensionalized with with conductivity scale The solid phase current density and conductivity are scaled to i ref and σ ref respectively such that and

B. Single Particle Equations
In the solid particles, we will use the same time scale as in the electrode scale equations but different length and concentration scales, where L s,ref and c s,ref are relevant scales to the particle. We will use L s,ref = L p , where L p is a characteristic length scale of the active material particle and which may vary by particle. For the case of lithium insertion electrodes with a single intercalating species with maximum concentration given by c max , we choose the solid reference concentration to be the maximum filling for lithium insertion cells, c s,ref = c max .

Electrochemical Reactions
The various forms of the overpotential are all scaled to the thermal voltage, kBT ref e , and the rate prefactors and current density are both scaled to The film resistance is scaled to and the Butler-Volmer expression is while the MHC expression is

Species Conservation
We scale the rate of intercalation of each species in particle p, j p,i , to the active material reference flux, N s,ref , such that, for homogeneous particles, where c i = c i /c s,ref , and For Allen-Cahn reaction particles, where r is non-dimensionalized by L p . For Cahn-Hilliard reaction particles, The non-dimensional flux is given by where the diffusivity is scaled to For the case of diffusion on a lattice with a simple excluded site model for the transition state, Eq. 56 becomes The natural boundary condition is scaled using such that at the particle surface, and the flux boundary condition is simply For solid solution particles, with the same flux boundary condition as the Cahn-Hilliard reaction particles.

C. Coupling Equations
Here, we retain the same scales as above, such that and with β = c s,ref /c ,ref .

D. Macroscopic Equations
Keeping the same scales as in the electrode model, and where k indicates either the anode or cathode,

IV. MODEL IMPLEMENTATION
To solve the system of PDE's in the model, we take the general approach of discretizing each in space using some variant of the finite volume method to obtain a system of differential algebraic equations (DAE's), and then stepping in time using a variable-order adaptive time stepper. We discretize in space using finite volume methods both for their robustness to steep gradients and also their mass conservation to within numerical accuracy [151,152]. We use the IDAS time stepper of the SUNDIALS integration suite [153] to solve the resulting DAE's with a backward differentiation formula approach. The model and simulation are defined within the DAE Tools software package [154], which provides a modeling language environment within Python similar to that of more specialized modeling languages like gProms [155] or Modelica [156]. This allows use of the full depth of the general purpose Python environment while adding helpful concepts from modeling languages such as logical separation of model definition from simulation setup and equation oriented model definition.
For example, to define a model, the user writes the spatially discretized equations in a familiar form within a model class and defines simulation particulars such as parameter values and initial conditions elsewhere. The DAE Tools software handles the formation of all underlying system matrices and interactions with other numerical libraries involved in the actual time advancement. As an extra convenience, it wraps IDAS with the ADOL-C automatic differentiation library [157] to form the analytical-accuracy Jacobian matrix, greatly facilitating the solution of nonlinear systems of equations involved in the implicit time stepping. This eases additions and modifications to the model, which can be made without user input of analytical derivatives or reliance on numerical approximation of the Jacobian. This approach enables MPET developers to work entirely within a Python environment while using the fast and vetted lower level numerical libraries for computationally expensive or analytically tedious aspects of the simulation.

A. Software Organization and Structure
To make MPET flexible enough to simulate arbitrary active material models in the context of either porous electrodes or single particles to study their dynamics directly, we chose to develop the software to logically and structurally isolate the material models from the overall cell model using an object oriented framework, see Figure 2. Objects containing local information about active material models exchange only the required information with the cell model, reducing assumptions built into each section of the software and leading to a more modular, extensible structure. Parameters are specified within input files using a standard config-file syntax for ease of scripting multiple simulations. These input files are split according to information used by the overall system (e.g. specified current profile and system dimensions) and those defining properties of the simulated active materials (e.g. material thermodynamics, transport, and reaction properties). This enables a user to reference standard material property files while editing only a system input file related to cell design. These inputs are then non-dimensionalized for the simulation, as described in Section III, and passed to the system model.
Depending on the simulation to be carried out (e.g. perfect electrolyte bath, half-cell, full-cell, with or without particle size variability), the system model creates as many instances of the appropriate active material model as  necessary for the representative active material particles and establishes communication between them to only exchange key information. The active material particles get access only to local concentrations and potentials in the bulk phases near the particular active material particle, and the bulk surrounding phases only need access to the total integrated reaction rate of each particle. This isolation makes it relatively straightforward to extend MPET's capabilities by adding new material models or modifying existing ones to add relevant physics such as stresses and strains [17,23,25,26,74,122,158] or hierarchical structures [37]. For example, to add and simulate a new model, a user must define the non-dimensional equations as a model class, specify the initial conditions via the simulation class, and update the handling of parameters to read and non-dimensionalize any new inputs. Material models can easily use distinct discretization and/or geometries such as the homogeneous or CHR particles. We have also already included the two-repeating-layers model developed and applied to single graphite particles [76,89]. Other variations such as 2D particles of arbitrary geometry discretized using the finite volume [159] or finite element method would also be straightforward, especially with the DAE Tools interface to the deal.ii finite element library [154,160]. The structure also makes it a straightforward addition to implement multiple particle types to be simulated within each electrode region. Finally, it makes it easier to modify specific parts of any given model with confidence that side-effects will be minimized through the isolation of the logical parts.
In order to facilitate good reproducibility of scientific computations, MPET defaults to storing each simulation output within time-stamped directories, along with both input files and a snapshot of the source code which ran that simulation. Users can disable this feature to use their own system or take advantage of it by keeping a log matching the time-stamped directories with notes about each simulation. Simulation outputs are stored by default in a binary format which is readable using common scientific computing software including Python (with SciPy), R, and MATLAB. MPET includes a script to perform some basic plotting using this output and also a script to convert the output to comma-separated value (CSV) text files, which can be nearly universally interpreted.

B. General Options
As discussed above, the software's structure makes it flexible enough for a range of possible simulation options, and the key options are described here. Either the current or voltage can be imposed as piecewise-constant functions with arbitrary numbers of steps (simulated with fast but continuous steps, similar to the method proposed in ref. [161]). With minor changes to the code, completely arbitrary functions are possible. Currents are imposed relative to a 1 C (dis)charge based on the simulated battery's limiting electrode, and optional cut-off voltages terminate the simulation if the system voltage reaches their values. Because it is sometimes convenient to continue an old simulation, this can be done by specifying the location of a stored output. Discretization is specified in terms of the number of finite volumes in each region of the electrode. If the anode is set to have zero volumes, the simulation uses a flat lithium metal counter-electrode with specified Butler-Volmer reaction rate kinetics. If only a single cathode volume is simulated, it places any simulated particles within a perfect electrolyte bath without any transport limitations for either single-or multi-particle studies neglecting electrolyte and bulk electrode losses. Within each discretized porous electrode volume, the chosen number of particles are simulated, drawing from a specified log-normal size distribution. Conductivity losses in the bulk electron-conducting phase or between individual particles within each volume of simulated electrodes are optionally neglected or simulated as described in Section II A 2. Electrode lengths, electrolyte volume fractions, loading percents (volume fraction of active material within the electron-conducting phase), and Bruggeman exponents describe the geometry characteristics of effective transport within the porous electrolyte. The electrolyte can be specified either as a dilute model or using a full Stefan-Maxwell concentrated solution theory model as described in Section II A 1. Arbitrary functions can be specified for the electrolyte transport properties by defining them as Python functions.
Active material particles are specified by the basic model for their transport processes (e.g. Fickian diffusion, homogeneous, Cahn-Hilliard reaction), the thermodynamic function describing them (also specified as arbitrary Python functions), and the remaining properties associated with the particular model. The specified transport model determines the type of material model (defining the discretization method and equations solved) used in the simulations. When applicable, the transport flux prefactor can be specified as an arbitrary function. Electrochemical reactions are defined as Butler-Volmer, Marcus-Hush-Chidsey, or (experimental) Marcus kinetics as formulated by Bazant [74], and a reaction film resistance can be added to any of these. The Butler-Volmer exchange current density is taken as one of a few built-in options, as outlined in Section II B 1, but can be specified as arbitrary functions within the particle model source code. To facilitate stability of some models, we provide the options to replace the most extreme regions of the log terms of ideal-solution parts of thermodynamic models with linear extrapolations. Finally, to ensure that materials phase separate when they naturally would based on minor fluctuations, we include the option to add Langevin noise to the rate of change of concentration within each solid finite volume [25].

C. Numerical Methods
For each of the methods detailed below, we will describe the discretization in non-dimensional form using the scales presented in Section III. We will also drop subscripts indicating species and location (electrolyte or active material particle) for clarity with discretization subscripts.

Electrolyte
The electrolyte equations are discretized using a typical 1D finite volume scheme with cell centers [152]. They are non-dimensionalized using the same scales as in the electrode scale equations, Section III A. For example, for species conservation in cell j with width ∆ x and neglecting subscripts for electrolyte/species identifiers for clarity, where the j subscript represents an average quantity within the discretized volume, and the F j±1/2 represent components of the flux normal to the faces on the right/left of cell j in the positive x direction, where x is along the length of the cell going between the current collectors. The flux is approximated using a finite difference two-point formula based on the adjacent cell centers. Where required (e.g. for electromigration terms), face values of field variables such as concentration are approximated using harmonic means, which greatly enhances stability in regions of strong electrolyte depletion. The harmonic mean also better represents variation in transport prefactors [162].

Active Material
The active material can be defined as spherical, cylindrical, or a rectangular grid approximation of platelet-like particles common in LiFePO 4 [163]. Those on a rectangular grid are discretized like the electrolyte, and the ratio of reacting area to volume is calculated as a function of the length and thickness, h p , of the particle assuming reactions only occur on the top and bottom surfaces [38]. For spheres and cylinders, the ratio of particle volume to reacting area is specified fully by the particle radius. For cylinders, we use the particle thickness, h p , for clarity in this section. The spherical and cylindrical particles are discretized using a variant of finite volumes directly taken from Zeng et al. [164,165]. They are non-dimensionalized using the same scales as in the single particle scale equations, Section III B. For the cylindrical particles, we follow the same method as that in Zeng and Bazant, but modify it for the cylindrical geometry by changing the calculation of the volumes and areas of each sub-shell. That is, for both geometries, the systems of equations can be represented as where c is a vector of concentrations at positions going from the center of the particle to the surface of the particle with N sub-volumes, M is a tridiagonal matrix given by and V is a diagonal matrix defined by the volumes of the shells scaled to L 3 p . Indexing the volumes with j = 1 . . . N , and with a uniformly spaced radial vector, r j , with N points going from the particle center to its surface, then for a sphere V has components defined by and for a cylinder, The right hand side, b, is defined in relation to the radial components of the fluxes evaluated at the interfaces between the shells, F j±1/2 , and the areas of the interfaces between the shells, A j±1/2 . The fluxes and areas are scaled to F s,ref and L 2 p respectively. For each geometry, The shell areas differ for the two geometries, given scaled to L 2 p , The flux is calculated using the two-point centered finite difference approximation using the concentrations in the adjacent cells. Unlike in Zeng et al. [164,165], we use harmonic means for face value approximations of field variables as in the electrolyte. This discretization scheme for the cylinders and spheres has the advantage of increased accuracy of simulated surface concentrations [164] while retaining mass conservation to within numerical precision. It is slightly less robust than a more typical cell-centered finite volume scheme under certain situations, as the coupling between the adjacent volumes via the mass matrix can cause minor oscillations during the formation of very steep concentration gradients, but this typically only presents problems when beginning with very high currents from nearly full or empty particles. These oscillations could be eliminated by using a flux limiter, commonly used in higher order discretization schemes and especially for hyperbolic problems [166]. This approach also has the advantage, much like typical finite volume schemes, of naturally facilitating the application of flux boundary conditions, as applied to the active material at the particle center (from symmetry) and surface (from reaction). When applied to CHR particles, to evaluate the diffusional chemical potential at grid points we must calculate the Laplacian of the concentration, and we follow Zeng and Bazant [165]. For interior points, j = 2 . . . N − 1, For the center of the particle at j = 1, isotropy gives At the surface, we use a ghost point at j = N + 1 and impose the concentration gradient within the Laplacian of the concentration,

D. DAE Consistent Initial Conditions
Because the discretized equations are coupled DAE's, we must begin the system from consistent initial conditions [83,167]. Although various approaches for initializing this type of model have been developed [168][169][170], we found it to be relatively robust to begin from a known equilibrium state and quickly ramp the applied current or voltage to the desired values. Although this contributes to the stiffness of the system, the higher order, adaptive backward difference formula (BDF) time stepper we use mitigates the cost of this, obviating the need to use more sophisticated methods.
To run simulations with specified current, we begin at a zero-current state, where we can easily calculate the equilibrium potentials in each of the phases (because we also begin with uniform concentration profiles). Similarly, for simulations with specified applied voltages, we begin from the calculated equilibrium applied voltage before ramping to the desired voltage. In addition, to make the initialization more robust, we offset the diffusional chemical potentials in the solid phases throughout the simulation by their initial values, such that the initial equilibrium potentials everywhere throughout the simulation are zero. We found this to substantially facilitate initialization compared to leaving diffusional chemical potential at their physical values, which can leave differences in potentials across the system on the order of a hundred thermal volts (e.g. a 3 V material against a lithium metal or graphite anode is at ∼ 100 thermal volts compared to k B T /e at room temperature). Because these potentials appear within exponentials of rate expressions, offsetting them to begin the simulation at zero substantially facilitates the numerical determination of consistent initial conditions and has no impact on the simulation output upon post-applying the reverse-offset. Finally, when performing a simulation continuation, we take the final state of the previous output as initial guesses for the new initial state.

V. EXAMPLES
As a detailed examination of all the applications and model variations of the software is beyond the scope of the present work, we instead focus here on a few examples highlighting some of the key distinguishing capabilities of MPET.

A. Solid solutions and phase separation in porous electrodes
We begin with a comparison of solid solution and phase separating models within porous electrode simulations, which highlights the ability of the software to compare two different approaches to modeling the same material, variations of both of which are commonly used [62,171]. A complete comparison of the different models is beyond the scope of this work, so we present only a simplified example here as a demonstration of the model behavior. To keep the system as simple as possible, we choose to investigate a fictitious material in which lithium intercalates and has a diffusional chemical potential described by a regular solution, where c = c/c max is a filling fraction, c max is the maximum concentration of lithium in the active material, and with µ Θ arbitrarily set to −2 eV defined relative to Li/Li + . The regular solution parameter, Ω, is set to 3k B T ref , where T ref = 298 K is the absolute temperature at which the simulation is carried out. We examine an electrode with particles with radius, R = 1 µm, and we choose the interfacial gradient penalty, κ = 1.16 × 10 −7 J/m such that the phase interface width is several times the finite volume grid size, 20 nm. The maximum filling fraction in the active material, c max = 25 M is chosen arbitrarily.
To describe the thermodynamics of the solid solution material, we impose a diffusional chemical potential associated with the stable equilibrium diffusional chemical potential defined by Eq. 116, a piece-wise continuous function defined as equal to µ RS outside the miscibility gap and µ Θ within it, the red dashed curve in Figure 3. Note, this could differ from a particular equilibrium filling/emptying path because a particle described by Eq. 116 can enter metastable regions, leading to equilibrium hysteresis [36,44,172] which a solid solution model cannot capture without directiondependent thermodynamic models. In order to minimize conflating factors from the reaction kinetics, we model both phase separating and solid solution particles using the symmetric (α = 0.5) Butler-Volmer model with a constant exchange current density, i 0 = 1 A/m 2 , leading to minimal reaction losses in either system. We will consider the case that intercalation occurs at the surface and phase separation occurs within the bulk, indicating it can be described by the Cahn-Hilliard reaction model [74,165]. The transport of solid solution material can be described using Fickian diffusion. For the solid solution, we use constant D chem = 1 × 10 −16 m 2 /s, and for the phase separating case, we use Eq. 56, which approximately matches the concentration-independence of the chemical diffusivity in the solid solution regimes [76]. We adjust D 0 until we get a similar dependence of available battery capacity as a function of current (Fig. 5 (b)), where capacity is defined as the electrode filling fraction when the voltage reaches a 1.5 V cutoff. We find D 0 = 8×10 −16 m 2 /s reflecting the larger value of transport prefactor required to obtain similar fluxes in phase separating systems because of the smaller gradients which can arise in their end member phases compared to solid solution particles (Fig. 4). We use a cell geometry with thin electrodes to minimize electrolyte limitations and assume no electron limitations in the porous electrode or reaction resistance on the lithium foil counter electrode. The porous separator and cathode are 15 µm and 20 µm with porosities of 0.8 and 0.2 respectively. The loading fraction in the cathode is taken to be 0.7 with the Bruggeman exponent a = −0.5. We model the electrolyte using concentrated solution theory as described in Section II A 1 using parameters as determined by Valoøen and Reimers [85] but replacing the conductivity with that measured by Bernardi and Go [63].
Despite very different models for the transport in the solid phase, it is interesting to note that some macroscopic characteristics of the modeled cell are quite similar. For example a representative cell voltage polarization curve and the dependence of cell capacity as a function of current show similar behavior ( Figure 5), indicating that macroscopic cell data alone would not differentiate between these models. We find in a companion paper that this observation holds for similar models even in the case of non-negligible reaction resistances which are dominated by film resistance [77]. Of note, in the companion paper, we used Eq. 54 with constant prefactor, i.e. D 0,i γ i c i /γ d ‡,i = constant, which we found here unable to produce a dependence of capacity on current similar to the solid solution with constant chemical diffusivity. Despite the similarity in Figure 5, we note that the models give very different predictions of the behavior at the particle level, shown in Figure 4 in which we show both a snapshot of a representative concentration profile for each of the simulations and also a representative profile of the evolution of surface concentration in one of the particles. Because the surface concentration also affects other model behavior, including the reaction rate, we show in Figure 6 that when both particles are simulated using the concentration-dependent exchange current density in Eq. 38, they diverge much more significantly in their predictions. A consistent coupling to stresses and strains would further differentiate the models, as the concentration profile throughout the particle directly couples to the stress profile [20,25,122,173]. Here, to focus on the electrolyte, we consider the same (phase separating) electrode materials in dilute and concentrated electrolyte solutions. Dargaville and Farrell first considered CHR and ACR phase field particles in porous electrodes using Stefan-Maxwell electrolytes [41], and we briefly compare the dilute approach previously used by Bazant and co-workers [38,40,44] with the concentrated model here. We use the same phase separating material as that studied Section V A with constant exchange current density but simulate it in a battery with a longer electrode of 200 µm. The concentrated electrolyte model is identical to that used in Section V A, and the dilute model is analogous to that model but replacing the fit function of the electrolyte conductivity with the linear dependence predicted by dilute solutions [5], neglecting concentration dependence of the electrolyte transport coefficients, and using D ,+ = 2.  In this situation, the electrolyte transport is limiting, so we expect substantial differences between the two models, which we see in Figure 7. Because the electrolyte transport is much more limiting than the solid phase transport, the results are qualitatively similar to those of Valoøen and Reimers despite their use of a solid solution active material model instead of the phase separating model here [85]. As in Figure 7 (a), they found the concentrated model leads to a more gradual decrease in voltage over the cell discharge but a larger overall capacity. This highlights the importance of using the more consistent concentrated solution theory approach in situations with substantial electrolyte polarization.

C. Full Cell LiFePO4/C
To demonstrate the versatility of the software, we present here the result of a battery simulation with two porous electrodes using two very different solid material models for each one. In the cathode, we use an Allen-Cahn reaction model of LiFePO 4 (LFP) which was developed by Bazant and co-workers [25,44,71,174] and used to explain in situ measurements of mosaic phase transformations in porous electrodes [38]. In the anode, we simulate graphite using a 2-layer Cahn-Hilliard reaction model [44,76] as used to capture the experimental intercalation of a single crystal of graphite [89]. Although we have found a variation of this model to better describe the behavior of porous graphite electrodes [77], we use it here to highlight the ease of implementing and using very different active material models within the same simulation using MPET.
We use the same concentrated electrolyte model as in the previous two sections. The lengths of the anode, separator, and cathode are 100 µm, 20 µm, and 150 µm. The porosities are 0.15, 0.4, and 0.2, and the loading percents of the anode and cathode are 0.9 and 0.7. Because the solid phase models are described in detail in the previous work, we only briefly introduce them here. The cathode particles are ACR particles described by a regular solution with an effective stress term, designed to approximately capture the tilting of the single-particle voltage plateau resulting from stresses [25,44,72], where Ω = 4.51k B T , the stress coefficient B = 0.19 GPa, c max,LFP = 23 M, c is the average filling fraction in the particle, κ LFP = 5 × 10 −10 J/m, and µ Θ LFP = −3.4 eV with respect to Li/Li + . The anode particles are described by two-layer CHR transport with a two-parameter regular solution model including inter-layer repulsion terms to capture the staged structure found in intercalated graphite [175]. The flux within each layer is given by Eq. 56, and the diffusional chemical potential of each is given by where j = i and i ∈ {1, 2} and c i represents the filling fraction of layer i. The parameters for graphite come from refs. [44,89] and are Ω a = 3.4k B T , Ω b = 1.4k B T , Ω c = 20k B T , c max,G = 28.2 M, κ G = 4 × 10 −7 J/m, and µ Θ G = −0.12 eV with respect to Li/Li + . In both materials, the reactions are governed by the symmetric (α = 0.5) Butler-Volmer, Eq. 35, using Eq. 37 for the exchange current density. For LFP, we set k 0 = 0.16 A/m 2 and use γ ‡ = 1/(1 − c) as proposed by Bai et al. [71]. For graphite, we set k 0 = 10 A/m 2 and use γ ‡,i = 1/( c i (1 − c i )) as we initially used in Guo et al. [89] and reexamined recently to suggest alternate models for practical battery simulation [76]. The bumps in the C/10 curve arise from discrete particle filling events in the cathode, and the bumps in the C/2 and 1 C curves arise from the graphite reaction activity coefficient model [76]. The electrode filling fraction refers to the limiting electrode, the cathode.
We present overall cell polarization curves for a selection of currents in Figure 8. The thick electrodes and low porosity make the cell experience strong electrolyte polarization at the moderate simulated currents, causing most of the losses in the cell. The cell capacity is limited by the cathode, evidenced by the graphite-caused shift in the C/10 voltage profile occurring at a cathode filling fraction larger than 0.5. In addition, we see erratic profiles at all simulated rates. At the lowest rates, this is primarily related to the mosaic transformation of the LFP particles along the length of the electrolyte, with one representative particle typically receiving almost all the current in the electrode, as seen experimentally [38,176] and explained theoretically [36,44]. This behavior can be seen in Figure 9 (b) in which the cathode particles show sharp filling processes related only to their position in the electrode, because they do not have size variation as used in Ferguson and Bazant [44]. In contrast, the anode particles behave more like the CHR particles studied in the sections above, with more gradual filling processes governed more weakly by their position in the electrode. At higher rates, the cathode still demonstrates a mosaic transformation, but the voltage curves smooth out because other losses dominate. The voltage spikes result from the form of the reaction resistance causing short sections of low resistance. This rate expression helped capture single particle experiments [89] but is unable to capture experiments on a full porous electrode, where we also used a simplified version of the graphite model [77].

D. Electrochemical reactions
Battery models are typically constructed assuming Butler-Volmer reaction kinetics [82,106], although recent evidence suggests Marcus kinetics may better describe some electrochemical reactions [96,98]. One possible reason for the use of the Butler-Volmer form is that the models do not deviate until moderate to large reaction driving forces, depending on the reaction [144]. A second is that the expression for calculating Marcus style kinetics at an electrode involves an improper integral [96], which is cumbersome to evaluate, especially within porous electrode simulations in which reaction rates are evaluated many times over the course of a simulation. Nevertheless, this Marcus-Hush-Chidsey (MHC) reaction model has been approximated with a mathematically simple and accurate expression [125], enabling its practical use in porous electrode battery models, which we demonstrate here. The primary effect of MHC kinetics is a downward curvature instead of the linear Tafel slope associated with Butler-Volmer reaction kinetics.
In order to accurately capture electrochemical data, the Butler-Volmer expression is commonly modified with a film resistance as in Eq. 36 to capture a series resistance associated with any film at the surface. Curiously, this modified expression could be interpreted as a way to introduce curvature to the Tafel plot in a way that can look similar to MHC kinetics over a range of driving forces. For example, in Figure 10, we compare Butler-Volmer with and without film resistance (BV and BV-film respectively) with the MHC expression, all using the same exchange current density and at fixed concentrations. In the figure, we use constant reaction rate prefactors, i 0 = i M = 1 A/m 2 and R film = 0.001 Ω m 2 , a value similar to that used to match electrochemical data using porous electrode modeling [56,177,178]. The MHC kinetics use the same exchange current density and a reorganization energy, λ = 18k B T , between that approximated for LiFePO 4 [98] and values used in other interfacial reactions [96,144]. The limiting behaviors for the film resistance and MHC models differ substantially, as the film model approaches a linear resistor at high driving forces, whereas the MHC current saturates at a constant value. However, over a relatively broad range of driving forces, the two predict similar currents when neglecting concentration effects, which suggests that some variant of the MHC model may be able to capture some electrochemical data using a microscopically derived model. We should note that the concentration dependence of the MHC model differs from that of the Butler-Volmer model with film resistance, so comparisons are not completely straightforward. Nevertheless, use of the MHC expression has the advantage that it also makes clear connections to surface properties [138] which could be engineered, suggesting possible improvement paths for materials with slow kinetics. To illustrate the application of MHC kinetics in a porous electrode, we simulate a current-pulse discharge process of the idealized phase separating material studied in Section V A using both the Butler-Volmer and MHC models as well as the Butler-Volmer model with a film resistance. As mentioned above, the concentration dependence of the MHC model is non-trivial, as the departure from the formal potential, η f , is offset from the activation overpotential. In addition, the prefactor, i M = k M /γ M, ‡ , may also have concentration dependence related to concentrated solution effects captured in γ M, ‡ . In order to study the two with the least impact from the different concentration dependence, we choose to modify i M here to match the exchange current densities of the Butler-Volmer and MHC models. This could be interpreted as choosing a particular model for γ M, ‡ , but we refrain from assigning physical meaning to the choice used here and make the selection to enable the simplest comparison between the two models.
First, we plot the exchange current density of the MHC model using constant i M in Figure 11 (a) and note that it has a dependence on the reduced species (intercalated lithium) that is approximately a square root. This applies to both c R and c O . Thus, in order to approximately specify an arbitrary exchange current density for the MHC model, we can simply divide a chosen function by √ c R c O and scale the magnitude accordingly. To connect to our previous work, we choose to compare the (symmetric) Butler-Volmer form based on species activities, Eq. 35 with Eq. 37. Thus, for the MHC model, we choose with n = 1 and α = 0.5, which very nearly matches the concentration and activity dependence of the exchange current densities of the two models, leaving the primary difference in the dependence on the activation overpotential, η. We use γ ‡ = 1/(1 − c R ) following previous work on LFP [25,71] and supported by recent experiments [88]. This gives an exchange current density with broken symmetry around half filling, as depicted in Figure 11 (b). We choose a reaction reorganization energy for the MHC model λ = 18k B T as in Figure 10. In order to minimize the effect of solid phase transport losses, we modify the phase separating particles from Section V A to have D 0 = 1 × 10 −14 m 2 /s. We simulate a half-cell using the concentrated Stefan-Maxwell electrolyte model and with a lithium foil counter-electrode with fast kinetics. Although fast lithium foil kinetics may be a poor assumption because of the small relative surface area, under constant current conditions, it would only add a currentdependent, constant additional voltage drop to both simulated systems. The simulated cell has a separator of length 20 µm with porosity 0.8 and a thin cathode of length 25 µm with porosity 0.2 to minimize electrolyte transport losses and focus on the effect of the reaction kinetics. The cathode loading percent, as above, is set to 0.7, and we simulate uniform particles of radius 1 µm with k 0 = 1 A/m 2 and k M chosen such that the magnitudes of the exchange current densities match. We adjust the value of the film resistance from that used in Figure 10 to R film = 0.02 Ω m 2 to achieve a closer match between the MHC and Butler-Volmer model with the film while using the concentration-dependent exchange current densities neglected in Figure 10. This value is higher than is commonly used and closer to that used in the introduction of the film resistance to battery modeling by Doyle et al. [53]. Exchange current densities as a function of concentration of the reduced species (e.g. intercalated lithium). In (a) the MHC exchange current density using constant prefactor, iM , is normalized to its value at maximum solid filling, and the red dashed line is a fitted square root function. In (b) the Butler-Volmer exchange current density is scaled to the reaction rate prefactor, k0, and assumes negligible contribution from concentration gradients.
We expose the cell to the current profile and corresponding state of charge profile in Figure 12 (b), and the output voltage profiles are shown in Figure 12 (a). Although the cell experiences moderate electrolyte polarization at the highest currents, those losses are similar for both models and do not explain the differences in the overall output voltage. The initial current pulse at 2 C brings all the electrode particles to a state of charge within the miscibility gap, so the equilibrium voltage is given by the value of −µ Θ /e = 2 V which we see the cell relax to after the pulse. We also can see the overlap of the BV and MHC profiles in the initial region of this pulse, where the surface concentrations are changing most substantially, confirming the match of both the magnitude and concentration dependence of the two reaction models in this lower-overpotential range when the two reaction models should overlap. However, once the particles begin to phase separate at approximately 7.5 min, the surface concentrations rise sharply, and the exchange current density decreases (Figure 11 (b)). This causes increased reaction resistance in both models and an associated increase in required driving force, but the MHC model requires a larger increase in driving force, causing the initial departure of the models near 7.5 min. When the higher current pulses begin, we see further departure of the two reaction models with the MHC model showing substantially higher reaction losses in Figure 12 (a) than the Butler-Volmer model. The Butler-Volmer model with the film resistance leads to behavior between the two, predicting more resistance than the other models at low rates and intermediate resistance at higher rates, indicating that the model results depart enough to clearly distinguish in these conditions. Still, the effect of the film resistance and MHC kinetics are qualitatively similar, suggesting that some of the system behavior which has been attributed to reaction film resistance may instead be caused by fundamental departures from Butler-Volmer reaction kinetics.
In the limit of eη λ, the Butler-Volmer and MHC models predict identical results. The value of λ we used here is between a value calculated for LFP [98] and values commonly found in calculations or fits to data for other systems [96,144]. Using this intermediate value and an MHC prefactor adjusted to give a more similar concentration dependence to Butler-Volmer expressions, we can see that the two models give noticeably different predictions on the simulated macroscopic system output. This further highlights the importance of continuing the study of the two models in practical battery models, and the MPET software can help facilitate this.

VI. SUMMARY AND CONCLUSIONS
Volume averaged porous electrode simulations provide insightful and industrially relevant ways to characterize battery behavior. Despite shortcomings associated with information loss from the volume averaging process, the simplicity of the approach and associated speed of model development, implementation, and simulation run time motivate its continued use. In this work, we have presented an open-source software package called MPET (Multiphase Porous Electrode Theory), which builds on foundations laid by John Newman and many others by describing the active materials with variational nonequilibrium thermodynamics [74,75] applied to porous electrodes [40,44]. Despite the prevalence of this modeling approach, few open source options are available for simulating the model, particularly ones that are easy to modify with new thermodynamic models based on the powerful phase field formalism [179], adapted for electrochemical systems [74]. With MPET, we aimed to address this gap by providing a software platform implementing nonequilibrium thermodynamics of porous electrodes with an open source code, written with a modular design to encourage use, modifications, and improvements. Through a variety of examples, we have demonstrated some of key features of the MPET software. First, we compared solid solution and phase field approaches to modeling active materials and demonstrated that the models can give similar macroscopic outputs under some situations, but deviate at the particle scale. This leads to different predictions when the surface concentrations strongly affect reaction behavior. Second, we reexamined the comparison of Stefan-Maxwell concentrated solution theory and dilute solution models of electrolyte transport in the context of electrodes made of simple phase separating particles. Under strong electrolyte limitation, the difference in the model predictions is similar to that found in electrodes with solid solution particles. Third, to highlight the ability of the software to describe unique and distinct solid models, we implemented a full cell simulation using models of graphite and iron phosphate presented in previous works. Finally, we considered the effect of changing the reaction model from the typically used Butler-Volmer to Marcus-Hush-Chidsey (MHC) reaction kinetics, based on microscopic theories of electron transfer. We demonstrated that, for some reasonably typical parameter values, the MHC reaction kinetics can look similar to Butler-Volmer reactions with a film resistance and can lead to substantial differences from the Butler-Volmer model in predicted battery behavior at high rates.
Natural extensions of this work involve implementing some of the features that other software options have and which researchers have found helpful in explaining data or better describing real systems. For example, thermal effects can substantially affect cell behavior [65,69,81,177,[180][181][182][183] and exploration of their coupling with Marcus kinetics would be interesting. More complete thermal descriptions rely on temperature profiles over more than an individual cell layer [184,185], so isothermal but non-constant temperature dependence would be a starting point. Addition of material models properly coupling the stresses to the concentration profile would also be an opportunity to study the effects of electro-mechanical models with phase separation [25,173] in porous electrodes. Other capabilities, such as simulating electrochemical impedance outputs or others of the many additions that have been made to the original model implemented by Doyle et al. [51] could also be added. For capacitive energy storage and desalination, the electrolyte model could also be extended to allow for diffuse charge in the electrode/electrolyte interface [103,105] or the double layers of charged porous separators [99][100][101][102], which also activates additional mechanisms for ion transport by surface conduction and electro-osmotic flow [99,104,186], which are neglected in traditional battery models.
In summary, MPET provides some new capabilities for battery simulation focused on recent developments in the modeling of active materials based on nonequilibrium thermodynamics. It can also serve as a starting point for other researchers beginning to study in the area to make their own modifications and investigations. By highlighting its capabilities, we have shown the value of a flexible simulation package to expand on the existing porous electrode theory and begun to examine the impact of those developments.