Introduction

In conventional alloy design to date, typically a principal metallic element is explored, accompanied by other elements in relatively minor concentrations. Such alloy design – whilst often empirical – has also been aided by thermodynamic calculations; the development and use of phase diagrams; and more recently by kinetic assessment to factor in thermally activated solid-state transformations. Whilst such approaches have developed to significant levels of sophistication, the exploration of more complicated alloy systems, of which no prior data exists, can make desktop alloy design complex1 Modern alloy exploration in the form of the so-called multi-principal element alloy (MPEAs) requires new tools and approaches to aid in their design. As the name suggests, MPEAs contain at least two (but often more, including >5), principal alloying elements. One impetus for the rapid development and research regarding MPEAs is owing to their excellent physical properties2 and more recently, reports of their aqueous corrosion resistance – amongst other atypical properties. Furthermore, other applications in which MPEAs are being explored include catalysts and battery electrodes, in addition to structural materials3. Due to the large number of possible alloying elements available for potential MPEA production, and the myriad of possible elemental combinations, the realm of MPEAs still remains heavily unexplored4. If MPEA development is to continue at an appropriate pace, conventional trial-and-error methods for alloy development must be supplemented by objective alloy design5. In addition to the need for rational alloy design based on tools that can assist in prediction of structure and perhaps key properties, the desktop computational prediction of corrosion performance remains its own challenge. To date, there are very few mechanistic or deterministic tools available that can generate computed information in a manner that can aid in prediction of electrochemical performance. In this work, a computational methodology (which is actually a computational workflow) is presented, in order to estimate the electrochemical performance of an MPEA, without the need for any empirical testing.

Integrated approaches permit computational materials discovery approaches for new (objective oriented) alloy design. To date, the calculation of phase diagrams (CALPHAD), which is based on equilibrium thermodynamics to provide information on probable equilibrium phases, is widely used; as is the use of density functional theory (DFT) to provide information on phase stability. Though CALPHAD and DFT approaches are beneficial, such approaches may be time-consuming, computationally costly and limited in what can be explored relative to properties of interest and the breadth of MPEA compositions1,6. Recently, a purely machine learning (ML) approach has been developed to accelerate the discovery of MPEAs, with a specific focus on alloy development of INVAR7. This kind of ML-based method provides the capability to build a connection between underlying physics and composition-dependent properties7,8, allowing for the selection, design and verification of new alloys to be done an order of magnitude faster. However, the lack of understanding regarding how alloy composition can impact material properties for unexplored composition space, remains a bottleneck. This level of understanding is critical for predicting which elemental combinations may yield optimal structural performance in various operational environments.

When a primary property of interest is alloy electrochemistry and/or corrosion behaviour, detailed information regarding surface features is critical – as electrochemical processes occur at the alloy surface (i.e., alloy-environment interface). Without a complete understanding of the composition-dependent surface properties in the context of electrochemistry and/or corrosion, the verification of newly designed alloys will be tedious. For instance, in alloys that develop local sites with different electrochemical activities, this may accelerate corrosion due to micro-galvanic coupling or localised pit formation9. Herein, a computational approach is proposed that combines Monte Carlo (MC) methods, high-throughput DFT, and ML – to enable virtual electrochemical characterisation of digitally designed (new) alloys. As a proof of concept, this methodology was explored for an MPEA with the equi-atomic composition AlCrTiV. This alloy was selected as a representative model system, because its electrochemical activity has been thoroughly and well-documented in the literature10,11,12,13,14. The ‘electrochemistry simulator’ is expected to describe the relationship between surface features and surface reactivity. Furthermore, the intent is to provide a pathway, if not a methodology, for data collection and verification, which would enable a knowledge-guided ML approach for materials discovery of MPEAs with tailored electrochemical properties.

Results and discussion

First-principles investigation of bulk structure

In this study – as already ascertained from the Approach section – exploration of the AlCrTiV MPEA was carried out, owing to the alloy being known to exhibit the formation of only a single (bcc) phase at room temperature, along with a reported record regarding the contribution of each element to electrochemical reactions. The results of our attempt at the prediction of dissolution characteristics for AlCrTiV, using the workflow proposed herein; follows below, including correlation with experimental data. The (MC)2 methodology accurately predicted the formation of a single bcc phase for AlCrTiV with an equi-atomic configuration and a lattice constant of 3.05 Å, with two supercells made are shown in Fig. 1a–d reveal the charge distributions of each element in the bulk AlCrTiV. Bader charge analysis revealed that Al and Cr becomes negatively charged with charges of −0.20 and −0.50 e-, while Ti and V becomes positively charged with charges of +0.63 and +0.07 e-. The final structure matched experimental data, well, with whereby the empirically determined lattice constant is 3.075 Å10. The empirical and simulated x-ray diffraction patterns for AlCrTiV crystal are shown in Fig. 1e, f.

Fig. 1: The comparison of MPEA structures from simulation and experiment.
figure 1

a, b Two final bulk MPEA supercell structures consist of 128 atoms as generated from (MC) calculations. c, d The charge distribution of MPEA supercell structures. Green, dark-blue, light-blue and red circles represent Al, Cr, Ti and V atoms, respectively. Turquoise and yellow colour isosurfaces represent the gain and loss of electrons, respectively. e X-ray diffraction pattern from a powdered sample of the as-cast AlCrTiV alloy. Reproduced with permission from Qiu et al.10. Copyright 2017 Elsevier. f Simulated x-ray diffraction patterns from two final bulk structures predicted using (MC) algorithm.

