Tutorial 11: Electrified electrode-electrolyte interfaces under potentiostatic control¶
Version: all versions Brad Ayers; Arihant Bhandari
Introduction¶
This tutorial endeavours to provide a comprehensive and illustrative example, highlighting ONETEP's ability to conduct potentiostatic calculations through the utilisation of a grand canonical DFT algorithm 4. Alongside this written tutorial we have provided a Jupyter notebook that will guide you through the process of setting up and analysing a potentiostatic calculation.
Moreover, this tutorial will demonstrate the feasibility of conducting these calculations within a solvent and electrolyte medium, employing the Fisicaro soft-sphere continuum model 2 for solvation and the neutralisation via the grand canonical electrolyte (NECS) model 1.
Setting up the calculations¶
We will begin this tutorial by creating lithium surfaces using a tool of your preference. For the purpose of illustration, we have employed the ASE 3 to generate a 10-layer BCC [100] lithium surface. This can be simply visualised within the provided Jupyter notebook, and will look as follows:
Notably, in this tutorial, we've chosen a (3x3x10) supercell with a 50 Å vacuum in total, a decision that allows us to employ 9 Bohr NGWF radii, whilst ensuring ample volume for sufficient electrolyte to neutralise our surface.
Input files¶
For the purposes of this tutorial ONETEP will require only two files to work:
- A .dat file, which contains all the information about your system (Atomic positions & Lattice vectors), as well your simulation parameters.
- A Pseudopotential file, here we will employ the Norm-conserving on the fly generated CASTEP ones, but this is up to the users discretion.
Both of the aforementioned files, as well as a few output files can be downloaded below:
Note that the output files required for the visualisation section of this tutorial will have to generated by the user themselves, and will need to be copied to the same directory as the Jupyter notebook.
Furthermore, Li_surface.dat is the .dat file used for your job submission, and Keywords.dat is simply the keywords that are taken in by the ASE script to generate said Li_surface.dat file.
The Dat file¶
grand canonical Parameters¶
Upon opening the provided Li.dat file, you will encounter the standardx parameters that ONETEP users are already familiar with: Task
, Cutoff_energy
, Lattice_cart
, and Positions_frac
.
However, after these, a new section of interest awaits, aptly named:
1 2 3 4 5 6 |
|
Within the grand canonical formalism in ONETEP, there are two main parameters of interest:
- Chemical Potential of the Reference Electrode
Represented as \(\mu_{\mathrm{e}}^{\mathrm{ref}}\), this value (-1.20 eV in this example) corresponds to the reference electrode's chemical potential. It serves as the benchmark against which all applied potentials are measured.
- Applied Potential to the Working Electrode
In this case, a potential of 0.20 volts (\(U\)) is applied to the working electrode, giving us a working electrode potential of -1.40 eV (\(\mu_{\mathrm{e}}\)).
These parameters find application in the following equations:
- Chemical Potential of the Working Electrode ($\mu_{\mathrm{e}}):
- Number of Electrons (\(N_e\)):
- Charge on the System (\(q\)):
Hence, by defining the applied potential and reference electrode potential, we can establish the chemical potential of the working electrode. It is worth noting here that only with zero applied potential (\(U = 0\)) and the reference value set to the potential of zero charge (\(\mu_{\mathrm{e}}^{\mathrm{ref}} = \mu_{\mathrm{e}}^{\mathrm{PZC}}\)) will we get zero charge on the system (\(q = 0\)).
As a result, we gain the ability to compute the number of electrons within our system using the Fermi-Dirac distribution. Where, \(\epsilon\) corresponds to the eigenvalues of the KS-equations, and \(\mu_{\mathrm{e}}\) is the chemical potential of our working electrode. Thereby allowing us to accurately calculate the charge present in the quantum system for a given applied potential.
For a more detailed explanation of the grand canonical formalism, please refer to 4.
Solvation Parameters¶
This section will highlight some of the more unintuitive parameters that are required to conduct a solvated calculation. They will be presented in the order in which they appear in the data file as done for the grand canonical parameters above.
This block will highlight the solvation parameters themselves, with the following block highlighting the solvent parameters
1 2 3 4 5 |
|
For a much more detailed overview of each key parameter and its function, please refer to the documentation here: Solvent and Electrolyte model.
For the solvent itself we have the following parameters:
1 2 |
|
Obviously these values will vary depending on the solvent of choice, and can be found in the literature.
Electrolyte Parameters¶
1 2 3 4 |
|
The above parameters are required to conduct electrolyte calculations, and are fairly self-explanatory. However, it is worth noting that there are several neutralisation schemes available, and the one chosen here is recommended for most cases.
Additionally, the following parameters are required by DL_MG to conduct the multigrid calculations:
1 2 3 4 5 |
|
These parameters are fairly ubiquitous, and are not expected to change between calculations. For further information, please refer to the documentation here: DL_MG.
lastly, we have the following ions block, that define our electrolytes and their concentrations:
1 2 3 4 |
|
Note that additional blocks can be added here to further adapt the model such as defining the soft-sphere radii of your system.
Analysis¶
Now that we have established the parameters required to conduct a solvated calculation, we can proceed to analyse the results obtained from either your own calculations or the provided ones.
The first file of interest is the Li.out
file, which contains the usual ONETEP output you might be familiar with, but will include additional that are of interest to us.
Firstly within CG-DFT inner loop, we can find the following:
1 2 3 4 5 6 7 8 9 10 11 |
|
If users are familiar with the canonical inner loop printing this will look familiar, however, there are a few key differences:
- Grand Potential (\(L=E-TS-\mu_{\mathrm{e}}N\)):
This is the grand potential of the system, and is the quantity that is minimised in the grand canonical formalism, rather than the Helmholtz free energy as in the canonical formalism.
- Chemical Potential of the Working Electrode (\(-\mu_{\mathrm{e}}N\)):
This is the chemical potential of the working electrode, and is the quantity that is constant in the grand canonical formalism, in direct contrast to the canonical formalism, where the number of electrons is constant.
-
Charge on the System (\(q\)):
This is the charge on the quantum system and is an important value to consider when analysing the results of a potentiostatic calculation, as surface chemistry is dependent on the charge of one's system.
Another crucial section of the Li.out
file is the bulk concentration of the electrolyte species, which can be found in the following section:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
This tells the user the bulk concentration of each species required to neutralise the surface. Note however as this is a grand canonical neutralisation we can have average concentrations greater than 1M. This is due to grand canonical neutralisation alowing for a changing number of species in the system, ensuring that the surface is neutralised at all times.
A final note here is as our calculations are performed within in solvent & electrolyte additional energy components are added to the energy breakdown printed at the end our calculations:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
We won't delve into the details of each energy component here, but it is worth noting that the solvent and electrolyte contributions are present in the energy breakdown. For a more detailed explanation of each energy component, please refer to 4.
visualisation¶
Whilst a majority of the analysis can be conducted using the Li.out
file provided, there are a few visualisations that can be conducted using the user generated Li_out_bion_conc_species_1.dx
and Li_out_bion_conc_species_2.dx
files.
Such as plotting the xy-averaged concentration profiles of the electrolyte species, it is worth stating that all code used to generate these plots can be found in the provided Jupyter notebook.
Looking at the figure above we can see that the concentration of the lithium electrolyte species is highest (12M) at the surface of the electrode, and decreases as we move away from the surface, forming a double layer along our surface. In contrary we can observe the PF6 electrolyte species has a concentration approaching 0M at the surface, and increases as we move away from the surface, note that these are local concentrations and not bulk concentrations.
We can also visualise the densities of our lithium slab and the electrolyte species to illusrate this double layer effect by adding the Li_out_bion_density_total.dx
and Li_in_rho.dx
files together and running the provided code:
Here we can see that there is a positive charge denisty (our lithium ions) at the surface of the electrode, that diffuses in intensity as we move away from the surface.
Where to go next?¶
This tutorial has provided a brief overview of the grand canonical formalism, and how it can be employed to conduct potentiostatic calculations, as well as highlighting a few key visualisation techniques that can be conducted on the output files.
However, there are a few key areas that have not been covered in this tutorial that the reader should explore, such as:
- Defining their reference potentials (\(\mu_{\mathrm{e}}^{\mathrm{ref}}\)):
In this tutorial, we have defined the reference potential as -1.20 eV, however, this value is dependent on the reference electrode of choice, and can be found in the literature or by calculating one's own reference potential using the method highlighted in 4.
- Cycling through potentials:
In this tutorial, we have only conducted a single potentiostatic calculation, however, it is possible to conduct a series of calculations at different potentials, and calculate properties such as capacitance etc.
References¶
-
Bhandari, A.; Anton, L.; Dziedzic, J.; Peng, C.; Kramer, D.; Skylaris, C.-K. Electronic Structure Calculations in Electrolyte Solutions: Methods for Neutralization of Extended Charged Interfaces. The Journal of Chemical Physics 2020, 153 (12), 124101. https://doi.org/10.1063/5.0021210. ↩
-
Fisicaro, G.; Genovese, L.; Andreussi, O.; Mandal, S.; Nair, N. N.; Marzari, N.; Goedecker, S. Soft-Sphere Continuum Solvation in Electronic-Structure Calculations. Journal of Chemical Theory and Computation 2017, 13 (8), 3829–3845. https://doi.org/10.1021/acs.jctc.7b00375. ↩
-
Hjorth Larsen, A.; Jørgen Mortensen, J.; Blomqvist, J.; Castelli, I. E.; Christensen, R.; Dułak, M.; Friis, J.; Groves, M. N.; Hammer, B.; Hargus, C.; Hermes, E. D.; Jennings, P. C.; Bjerre Jensen, P.; Kermode, J.; Kitchin, J. R.; Leonhard Kolsbjerg, E.; Kubal, J.; Kaasbjerg, K.; Lysgaard, S.; Bergmann Maronsson, J. The Atomic Simulation Environment—a Python Library for Working with Atoms. Journal of Physics: Condensed Matter 2017, 29 (27), 273002. https://doi.org/10.1088/1361-648x/aa680e. ↩
-
Bhandari, A.; Peng, C.; Dziedzic, J.; Anton, L.; Owen, J. R.; Kramer, D.; Chris-Kriton Skylaris. Electrochemistry from First-Principles in the grand canonical Ensemble. Journal of Chemical Physics 2021, 155 (2). https://doi.org/10.1063/5.0056514. ↩↩↩↩