First-principles investigation of surface electrochemistry

Using the bulk AlCrTiV alloy structure predicted by (MC)2, surface slabs were generated and used to build a surface reactivity map based upon the chemical interactions between different species (i.e., H+, Cl-, and O2-) and the alloy surface. On the basis of empirical data being available for the electrochemical activity of AlCrTiV (which is from a bulk polycrystal), we selected the (001) surface for the adsorption model – as it provided 32 possible adsorption sites (i.e., atop, bridge-x, bridge-y, and hollow), along with eight vacancy sites. Furthermore, we also employed an extended supercell in order to minimise the lateral interaction between adsorbed species. Despite the species being charged in the electrolyte, we have only considered the adsorption of neutral species on the surface in our DFT calculations (*H, *Cl and *O); noting that the accounting for charge/electrons may be approached using the standard hydrogen electrode method15. To maximise atomic variation and surface structure, six different surface slabs were created for the adsorption study and a vacancy was created on the topmost layer to simulate a dissolution event at the surface. From DFT calculations, we successfully established the surface activity/selectivity that is represented using the energy map, as shown in Fig. 2.

Fig. 2: The surface activity/selectivity maps at U = 0 V and pH = 0 for different slabs.
figure 2

The maps showing the interactions of surface atoms following the adsorptions of Cl, O, H and the formation of vacancy.

The results presented in Fig. 2 provide information on the early-stage electrochemical surface activity of AlCrTiV in the presence of different adsorbates. From the calculated adsorption and vacancy energy, the local electrochemical activity on the surface is observed, in which the formation of cathodic and anodic sites can be distinguished by their selective interaction with adsorbates/vacancy. Red-coloured regions indicate strong interaction between alloy-environment, whereas blue-coloured regions indicate weak interaction between alloy-environment. Strong H-bonding surface denotes the preference of surface regions to act as cathodes, whereas strong O-bonding, Cl-bonding as well as vacancy formation denote the preference of surface regions to act as anodes. Furthermore, we can understand the dissolution mechanisms of the alloys, whether it undergoes direct or indirect dissolution via salt-formation (e.g., by the formation of metal oxide and/or metal chloride). This mapping enables surface activity/selectivity to be inspected ‘virtually’, in a manner that is usually only obtained using complex local electrochemical characterisation techniques such as scanning tunnelling microscopy (STM)16,17, whilst alternatively, the scanning vibrating electrode technique (SVET)18 or scanning electrochemical cell microscopy (SECM)19,20 provide excellent spatial resolution at an order of magnitude lower length scale. It is noted that the length scales of interrogation from the calculations herein, may also be mechanistically advantageous on the basis of prospects for nano-engineering alloy structures.

The selection of adsorbates explored was based on their critical role during surface electrochemistry (namely, alloy corrosion), such as participating in the hydrogen evolution reaction, oxide formation and thickening, surface dissolution, and pitting. From calculated surface maps, a different reactivity between may distinguish between cathodic and anodic sites on the surface. While previous studies on conventional (non MPEA) alloys have only highlighted the competitive adsorption of such species on the alloy surface as the coverage function21,22, in the present there is a deliberate focus on the interaction between those species with the different elements on the MPEA’s surface – allowing identification and analysis of their roles on the surface electrochemistry.

Figure 3 shows the least-square fitted energy values for all site adsorption on each slab (and in which data shown in Supplementary Fig. 1 shows only the atop site adsorbates). It was revealed that *O and *Cl prefer to stay close to Ti on all surfaces, except on B7 where *Cl also prefer to stay close to V. Meanwhile *H prefers to stay close to Cr on A6, A8 and B6, to V on A7, B7 and B8. From the small sampling performed, we can understand the role of each element as anodic and cathodic sites during electrochemical reactions. Ti is expected to be oxidised and formed oxide layers, the anodic site, followed by V, Cr and Al. The same order of elements for another anodic site applies for competing oxidation/dissolution via reaction with Cl-. The elemental order for cathodic site as predicted by hydrogen evolution reaction is varied from the systems studied here, in which Ti, V and Cr exhibits the capability to facilitate *H adsorption with negative energies, excluding Al with positive energy. This suggests that Al is more dominant and active towards any oxidation/anodic reaction, which is consistent with experiments12,13. Additionally, the role of Ti on the formation of protective oxide layer, including the enrichment of Ti, can be explained from its strong interaction with O2- and Cl-. The adsorption energy difference on different slabs may be used as the preference indicator for each slab tendency as being more or less anodic/cathodic, as described by the adsorption of *O and *Cl or *H, respectively.

Fig. 3: The least-square fitted \({{{E}}}_{{{Ti}}}\), \({{{E}}}_{{{v}}}\), \({{{E}}}_{{{Al}}}\) and \({{{E}}}_{{{Cr}}}\) on each slab at U = 0 V and pH = 0 for different slabs.
figure 3

a A6, b A7, c A8, d B6, e B7 and f B8.

The inspection of Fig. 3 reveals that it is difficult to clearly distinguish the contribution of each element, due to the complexity of alloy systems (i.e., in addition to chemical complexity, there is also a variation of adsorption sites, which includes the bridge and hollow sites that require the consideration of multiple atoms) – as well as the limitation of slab samples investigated in this study. We acknowledge that the electrochemical activity of each element is atypical and not solely defined by its own intrinsic features. Neighbouring atoms and a coordination network will contribute to electrochemical activity, as understood from the charge distribution of each atomic species in MPEA structure in Fig. 1c, d. Therefore, we will refrain from quantitatively focusing on feature rank and selection during the present work. The future objective development of new MPEAs with controlled electrochemical activity will require the theoretical analysis of many samples, which can also become an obstacle even in theoretical-based studies. Instead, we are more interested in the ongoing generation of datasets for training ML models to predict the electronic energy of certain surface structures. This approach will be beneficial for the generation and analysis of large surface datasets, to better understand the contribution of individual elements on surface electrochemistry – which is particularly important for MPEAs.

From the experimental work to date studying AlCrTiV, it is understood that ‘dynamic-passivity’ is a critical factor contributing to corrosion resistance of AlCrTiV; including the surface film composition, thickness and electronic properties. Various analysis tools have confirmed that AlCrTiV exhibits excellent electrochemical stability, which is attributed to the ability to form passive layer comprising of mixed metallic oxides: Al2O3, TiO2, V2O3 and Cr2O3. The experimental techniques used to study the passive film characteristics and electrochemical activity, include high resolution X-ray photoelectron spectroscopy (XPS) and atomic emission spectroelectrochemistry. Using AESEC, Choudhary et al.12,13 quantitatively recorded the dissolution and oxidation of AlCrTiV on a ‘per element’ basis. It was revealed that elemental Al was readily observed to preferentially dissolve (although the alloy has stoichiometrically equal atomic proportion of all constituent elements), as soon as the sample was exposed to the electrolyte, as shown in Fig. 4a.

Fig. 4: Experimental measurements of elemental electrochemical activity in AlCrTiV.
figure 4

a AESEC dissolution profile at OCP for AlCrTiV in quiescent 0.6 M NaCl. Reproduced under Creative Commons CC-BY license from Choudhary et al.13. b AESEC polarisation profile for AlCrTiV in quiescent 0.6 M NaCl. Reproduced with permission from Choudhary et al.12. Copyright 2020 Elsevier.

It is also revealed in Fig. 4b, that in the presence of an applied potentiodynamic polarisation, that trans-passive dissolution of V and Cr occurs, accompanied by the enrichment of Ti and its oxidation to form TiO2 on the surface12,13. Despite the high dissolution rate of elemental Al, results from detailed XPS analysis revealed that Al2O3 was the major oxide present on the surface, followed by TiO2 and then similar amounts of V2O3 and Cr2O313. The absence of mixed oxides here is also consistent with the findings of the computational study by Samin on the thermodynamics of Niobium-Titanium alloy oxidation23. In that study, it was determined that TiO2 was found to be the most stable oxide for most temperature-pressure combinations and mixed oxides were never thermodynamically favourable. Key findings from such aforementioned studies regarding corrosion resistant alloys, are that dissolution/oxidation are non-stoichiometric, that mixed-oxides are not present, and that the surface oxides also include a proportion of unoxidised (M0) metal. The causality between such characteristics and performance however remains under ongoing investigation.

Machine-learning prediction of surface electrochemistry

In the workflow outlined for this study, the utilisation of ML was then adopted to predict adsorption and vacancy energies. In a previous study, Batchelor et al. used a coordination-based representation and linear regression to predict adsorption energies of O and OH on high entropy alloys24, resulting in an RMSE of less than 0.1 eV. Nonetheless, that method was developed to solely rely on surface coordination, disregarding the identity of the adsorbed species; therefore, requiring separate models for each adsorbate. Li et al. proposed an alternative approach integrating both adsorbed species and surface slab information25, thus enabled the prediction of cross-adsorbate and cross-slab adsorption energies. That representation, however, is limited to the most stable site and does not consider specific adsorption sites or lateral interactions between adsorbates.

The present study enhances the combined representation by incorporating an additional representation for the adsorption site, enabling cross-site prediction. The improved representation is comprised of EP to represent the single-atom adsorbate (*O, *H, or *Cl in this study), SOAP to represent the high entropy alloy slabs26, and GP-CAF to represent the adsorption site27 (representation employed herein shown schematically in Fig. 5 and Supplementary Fig. 2).

Fig. 5: Schematic of the combined representation used in this study.
figure 5

Elemental properties (EP) is used as adsorbate representation, group and period-based coordination atom fingerprints (GP-CAF) as adsorption site representation and smooth overlap atom position (SOAP) as slab representation. a The representations used for the adsorption study and (b) the representation used for the vacancy study.

Figure 6a-c compare the ML-predicted adsorption energies and DFT calculated values using 5-fold cross validation test, and leave-one-slab-out test (LOSO) with 20% samples from the test slab added to the training set. The 5-fold cross validation test results show a strong correlation between the ML predictions and DFT calculated values, with a mean average error (MAE) of 0.197 eV, highlighting the effectiveness of our model. In practice, it is desirable for ML methods to have good cross-slab prediction capabilities, as predicting the adsorption activity on new MPEAs is a key goal of these calculations. The LOSO test was designed to evaluate the model’s cross-slab prediction abilities, as seen in Fig. 6b. This test resulted in a higher MAE compared to 5-fold cross validation test and worse predictions for outliers, such as the B6 slab, where the ML model systematically underestimated the adsorption energies. However, our model accurately distinguished high and low adsorption energies on the test slab, indicating its ability to correctly identify the most stable adsorption site. The accuracy of LOSO test can be improved by adding 20% samples from the test slab to the training set, as shown in Fig. 6c, and would likely to be improved with more slabs in the training set as there are only 6 slabs in this study.

Fig. 6: ML-predicted adsorption and vacancy energies against DFT-calculated adsorption and vacancy energies using different approaches.
figure 6

a Five-fold cross-validation and b leave-one-slab-out test, c leave-one-slab-out with 20% samples from the test slab added to the training set for the adsorption energies prediction. d Five-fold cross validation, e leave-one-slab-out test for vacancy and f leave-one-slab-out with 25% samples from the test slab added to the training set for the vacancy energies prediction.

Besides testing the performance of the ML model in predicting adsorption energies, we also evaluated its capability in predicting vacancy energies. Figure 6d–f shows a comparison between the ML-predicted adsorption energies and DFT calculated values, using 5-fold cross validation test, LOSO, and LOSO with 25% samples added from the test slab to the training set (25% means 2 samples on test slab considering there are 8 vacancy sites on each slab). Similar to the adsorption energy prediction, the model performed best using 5-fold cross validation test, as the training and test set have similar distributions. Also, LOSO test was significantly worse than 5-fold cross validation testing and could be improved by adding 25% samples from the test slab to the training set.

Integrated computational approaches as a surface electrochemistry simulator

We have shown the capability of ML to replace the use of high-throughput DFT for providing data on the reactivity of the surface models of an alloy. Such results demonstrate the effectiveness of ML modes in accurately predicting adsorption of different species and vacancy energies on MPEA. The key findings from the work herein include:

  1. (i)

    the application of the (MC)2 approach was capable of providing a platform for subsequent DFT and ML approaches – that are relevant to the determination of electrochemical properties – where the prediction of electrochemical properties has notionally been historically challenging to model,

  2. (ii)

    the workflow herein provides a visual, spatial map of electrochemical properties from calculations entirely in-silico,

  3. (iii)

    all elements in AlCrTiV exhibit atypical properties due to different charge distributions in MPEA compared to their pristine crystal structure, in which Al exhibits spontaneous formation of vacancy in AlCrTiV alloy that is well validated by independent empirical data12,13 with the observation of high Al dissolution rate,

  4. (iv)

    the simulations were also able to ascertain that for AlCrTiV, Ti has the most important contribution on the formation of protective oxide species such as TiO2,

  5. (v)

    the use of DFT and ML to model and predict AlCrTiV surface activity/selectivity by considering different species, which are critical for reduction oxidation reactions, enable the investigations of nano-scale electrochemical reactions on a complex surface.

Whilst we believe the above findings, and the pathway to obtaining such computational results regarding surface electrochemistry are significant, it is also prudent to identify some of the physical limitations. It requires future work, in order to gain the most benefit from such approaches when applied to rationalising MPEA behaviour. Some points that remain open and will be the focus of future studies include:

  • As also noted in this study, the corrosion performance of MPEAs is closely linked to the nature of the surface films. The modelling approach herein is in part, a proxy to studying surface films on the basis that the modelling approach deals with a ‘snapshot’ in time for an alloy surface (whereas surface films develop dynamically). The model is indeed a major simplification of the MPEA-electrolyte interface, as it presently stands – however this is typical for any early model that may evolve in complexity.

  • The numbers of sample for MPEA’s surface, AlCrTiV, studied here using DFT are small. Large datasets are necessary to make any conclusive statement regarding elemental’s role on the electrochemical reactions in-silico and to accurately distinguish anodic and cathodic regions on the surface.

  • Additional features, such as different crystallographic orientations, explicit modelling of electrolyte system including cations and anions21,28, explicit treatment of temperature, pH and applied potential21,29, will be beneficial for a more accurate prediction of MPEA’s electrochemical activity as well as to understand multiple competing reactions on the surface. A detailed investigation on competing adsorptions in changing pH and applied potential21,22 either implicitly (as described using Eqs. 58) or explicitly, can give insights on the subsequent pathway (i.e., atomic dissolution, hydrogen evolution reaction, oxide formation).

  • Large datasets are highly appreciated to improve the performance of our ML prediction algorithm, which will be the key of such an on-the-fly approach.

The approach outlined in the study herein, whilst applied to only a single empirical benchmark, has provided a computation workflow that may be utilised as a virtual electrochemical characterisation tool. Such a tool has the capacity to predict and therefore estimate the electrochemical properties of MPEAs in-silico, by considering composition, crystallographic orientation, and number of samplings. As a result, the computation workflow herein introduces a cheaper and faster approach to garner an insight into electrochemical properties of new MPEAs with tuned composition and phase, designed entirely from simulations; with MPEAs revealing promising electrochemical performance laboratory verified accordingly.

Herein, a methodology has been presented for generating realistic MPEA structures for AlCrTiV, using implementation of the (MC)2 algorithm for the investigation of electrochemical activity and development of activity/selectivity maps. Furthermore, the work herein reports on the development and utilisation of an ML method which capable of predicting surface electrochemical activity via adsorption and vacancy energies. The findings for the surface activity/selectivity of AlCrTiV (001) are based on the investigation of six surface models originating from two bulk models, which are expected to give a general and reproducible trend. Independent detailed experiments were used to correlate and verify the electrochemical properties of the AlCrTiV MPEA, derived from the simulations herein - in which Ti has the most important contribution on the formation of protective oxide species such as TiO2.

The combined (MC)2 and DFT/ML approach presented in this work is a potential candidate for intelligently exploring vast numbers of elemental combinations (MPEA compositions); which is both critical and necessary in providing an in-silico insight for rationalising structure-electrochemistry relationships. The robustness of the ML approach for replacing costly DFT calculations for the collection of ‘electronic energies’ opens opportunities for investigating a much larger number of surface models, which will increase accuracy for prediction of MPEA surface electrochemistry. One of the key features is the identification of active sites or the role of each element in a MPEA via the construction of an electrochemical activity/selectivity map. Such mechanistic understanding is beneficial for building an improved electrochemistry microkinetic model for MPEAs, in which reactions are non-uniform, and each reaction is sensitive to local surface features. The approach developed herein is readily applicable for the design and application to other MPEAs.

Methods

A state-of-the-art hybrid MC and DFT approach was employed in order to develop MPEA models sampled from equilibrium30. Herein, the ability to predict electrochemical activity of an MPEA using computer simulation was investigated. Three stages were employed in this workflow (Fig. 7).

Fig. 7
figure 7

The overall workflow of virtual electrochemistry simulation performed in this study and its verification.

The phase and composition at equilibrium were obtained using the multi-cell Monte Carlo (MC)2 method. Specifically, the existing MC code, based on a methodology proposed by Ghazisaeidi31, was utilised in order to predict stable phases and phase fractions for an MPEA of choice and a given set of conditions (temperature and pressure). Using an (MC)2 predicted structure, we then generated surface slabs, and performed high-throughput DFT calculations to understand the reactivity of these surfaces in aqueous environments - ahead of developing machine-learning (ML) models to predict the DFT-derived electronic energy. This was followed by a survey of surface electrochemical activity on (001) AlCrTiV surfaces with different surface features (of both the ratio and the combination of elements). We carefully investigated their selectivity and electronic response toward different species in aqueous media, including H+, O2- and Cl-. We used combined representation of elemental properties (EP)25, smooth overlap atom position (SOAP)26 and group and period-based coordination atom fingerprints (GP-CAF)27,32 to predict the electrochemical activity: passive film formation and surface dissolution from a combination of different MPEA surfaces.

Bulk calculations (MC)2 method

The bulk structure was generated using an implementation30 of the (MC)2 algorithm31,33,34. The simulation was performed at T = 300 K, P = 0 Pa. This condition was chosen to obtain realistic models of AlCrTiV with composition and phase similar to the experiments10. Four simulation cells were initialised with 64 atoms per cell in the initial configurations of body-centred cubic (bcc), hexagonal close packed (hcp), and face-centred cubic (fcc), respectively. During the simulation, two types of moves were considered, a local flip or intra-swap. A local flip is described as randomly selecting one of the four simulation cells, then randomly selecting one atom within the chosen simulation cell, and flipping it from its current species type to one of the other four species types. The intra-swap consists of randomly selecting one of the four simulation cells, then randomly selecting two atoms whose positions are swapped. The algorithm has been constructed to only perform an intra-swap between two atoms of different types and should a simulation cell become 100% of one species, the intra-swap move is rejected. DFT calculations were executed to calculate simulation cell internal energy and volume changes, with the simulation was performed at T = 0 K and P = 0 Pa. The entropy correction by temperature effects was considered from the configurational entropy. The acceptance probabilities, based on the Metropolis criteria35, for the local flip and intra-swap, are given in the following formulas respectively.

$${{\rm{P}}}_{{\rm{accept}}}^{{\rm{flip}}}=\min \left\{1,\exp \left(-{{\upbeta }}\Delta {\rm{H}}+{\rm{N}}\Delta {{\rm{G}}}_{{\rm{m}}}\right)\right\}$$
(1)

where ∆\({\rm{H}}\) and ∆Gm are calculated as follows:

$$\Delta {\rm{H}}={\rm{m}}\mathop{\sum }\limits_{{\rm{i}}=1}^{{\rm{m}}}\left({{\rm{U}}}_{{\rm{i}}}^{{\prime} }+{\rm{p}}{{\rm{V}}}_{{\rm{i}}}^{{\prime} }\right){{\rm{f}}}_{{\rm{i}}}^{{\prime} }-\mathop{\sum }\limits_{{\rm{i}}=1}^{{\rm{m}}}({{\rm{U}}}_{{\rm{i}}}+{\rm{p}}{{\rm{V}}}_{{\rm{i}}}){{\rm{f}}}_{{\rm{i}}}$$
(2)
$$\begin{array}{l}\Delta {{\rm{G}}}_{{\rm{m}}}={\rm{m}}\mathop{\sum }\limits_{{\rm{i}}=1}^{{\rm{m}}}\left[{{\rm{f}}}_{{\rm{i}}}^{{\prime} }\mathrm{ln}\left({{\rm{V}}}_{{\rm{i}}}^{{\prime} }\right)-{{\rm{f}}}_{{\rm{i}}}\mathrm{ln}\left({{\rm{V}}}_{{\rm{i}}}\right)\right]+\mathop{\sum }\limits_{{\rm{i}}=1}^{{\rm{m}}}{{\rm{f}}}^{{\rm{\text{'}\; i}}}\mathop{\sum }\limits_{{\rm{i}}=1}^{{\rm{m}}}{{\rm{X}}}_{{\rm{j}}}^{{\rm{\text{'}\; i}}}\mathrm{ln}\left({{\rm{X}}}_{{\rm{j}}}^{{\rm{\text{'}\; i}}}\right)\\ \qquad\quad -\,\mathop{\sum }\limits_{{\rm{i}}=1}^{{\rm{m}}}{{\rm{f}}}^{{\rm{i}}}\mathop{\sum }\limits_{{\rm{i}}=1}^{{\rm{m}}}{{\rm{X}}}_{{\rm{j}}}^{{\rm{i}}}\mathrm{ln}\left({{\rm{X}}}_{{\rm{j}}}^{{\rm{i}}}\right)\end{array}$$
(3)

Here, \({\rm{\beta }}=1/{k}_{{\rm{B}}}{\rm{T}}\), where \({k}_{{\rm{B}}}\) is the Boltzmann constant, N is the sum of all the particles across all simulation cells, m is the total number of simulation cells, \({{\rm{U}}}_{{\rm{i}}}\) is the energy of simulation cell i, \({{\rm{V}}}_{{\rm{i}}}\) is the volume of simulation cell i, p is the pressure (set to 0 Pa) and \({{\rm{f}}}_{{\rm{i}}}\) is the molar fraction of simulation cell i. Lastly, where \({{\rm{n}}}_{{\rm{j}}}^{{\rm{i}}}\) is the number of species i in simulation cell j, \({{\rm{X}}}_{{\rm{j}}}^{{\rm{i}}}={{\rm{n}}}_{{\rm{j}}}^{{\rm{i}}}/{\sum }_{{\rm{k}}=1}^{5}{{\rm{n}}}_{{\rm{j}}}^{{\rm{k}}}\), and represents the atomic concentration of species i in simulation cell j. The primed coordinates indicate post-flipped values, while un-primed are pre-flipped values. The updated phase fractions were obtained by using the Lever rule to enforce mass conservation.

DFT calculations were performed using the Projector Augmented Wave (PAW) method as implemented by the Vienna Ab initio Simulation Package (VASP)36,37. The calculations were completed with a plane-wave cut-off energy of 450 eV and a 2 × 2 × 2 Monkhorst-Pack k-point mesh38. DFT calculations performed on the simulation cells allowed for changes in the volume and atomic positions (through setting ISIF = 3). The electronic self-consistent calculation was converged to 1 × 10−6 eV and ionic relaxation steps were performed using the conjugate-gradient method (IBRION = 2) and continued until the total force on each atom dropped below a tolerance of 1 × 10−2 eV Å−1. The generalised gradient approximation (GGA) was used for the exchange correlation functionals as parameterised by Perdew-Burke and Ernzerhof (PBE)39. The PAW pseudopotentials were used with the valence electron configurations 3s23p1, 3d34s1, 3d54s1, and 3p63d44s1 for Al, Ti, Cr and V, respectively.

Surface DFT Calculation Method

All surface DFT calculations were performed using the VASP code;36 and core electrons in calculations treated using both the the PAW method and the GGA-PBE exchange correlation functionals37,39. A plane-wave cut-off energy of 500 eV and a 3 × 3 × 1 Monkhorst-Pack k-point mesh38. The electronic self-consistent calculation was converged to 1 × 10−5 eV and ionic relaxation steps were performed using the conjugate-gradient method (IBRION = 2) and continued until the total force on each atom dropped below a tolerance of 1 × 10−2 eV Å−1. A slab method with 20 Å vacuum thickness in z-direction was used to model (2 × 1) (001) surface and different slab thickness of 6, 7 and 8 layers were considered. During surface relaxation, the four uppermost layers were allowed to relax, while the others were fixed to their bulk coordinates, inducing a surface-bulk condition. Figure 8 shows the surface of AlCrTiV MPEA which is used as the model system explored in this study. A simplified model for local electrochemistry investigation using DFT was used – with the construction of slab and adsorbate, neglecting the influence of electrical double layer.

Fig. 8: Six different (001) surfaces of AlCrTiV bcc phase as obtained from (MC)2 optimisation.
figure 8

Four identified adsorption sites used for high-throughput DFT calculations of surface reactivity.

Vacancy calculations were performed by removing one atom in the topmost layer on each slab. Whereas, for surface adsorption calculations, the adsorbates studied are *H, *O and *Cl, in their dissociated forms21,40. The adsorption study only considered single species adsorption (no co-adsorption on the surface) in each DFT calculation, in which each species on the adsorption sites was fixed in their planar (x and y) direction and only allowed relax in z-direction to find their lowest energy state. A less strict convergence criteria with total force tolerance of 5 × 10−2 eV/Å was used to perform the scanning of surface activity/selectivity.

The adsorption energy is calculated using the following formula:

$${\Delta {\rm{E}}}_{{\rm{ads}}}={{\rm{E}}}_{{\rm{ads}}-{\rm{slab}}}-{{\rm{E}}}_{{\rm{slab}}}-{{\rm{E}}}_{{\rm{adsorbate}}}$$
(4)

where \({{\rm{E}}}_{{\rm{ads}}-{\rm{slab}}}\) is the energy of adsorbate/slab complexes, \({{\rm{E}}}_{{\rm{slab}}}\) is the energy of a pure slab and \({{\rm{E}}}_{{\rm{adsorbate}}}\) is the energy of the adsorbate. Here is \({{\rm{E}}}_{{\rm{adsorbate}}}\) of H, O and Cl are defined as ½ E(H2), E(H2O) – E(H2) and E(HCl) – ½ E(H2), respectively. The influence of applied potential (U vs. SHE) and pH on ΔG can be considered implicitly21,29, using the following mechanism:

$$* +{{\rm{H}}}^{+}+{{\rm{e}}}^{-}\to {}^{*}{\rm{H}}$$
(5)
$$* +{{\rm{H}}}_{2}{\rm{O}}+{\rm{HCl}}\to {}^{* }{\rm{O}}+{\rm{HCl}}+{2{\rm{H}}}^{+}+{2{\rm{e}}}^{-}$$
(6)
$$* +{{\rm{H}}}_{2}{\rm{O}}+{\rm{HCl}}\to {}^{* }{\rm{Cl}}+{{\rm{H}}}_{2}{\rm{O}}+{{\rm{H}}}^{+}+{{\rm{e}}}^{-}$$
(7)

The scope of this study was to investigate the role of each element in MPEA’s surface and not to study the competitive adsorption mechanism of different species under the influence of pH and potential. Steady-state assumption, such as used in previous studies21,29, is beneficial for better understanding the effect of different pH and potential on the electrochemical activity. Herein, we have only focused on developing a capability for predicting electronic energies for calculating adsorption and vacancy formation energies using ML approach, with the goal of replacing DFT calculations and enabling high-throughput computations; which also employed bulk phase structures obtained from the (MC)2 algorithm.

All DFT calculations performed herein employed the static DFT method with no time dimension, for: i) predicting bulk compositions and phases of MPEA using (MC)2 algorithm and ii) benchmarking electronic energies for adsorption and vacancy formation on the MPEA’s surface for the use in ML prediction algorithm. It is conceded that electrochemical reactions mechanism may not be fully understood from this study, since we do not perform dynamic DFT calculations that consider the effects of time. Nonetheless, we were primarily interested in determining correlations between collected descriptors (i.e., adsorption and vacancy formation energies as the function of elemental surface and coordination number) and the electrochemical properties (i.e., passivation behaviour and corrosion rate). At this stage, the study was focused on gathering surface activity/selectivity for an MPEA by developing a methodology, which later could be used for the prediction of electrochemical properties.

To identify the contribution of each element to the final adsorption energy, the following formula was fit to inference each element’s contribution:

$${{\rm{m}}}_{{\rm{Ti}}}{{\rm{E}}}_{{\rm{Ti}}}+{{\rm{m}}}_{{\rm{V}}}{{\rm{E}}}_{{\rm{V}}}+{{\rm{m}}}_{{\rm{Al}}}{{\rm{E}}}_{{\rm{Al}}}+{{\rm{m}}}_{{\rm{Cr}}}{{\rm{E}}}_{{\rm{Cr}}}=\Delta {\rm{E}}$$
(8)

where \({{\rm{m}}}_{{\rm{Ti}}}\), \({{\rm{m}}}_{{\rm{v}}}\), \({{\rm{m}}}_{{\rm{Al}}}\), \({{\rm{m}}}_{{\rm{Cr}}}\) are the total sum scaling normalised coordination number, which are calculated according to:

$${\rm{m}}_{\rm{Ele}}=^{\,{\rm{n}}_{\rm{Ele}}}\!{/}_{({{\rm{n}}}_{{\rm{Ti}}}+{{\rm{n}}}_{{\rm{V}}}+{{\rm{n}}}_{{\rm{Al}}}+{{\rm{n}}}_{{\rm{Cr}}})}\,{\rm{for}}\; {\rm{Ele}}\; {\rm{in}}\,\{{\rm{Ti}},{\rm{V}},{\rm{Al}},{\rm{Cr}}\}$$
(9)

where \({{\rm{n}}}_{{\rm{Ti}}}\), \({{\rm{n}}}_{{\rm{V}}}\), \({{\rm{n}}}_{{\rm{Al}}}\), \({{\rm{n}}}_{{\rm{Cr}}}\) is the number of coordinated Ti, V, Al, and Cr elements, respectively. \(\Delta {\rm{E}}\) is the DFT calculated adsorption energy of each mono atom adsorbate. \({{\rm{E}}}_{{\rm{Ti}}}\), \({{\rm{E}}}_{{\rm{V}}}\), \({{\rm{E}}}_{{\rm{Al}}}\), \({{\rm{E}}}_{{\rm{Cr}}}\) are the energy values that are fit using the least-squares method. Specifically, the following expressions were employed: \(\Delta {\rm{E}}=1{{\rm{E}}}_{{\rm{Ti}}}\) for adsorption on Ti top site, \(\Delta {\rm{E}}=0.5* {{\rm{E}}}_{{\rm{Ti}}}+0.5* {{\rm{E}}}_{{\rm{Al}}}\) for adsorption on Ti and Al bridge site and \(\Delta {\rm{E}}=0.25* {{\rm{E}}}_{{\rm{Ti}}}+0.25* {{\rm{E}}}_{{\rm{Al}}}+0.25* {{\rm{E}}}_{{\rm{V}}}+0.25* {{\rm{E}}}_{{\rm{Cr}}}\) for Ti, Al, V and Cr hollow site.

It is noted that herein, the vacancy energy is calculated by the following formula:

$${{\rm{E}}}_{{\rm{Vacancy}}}={{\rm{E}}}_{{\rm{SlabwVac}}}-{{\rm{E}}}_{{\rm{SlabwoVac}}}-{{\rm{E}}}_{{\rm{VacE}}}$$
(10)

where \({{\rm{E}}}_{{\rm{SlabwVac}}}\) is the energy of slab with vacancy, \({{\rm{E}}}_{{\rm{SlabwoVac}}}\) is the energy of slab without vacancy and \({{\rm{E}}}_{{\rm{VacE}}}\) is the reference energy of element.

When comparing the vacancy energies of different elements, the \({{\rm{E}}}_{{\rm{VE}}}\) plays a crucial role. In the present work, we have compared three differently defined approached to \({{\rm{E}}}_{{\rm{VacE}}}\), namely: (1) the energy per atom of different elements in their pure crystal structure at room temperature; (2) the energy obtained by fitting the function \(\sum _{{\rm{i}}\in \left\{{\rm{Ti}},{\rm{V}},{\rm{Al}},{\rm{Cr}}\right\}}{{\rm{n}}}_{{\rm{i}}}{{\rm{E}}}_{{\rm{i}}}={{\rm{E}}}_{{\rm{total}}}\) for all vacancy and pure slabs in this study; and (3) the energy per atom in the high entropy alloy primary crystal, which serves as a universal correction value. Figure 9 reveals the vacancy energy using different vacancy element reference energy. It was determined that V generally has the lowest vacancy energy using both the pure crystal structure energy and fitting energy, indicating that V is the element that could most easily form a vacancy. When comparing the magnitude of all three methods, the crystal structure atomic energy has the vacancy energy ranges in 0.0–2.5 eV, in comparison to −3.0 – 4.5 eV using fitted atomic energy (2nd method) and −3.0-2 eV using HEA average atomic energy (3rd method). However, for the AlCrTiV MPEA, empirical work by Choudhary12,13 conducted atomic emission spectro-electrochemistry (AESEC)41 dissolution profiling at the open circuit potential, revealing alloy dissolution kinetics in the following order: Al, V, Cr/Ti. In other words, the highest rate of dissolution in a 0.6 M NaCl solution was observed for Al, and the lowest rate was for the dissolution of Cr and Ti13. Therefore, the calculation using approach (3), is mechanistically the most appropriate in this work. This is also supported by the changes of charge distribution of each element in AlCrTiV when compared to their pure bulk phases, as shown in Fig. 4c, d. Moreover, this method provides a similar trend with Al as the most energetically favourable element to create a surface vacancy (Fig. 9).

Fig. 9: The DFT-calculated vacancy energy determined using different vacancy reference energies.
figure 9

a The energy per atom of vacancy element in its pure crystal structure at a room temperature. b The energy per atom obtained by fitting the function \(\sum _{{i}\in \left\{{\rm{Ti}},{\rm{V}},{\rm{Al}},{\rm{Cr}}\right\}}{{n}}_{{i}}{{E}}_{{i}}={{E}}_{{\rm{total}}}\) for all slabs in this study. c The energy per atom in the MPEA primary crystal, which serves as a universal correction value.

ML for Surface Activity/Selectivity Prediction

In this study, we employed Kernel Ridge Regression (KRR)42, a fast and accurate regression algorithm25,27,43, as the ML algorithm utilised since it demonstrated high accuracy with a small number of samples ( < 1000). The radial basis function (rbf) kernel was used to transform the representations of \({\rm{i}}\)th and \({\rm{j}}\)th samples into a kernel matrix \({\rm{K}}\). The element in row \({\rm{i}}\) and column \({\rm{j}}\) of \({\rm{K}}\) is calculated using the following formula:

$${\rm{K}}\left({\rm{i}},{\rm{j}}\right)=\exp \left({\,}^{-{\left({{\rm{x}}}_{{\rm{i}}}-{{\rm{x}}}_{{\rm{j}}}\right)}^{2}}{/}_{2{\rm{\gamma }}^{2}}\right)$$
(11)

where \({{\rm{x}}}_{{\rm{i}}}\) and \({{\rm{x}}}_{{\rm{j}}}\) represent the representations of the \({\rm{i}}\)th and \({\rm{j}}\)th samples, \({\rm{\gamma }}\) is a length scale parameter.

The prediction form of KRR is as follow:

$${{\rm{y}}}_{{\rm{pred}}}={\rm{Kw}}$$
(12)

where w is a weight matrix, K is the kernel matrix.

The loss function of KRR is a quadratic function given by the following formula:

$${\rm{loss}}={{\rm{||}}{{\rm{y}}}_{{\rm{true}}}-{\rm{Kw||}}}_{2}^{2}+{\rm{\alpha }}/2{{\rm{w}}}^{{\rm{T}}}{\rm{Kw}}$$
(13)

where \({{\rm{y}}}_{{\rm{true}}}\) is the labels of the training set, α is a L2 regularisation term. A closed form solution of the loss function can be derived, as follow:

$${\rm{w}}={\left({\rm{K}}+{\rm{I}}{\rm{\alpha }}\right)}^{-1}{\rm{y}}$$
(14)

To find the optimal hyperparameters γ and α, a grid search technique was employed. We searched for the optimal values using a base-2 logarithmic grid from 0.25 to 4096 for the kernel width and a base-10 logarithmic grid from 10e−7 to 10e−7 for the L2 regularisation term.