## Abstract

We present a study of the structure and differential capacitance of electric double layers of aqueous electrolytes. We consider electric double layer capacitors (EDLC) composed of spherical cations and anions in a dielectric continuum confined between a planar cathode and anode. The model system includes steric as well as Coulombic ion-ion and ion-electrode interactions. We compare results of computationally expensive, but “exact” , Brownian Dynamics (BD) simulations with approximate, but cheap, calculations based on classical Density Functional Theory (DFT). Excellent overall agreement is found for a large set of system parameters, including variations in concentration, ionic size- and valency-asymmetries, applied voltages and electrode separation, provided the differences between the canonical ensemble of the BD simulations and the grand-canonical ensemble of DFT are properly taken into account. In particular, a careful distinction is made between the differential capacitance \(C_N\) at fixed number of ions and \(C_\mu \) at fixed ionic chemical potential. Furthermore, we derive and exploit their thermodynamic relations. In the future these relations will also be useful for comparing and contrasting experimental data with theories for supercapactitors and other systems. The quantitative agreement between simulation and theory indicates that the presented DFT is capable of accounting accurately for coupled Coulombic and packing effects. Hence it is a promising candidate to cheaply study room temperature ionic liquids at much lower dielectric constants than that of water.

### Similar content being viewed by others

Avoid common mistakes on your manuscript.

## 1 Introduction

Electric double layer capacitors (EDLCs) are promising energy storage devices, in which electric energy is stored in the net ionic charge that is present in the vicinity of an electrode-electrolyte interface. In EDLCs the cathode attracts cations and repels anions and vice versa for the anode; more so the higher the applied voltage between the cathode and the anode [1]. This energy storage mechanism leads to much higher *power* densities than those of batteries; the discharge of the so-called electric double layer (EDL) of an EDLC can be much faster than the redox reactions in batteries [2, 3]. However, the *energy* densities of EDLCs are much lower than those of batteries [2].

One of the factors that contributes to the low energy density in EDLCs is the limited potential window in which conventional electrolytes are stable with respect to detrimental chemical reactions. Conventional electrolytes in EDLCs consist of a salt (e.g. tetraethylammonium tetrafluoroborate) dissolved in a solvent (e.g. propylene carbonate or acetonitrile) [4]. In order to maximise the energy density of EDLCs, one could use alternative electrolytes with a larger potential window [5]. Room temperature ionic liquids (ILs) are potential alternatives to conventional electrolytes in EDLCs, since they can have a potential window of up to 6 V [6]; conventional electrolytes in EDLCs have a potential window of only 2.5 to 2.8 V [5]. Other advantages of ILs over conventional electrolytes are their stability at high temperatures and low vapor pressures (low volatility and non-flammability), which makes IL-based EDLCs much safer [5, 7]. Modelling and theoretically understanding concentrated ILs is difficult, because of the steric repulsions at short ionic separations and the Coulombic interactions at longer ranges are simultaneously at play. While in experiments, dispersion forces, polarisation and orientation degrees of freedom often also play a role, we restrict attention to the combined effects of packing and electrostatics. In order to prepare for the challenges posed by ILs, we here focus on the parameter regime of aqueous systems.

Several methods have been applied to investigate the electric double layer of EDLCs. On the one hand there are continuum methods, such as the mean field Gouy-Chapman-Stern (GCS) theory for point ions and classical Density Functional Theory (DFT) that can include steric effects. On the other hand there are methods in which each ionic constituent is treated explicitly, such as in Molecular Dynamics (MD) and Brownian Dynamics (BD) simulations. All have their advantages and disadvantages. GCS theory can be solved analytically, but is rather inaccurate for larger ionic concentrations and surface charges, DFT is computationally fast but is an approximate theory for a given model. MD simulations might be considered as ‘exact’ and provide dynamics at the molecular scale but are computationally expensive. DFT calculations [8,9,10,11,12,13,14] and MD simulations are extensively used to study double layers in ILs and aqueous electrolytes [15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]. As an alternative to the MD simulation method, BD is less accurate but computationally cheaper. In BD the explicit solvent of MD is eliminated by including solvent effects like friction, Brownian noise and the dielectric constant of the medium in an approximate way in the equations of motion of the ions [34].

The main aim of the paper is to explore whether DFT can be used to efficiently model electrolytes; therefore, we are interested in the ability of DFT to quantitatively match BD simulations of a primitive model electrolyte. To this end, we study the EDLs of an aqueous electrolyte confined between a planar anode and cathode using BD simulations and classical DFT. A given potential difference is applied between the two electrodes, which are modeled as graphene-like electrodes in the BD simulations and as impenetrable planar walls in the DFT calculations. We compare both the ion concentration profiles between the electrodes (see also Refs. [35, 36]) and the differential capacitance *C*. The differential capacitance characterises the (additional) charge per (additional) applied voltage, a quantity that is experimentally measurable and often used as a characteristic of the energy storage qualities of a capacitor.

Also it is shown that a careful distinction is required between the capacitance \(C_N\) at constant number of ions and \(C_\mu \) at constant ion chemical potential, where the former follows naturally from the canonical BD simulations and the latter from the grand-canonical DFT calculations. However, they are related and we show the connecting expressions. We start by a detailed study of our *reference system*: a 1 mol\(\cdot \hbox {L}^{-1}\) 1:1 electrolyte of equal-sized ions of diameter \(d=0.5\) nm in the 4 nm gap between two electrodes at a potential difference of 0.2 V. Then we vary the salt concentration, the ion valencies, the diameter ratio, the electrode–electrode distance, and the applied voltage. Throughout, the whole explored 5-dimensional parameter space /design of experiments we find excellent agreement between our BD and DFT results.

## 2 Model

We consider an aqueous electrolyte confined by two planar electrodes at fixed surface potential \(\varPhi _\text {L}\) and \(\varPhi _\text {R}\), separated by a distance *H*. The electrolyte contains spherical cations (+) and anions (-) with a diameter \(d_\pm \) and valency \(Z_\pm \) dissolved in a structureless medium with dielectric constant \(\varepsilon =78\) at room temperature \(T=298\) K (see Fig. 1). The medium is fully characterized by its Bjerrum length \(\lambda _\text {B}=\beta e^2/4\pi \varepsilon \varepsilon _0=0.72\) nm, where \(\beta =1/k_\text {B}T\) and \(\varepsilon _0\) the dielectric permittivity of free space.

The pair potential \(u_{ij}(r)\) between a pair of ions of species *i* and *j* separated by a distance *r* is composed of a steric repulsions, characterized by the diameter *d*, and the Coulombic interaction, i.e.

In the DFT calculations we describe the steric repulsions with a hard-sphere potential

whereas in the BD simulations we employ the Weeks–Chandler–Andersen (WCA) pair potential

Here \(\epsilon \) is the interaction parameter that we set to \(\epsilon =k_{\text {B}}T\), and \(d_{ij}=(d_i+d_j)/2\). Note that the WCA potential, which is just the repulsive part of the Lennard-Jones potential, is only slighty softer for \(r<d\) than the hard-sphere potential used in the DFT calculations. However, we will show remarkable agreement between the DFT and BD results in the parameter regime of study, indicating the limited sensitivity of the functional form of the repulsive interaction.

By confining the system, we also introduce an external potential, i.e. the interaction of the ions with the fixed particles in the electrode. This ion-electrode interaction is described by the WCA potential and Coulombic interactions, in both DFT and BD. In the DFT description we integrate out the in-plane dimensions, finding for the WCA part of the external potential

where \(\rho _w\) is the surface density of wall particles in number of particles per unit area; \(\epsilon _w\) the interaction strength between the wall particles and ions, for which we take \(\epsilon _w=\epsilon =k_{\text {B}}T\); the contact distance is \(d_{wj}=(d_w+d_j)/2\) with \(d_w\) and \(d_j\) the diameter of the wall particles and ions of species *j*, respectively. For \(z>d_{wj}\) the external potential vanishes. Note that the second electrode is described by the same interaction potential with *z* replaced by \(H-z\). Our primitive model captures the key features of an electrolyte, within the practical conditions posed by DFT and BD respectively, thereby enabling a quantitative comparison between both methods. For simplicity, we use the same diameter for all ions and electrode particles in the reference system, namely \(d= 0.5\) nm.

## 3 Method

### 3.1 Brownian Dynamics

We focus here on the description of the reference system used in the BD simulations, as illustrated in Fig. 2; detailed information on the variations to this system are provided in Sect. 5. The simulations were performed in LAMMPS [37]. The salt concentration in the slit between the two electrodes is set to what it would have been if the slit was in equilibrium with a reservoir, with a salt concentration of 1 mol\(\cdot \hbox {L}^{-1}\) at 0 V. The salt concentration in the slit was determined by DFT calculations, which corresponds to an equal amount of anions and cations, \(N_+ = N_- = 51\). As described in Sect. 2, the pairwise excluded volume interactions are described by a WCA potential. The ions have valencies of \(Z_+ = +1\) and \(Z_- = -1\), while the variable charges of the wall particles are determined by the Constant Potential Method (see below). The long-range Coulombic interactions are evaluated using the particle-particle-particle-mesh (PPPM) method [38], with a cut-off distance of 12 nm and a relative accuracy of \(10^{-6}\) in the forces. A correction term allows application of this 3D Ewald summation technique to the current slab geometry [39, 40]. In the BD simulation the solvent is implicit and accounted for in the equation of motion. That is, the second order Langevin equation of motion of the ions reads as

where \({\mathbf {x}}_i\) is the position of the \(i^\mathrm {th}\) particle, \(m = 50\) atomic mass unit (a.m.u.) denotes the mass of the ions (equal for all ions), \(\xi \) the friction constant, *U* the total potential energy, and \({\mathbf {f}}_i\) the fluctuating Brownian force on the particle. Using the Stokes–Einstein equation \(\xi = 3 \pi \eta d\) yields \(\xi = 2.2\) a.m.u.\(\cdot \hbox {fs}^{-1}\) in water with \(\eta _{\text {water}} = 8 \times 10^{-4}\) Pa\(\cdot \)s. The stochastic force, with vanishing mean and devoid of correlations in time (Markovian) and across particles, obeys the fluctuation-dissipation theorem,

where \(\delta _{ij}\) is the Kronecker delta, \(\delta ( t - t^\prime )\) the Dirac delta and the angular brackets denote an average. This equation of motion is integrated in LAMMPS by combining the velocity-Verlet scheme [34, 41], using a time step of 5 fs, with the Langevin option. Simulations were initiated by placing the ions, stacked into a simple cubic crystal lattice, in the slit. A simulation typically lasted for 200 ns, requiring about 2–3 days on 32 cores in parallel, with the first 10% serving as equilibration phase and the remainder as production run.

The two parallel electrodes each consist of one graphene-like layer of 960 particles, covering an area of \(A = 100.6\,d^2\), see Fig. 2. The inter-particle bond lengths in these hexagonal layers are taken as the usual carbon-carbon distance, 0.142 nm \( = 0.284d\). The distance between the electrodes, as measured between the centres of the constituent particles, is \(H = 8d\). All wall particles are frozen, i.e. are excluded from the equation of motion, because the elimination of their rapid vibrations permits the use of a larger time step. Their charges are calculated using the Constant Potential Method (CPM) by imposing a constant voltage difference of \(\varPsi = 0.2 \) V between the two walls [26, 42]. We use the implementation provided by Yang et al. [24] which can be used as a plug-in for LAMMPS. In brief, the CPM determines the charges of all wall particles at every simulation step by solving the linear set of equations that determines the potential at every wall particle, given the positions of all wall particles and ions. The charges on the wall particles were treated as Gaussian distributions with the usual width of 0.5052 Å [24, 26, 42]. As the implementation of CPM for LAMMPS [24] does not take the relative permittivity of the medium into account, the charges of all ions were multiplied by \(1/\sqrt{\epsilon }\) and the potentials on the walls were multiplied with \(\sqrt{\epsilon }\) to reach the same effect; all charges reported below are corrected to refer to an aqueous medium with \(\epsilon = 78\). A side effect to this pragmatic inclusion of the solvent’s dielectric constant is that not only ion–ion and ion–electrode Coulomb forces are scaled, but so are the Coulomb forces between electrode atoms; the latter is of no consequence, however, since these atoms are immobilized in the simulation. A brief comparison with the fixed charge method, in which all charges are permanently fixed, is provided in Appendix D for the system at zero voltage. The system is periodically repeated in space, with the box lengths in the two directions parallel to the walls dictated by the geometry of the lattice and the height perpendicular to the walls taken as three times the width of the slit. Adding additional layers to the electrodes, creating thin slabs of graphite, does not significantly affect the ion density profiles nor the average total charge of the electrodes; the differences are within the accuracy of the calculation.

### 3.2 Density Functional Theory

The starting point of classical DFT is the grand potential functional \(\varOmega \) of the density profiles \(\rho _j({\mathbf {r}})\) [43], which reads in our case

where \({\mathcal {F}}_{\text {id}}\) is the intrinsic Helmholtz free energy functional of the ideal gas, \({\mathcal {F}}_{\text {ex}}^{\text {HS}}\) the excess (over-ideal) Helmholtz free energy functional that deals with the hard-sphere interactions, \({\mathcal {F}}_{\text {ex}}^{\text {ES}}\) the excess Helmholtz free energy functional that deals with the electrostatic interactions, \(\mu _j\) the chemical potential of species *j*, and \(\rho _j({\mathbf {r}})\) the local density of species *j*. Here, \({{\mathcal {F}}={\mathcal {F}}_{\text {id}}+{\mathcal {F}}_{\text {ex}}^{\text {HS}}+{\mathcal {F}}_{\text {ex}}^{\text {ES}}}\) is an intrinsic property of the system which depends on the temperature and the interparticle interactions, but not on \(\mu _j-V_{\text {ext}}^j({\mathbf {r}})\). This grand potential functional has the property that it is minimized for a given \(\mu _j-V^j_{\text {ext}}({\mathbf {r}})\) by the equilibrium density profile \(\rho _{j,0}({\mathbf {r}})\), i.e. \(\left. \delta \varOmega /\delta \rho _j\right| _{\rho _{j,0}}=0\), at which it equals the actual grand potential \(\varOmega \) introduced later in Sect. 4. Minimizing the grand potential functional with respect to the density profiles results in the Euler–Lagrange equations

Therefore, once an explicit form of \({\mathcal {F}}\) is constructed, one can find the equilibrium density profiles \(\{\rho _0\}\) by solving Eq. 8. Although the ideal Helmholtz free energy functional is known exactly and given by

with \(\varLambda _j\) the thermal wavelength, the excess functional hinges on approximations. One excellent approximation for the hard-sphere functional \({\mathcal {F}}_{\text {ex}}^{\text {HS}}\) has been developed and goes by the name Fundamental Measure Theory (FMT) [44,45,46], of which we apply the White-Bear II version [47]. The functional that deals with the electrostatics \({\mathcal {F}}_{\text {ex}}^{\text {ES}}\) is in general more difficult due to the long-range nature of the interactions [8]. However, we use the functional based upon the Mean-Spherical-Approximation (MSA), which for the restrictive primitive model (RPM) reads [48]

where \(c^{\text {MSA}}\) is given by [49]

and the charge density is defined by \(q({\mathbf {r}})=\sum _j Z_j\rho _j({\mathbf {r}})\). The electrostatic potential makes its entrance upon writing Eq. 10 as the sum of the mean-field electrostatic free energy and MSA corrections, details of which can be found in Refs. [8, 48, 50]. The electrostatic potential is consequently determined by the Poisson equation, where the constant surface potential is enforced as a boundary condition.

The parameter \(D=d+1/\Upsilon\) is a length scale that results from MSA, where \({\Upsilon =(\sqrt{1+2d\kappa }-1)/2d}\) with \({\kappa =\sqrt{8\pi \lambda _\text {B}\rho _r}}\) the inverse Debye length and \(2\rho _r\) the total ion concentration in the reservoir at a given chemical potential \(\mu \). For the expression of \(c^{\text {MSA}}\) beyond the RPM, we refer to [51, 52]. Note that \(c^{\text {MSA}}\) depends on the reservoir concentration \(\rho _r\) through the parameter *D* and therefore it also depends on the chemical potential \(\mu \). Due to the approximation for the Helmholtz free energy functional \({\mathcal {F}}^{\text {ES}}_{\text {ex}}\), it now also depends on \(\mu \), which it formally should not depend on. As a result, the Maxwell relation introduced in the next section does not hold exactly and we have two ‘routes’ to calculate the adsorption \(\Gamma \) (see Appendix C). When we need to calculate the adsorption \(\Gamma \) we use the route Eq.15 given in the next section for the remainder of the article.

As a final note we mention that our DFT calculations assume planar symmetry in which the in-plane coordinates can again be integrated out, leaving the normal coordinate *z* perpendicular to the electrodes as the only spatial variable in the numerical calculations.

## 4 Thermodynamics

We will treat the above model theoretically by DFT and computationally by BD simulations. However, firstly we discuss the thermodynamics of both methods.

Let us start by considering the ensemble of the BD simulations, which is a closed system with a fixed number of \(N_+\) cations and \(N_-\) anions in a volume *V* at temperature *T* confined between two planar electrodes of equal area *A* separated by a distance *H* and held at a surface potential difference \(\varPsi \) (see Fig. 3). The system, i.e. electrolyte and the electrodes, together with the charge reservoirs is charge neutral \(\sum _{j=\pm }eZ_jN_j+{\mathcal {Q}}_{\text {L}}+{\mathcal {Q}}_{\text {R}}=0\). Applying a potential difference \(\varPsi \) creates an electric field across the system. Since the ions in the system are mobile they will respond to this electric field, and because the electrolyte is confined they will create a charge density near each electrode. These electrodes are connected to charge reservoirs with which they can exchange charges, such that the charge on the electrode is balanced with the charge density in the electrolyte. In other words, the charge in the electrolyte together with the average charge on the electrodes must vanish, i.e. \(\sum _{j=\pm }eZ_jN_j+ Q_{\text {L}}+ Q_{\text {R}}=0\), where \(Q_{\text {L/R}}\) denotes the average charge. The corresponding thermodynamic potential for this system is the free energy \(F(N_+,N_-,V,T,\varPsi ,A,H)\), for which the differential form reads

with *S* the entropy, *p* the pressure, \(\mu _\pm \) the chemical potential of the cations and anions, respectively, *A* the surface area, and \(\gamma \) is the total surface tension (which has contributions from the electrode-electrolyte and in the case of EDL-overlap also from electrode-electrode interactions). We also introduced the force *f* between the two planar electrodes, where *f*/*A* is also referred to as the disjoining pressure. We will call *F* the Helmholtz free energy, even though it is only a Helmholtz free energy for the ionic species while it is actually a grand-canonical potential for the charge carriers in the electrodes.

The DFT calculations, on the other hand, are performed at constant chemical potential \(\mu _\pm \) instead of constant number of ions \(N_\pm \). This implicitly means that the system can freely exchange ions with an ion reservoir. Also, both the electrode potentials are defined with respect to a grounded reservoir (see Fig. 3), i.e. the two electrodes are connected to separate charge reservoirs that are independently held at a constant potential. Hence, the potential \(\varPhi _\text {L}\) and \(\varPhi _\text {R}\) on the left and right electrode, respectively, generate an independent electric field, not only between the electrodes but also between the electrodes and the reservoir. The ions both within the system and in the reservoir respond to this electric field. The role of the charge reservoirs is the same in both ensembles. Since global charge neutrality of the system plus reservoirs still holds, one finds in equilibrium the system charge-neutrality condition \(\sum _{j=\pm }eZ_j\langle N_j\rangle + Q_{\text {L}} + Q_{\text {R}} =0\). The corresponding thermodynamic potential is the grand potential \(\varOmega (\mu _\pm ,V,T,\varPhi _\text {L},\varPhi _\text {R},A,H)\) with differential

The distinction between \(F(N_\pm ,V,T,\varPsi ,A,H)\) and \(\varOmega (\mu _\pm ,V,T,\varPhi _\text {L},\varPhi _\text {R},A,H)\) is crucial when comparing results from DFT (constant chemical potential) with BD simulations (constant number of ions).

For macroscopically large systems we can use volumetric and areal extensivity arguments to write \(\varOmega =-p(\mu _+,\mu _-)V+\gamma (\mu _+,\mu _-,\varPsi _{\text {L}},\varPsi _{\text {R}},H)A\), where we drop the *T* dependence for convenience as we keep the temperature fixed throughout. Combining the resulting differential \(\mathrm {d}\varOmega =-p\mathrm {d}V-V\mathrm {d}p +\gamma \mathrm {d}A + A \mathrm {d}\gamma \) with Eq.13 gives the Gibbs–Duhem equation for the volumetric terms and, for \(dH=0\), the Lipmann equation

where \(\sigma _{\text {L/R}}=Q_{\text {L/R}}/A\) denotes the surface charge density and \(\Gamma _j\) the adsorption of ions of species *j* onto both electrodes defined by

Here, *z* denotes the coordinate describing the distance perpendicular to the parallel electrodes, \(\rho _j(z)\) the local number density of species *j* at position *z*, and \(\rho _{j,r}\) the reservoir concentration of species *j* which is dictated by the chemical potentials \(\mu _\pm \). See Appendix A for a more detailed derivation.

The main observable that we focus on in this article is the differential capacitance (per unit area), which can either be obtained at constant number of particles \(C_N\) or at constant chemical potential \(C_\mu \), i.e.

where, for simplicity, we consider the RPM where \(N_+=N_-\equiv N\) and \( {d}\mu _{+}={d\mu _{-}}\equiv {d}\mu /2\), which allows us to write \(\Gamma =(\Gamma _++\Gamma _-)/2\). On top of that, we also apply the same (but opposite) potential on both electrodes within the \(\varOmega \) ensemble, i.e. \(\varPhi _\text {R}=-\varPhi _\text {L}\equiv \varPsi /2\), which leads to the same (but opposite) surface charge \(\sigma _{\text {R}}=-\sigma _{\text {L}}\equiv \sigma \) on both electrodes.

Interestingly, \(C_\mu \) and \(C_N\) are related via expressions that are very similar to those between the constant-volume and constant-pressure heat capacities, namely (see Appendix A)

where \(\alpha \) can be taken equal either to \(\alpha _\mu \) or \(\alpha _\varPsi \) defined by

In an exact theory, the Maxwell relation \(\alpha _\mu =\alpha _\varPsi \) is satisfied identically. However, our excess free-energy functional is approximate and does not identically satisfy the Maxwell relation. As a consequence our conversion between \(C_N\) and \(C_\mu \) depends on the choice for \(\alpha \). However, the numerical differences are limited, as we will see in Sect. 5.7. We also defined

which resemble (osmotic) compressibilities of the ions at constant \(\sigma \) and \(\varPsi \), respectively. The relations in this section allow us to compare and convert the capacitances at constant *N* (natural to BD simulation) and at constant \(\mu \) (natural to DFT).

In the BD simulations, the differential capacitances were determined by three routes. Running a set of equilibrium simulations at a range of potential differences \(\varPsi \) between the electrodes yielded the mean total charge of the electrodes, \(\langle Q \rangle _{N,\varPsi } = (1/2) \langle Q_{\text {R}} - Q_{\text {L}} \rangle _{N,\varPsi }\). The angular brackets denote the canonical ensemble average at the indicated potential difference, which is evaluated in simulations as a time-average [34, 41]. The differential capacitance at constant numbers of ions, see Eq. 16, is obtained by numerically differentiating the surface charge with respect to the potential difference,

using the central difference formula. Alternatively, the same differential capacitance is extracted from the thermal fluctuations of the wall charge around the average, \(\delta Q = Q - \langle Q \rangle _{N,\varPsi }\), over a single equilibrium simulation [53, 54],

The intrinsic capacitance \(C_0\), which is a constant independent of \(\varPsi \) and *N*, accounts for the thermal fluctuations of the atomic charges around the idealized constant-potential charges calculated by CPM. The numerical value of \(C_0\) is obtained by the fitting procedure discussed in Appendix B.

The differential capacitance at constant chemical potential, see Eq. 16, is obtained from the BD simulations as

where each simulation was preceded by a DFT calculation to establish the required numbers of ions \(N(\mu ,\varPsi )\) under the prevailing conditions. The same finite difference relations were used to calculate the capacitance by DFT. The calculations of \(C_N\) via Eq. (18) will be referred to as \(C^{\alpha _\mu }_N\) and \(C^{\alpha _\varPsi }_N\), when using \(\alpha _\mu \) and \(\alpha _\varPsi \), respectively.

## 5 Results

In this section, the density profiles and the differential capacitances obtained with BD and DFT are presented and compared. The reference system will be considered first, followed by an exploration of the impacts of its various parameters by varying them one by one. Various authors have previously used DFT and MD to study systems similar to the systems discussed below [8, 31,32,33, 48, 50, 55, 56]. Although those systems are not identical to the systems we consider, they do show very similar density profiles.

### 5.1 Reference System

In the reference system, the electrodes are separated by \(H = 4 \, \mathrm{nm}\) while the applied electrode potentials are \( \varPhi _\text {L}=-0.1 \, \mathrm{V}\) and \(\varPhi _\text {R} = +0.1 \, \mathrm{V}\) in DFT and \(\varPsi =0.2\) V in the BD simulations. The reservoir salt concentration is \(\rho _r=1\) mol\(\cdot \hbox {L}^{-1}\), *i.e.* cations and anions have identical concentrations of 1 mol\(\cdot \hbox {L}^{-1}\), which corresponds to 51 ion pairs in the BD system with electrode surface areas of \(A=25.1\) \(\hbox {nm}^2\). The cations and anions have the same size \(d_+ = d_- =0.5 \, \mathrm{nm}\), and are monovalent \(Z_+ = -Z_- = 1\), see Fig. 2. The results from DFT and the simulations for this reference system are presented in Fig. 4. Applying a negative (positive) surface potential on the left (right) electrodes causes a negative (positive) surface charge, attracting positively (negatively) charged ions and repelling negative (positively) charged ions. Away from the walls, the concentrations of both ions level off to a flat density profile. The agreement between DFT and BD is excellent.

### 5.2 Varying Ion Concentrations

The first parameter to be varied is the concentration of the electrolyte in the reservoir, from \(\rho _r=0.1\) mol\(\cdot \hbox {L}^{-1}\) to \(\rho _r=5\) mol\(\cdot \hbox {L}^{-1}\), corresponding to 9 and 252 ion pairs in the BD simulation, respectively. The latter concentration is similar to that of the ion concentration in ILs, while the dielectric constant and the shapes of the ions are markedly different in ILs. The results, see Fig. 5(a) and Fig. 5(b), reveal a slight difference at the peaks for both cases. The lower density shows only one peak, so we can consider this to be in the dilute limit. The higher density shows strong oscillations, due to the layering commonly found at high packing fractions, like the current \(\eta =0.394\). The wavelength and amplitude of the oscillations are well captured with DFT, as indicated by the good agreement between the two methods. Nevertheless, there are small discrepancies in the heights of the peaks and valleys. These are mainly due to the treatment of the hard-core potential by the FMT part of the functional [57] and the difference in the representation of the repulsive interactions as WCA in BD and as hard spheres in DFT.

### 5.3 Differently-Sized Ions

Figure 5(c) and (d) show results for differently-sized ions, with cations twice the diameter of anions, \(d_+ = 2 d_- = 0.5\) nm. The difference between the two plots is in the ensemble being used to control the ion number densities in the slit. Because the anions are smaller than the cations, they both come closer to the electrode, thereby lowering their electrostatic energy, and pack at a higher density. Consequently, as illustrated in Fig. 5(c), when using DFT to impose reservoir concentration of \(\rho _r=1\) mol\(\cdot \hbox {L}^{-1}\) for both ions, the heights of the density peaks adjacent to both electrodes become unequal at the reference potentials of \(\varPhi _\text {L}=-0.1\) V and \( \varPhi _\text {R}=0.1\) V, hence \(\varPsi =0.2\) V. From these density profiles, the numbers of ions were calculated as \(N_+ = 51\) and \(N_- = 55\), to the nearest integer, and these numbers were used in the BD simulations shown in the same plot. Figure 5(d) presents results for equal numbers of cations and anions in the slit, taken as the average of the two previous values: \(N_\pm = 53\). To obtain the desired numbers of ions of each type in DFT, the potential of one electrode was fitted, at constant potential difference \(\varPsi \) to arrive at \(\varPhi _\text {L}=-0.1116\) V and \(\varPhi _\text {R}=0.0884\) V. The density peaks at both electrodes now resemble each other. Note the asymmetry in both plots in the density of the cations at the positive electrode versus that of the anions at the negative electrode, both in their distance from the wall relative to the other ion at the same wall and the distance to the electrode before reaching the constant density plateau in the center of the slit. For both equal and unequal numbers of ions, BD and DFT show good agreement in the density profiles.

### 5.4 Changing the Surface Potential

Figure 5 (e) and (f) present the comparison for smaller \(\varPsi =0.02\) V and larger \(\varPsi =2\) V potential differences with respect to the reference system. Because convergence of the density profile at the lower potential required a very long BD production run, the simulation was performed instead using Newtonian mechanics in combination with a Nosé–Hoover thermostat [34, 41]. The thermostat works by rescaling the velocities of all ions at every time step, in such a way as to recover the correct mean kinetic energy and kinetic energy fluctuations at the desired temperature, and therefore samples the Boltzmann equilibrium distribution also obtained by the BD simulation. The thermostatted method samples configuration space more efficiently by ignoring the slow Brownian motion, which affects the dynamical properties of the system but not the thermodynamic properties studied in this work.

Applying a small potential on the electrodes causes a smaller charge density, i.e. the density profiles of the cations and anions are more similar. At high potentials, a large portion of the ions are adsorbed onto the electrodes, causing strong layering. The agreement between the simulations and DFT is excellent for the smaller potentials, while small deviations are observed for the larger potential near the second peak. The latter are a result of strong packing, where, as mentioned before, the WCA potential differs from the FMT approximation to the hard sphere potential in DFT.

### 5.5 Different Valencies

In Fig. 5(g) and (h), the valency of the cation is doubled to twice that of the anion, \(Z_+ = -2 Z_- = 2\). Charge neutrality of the reservoir, \(\sum _j Z_j \rho _{r,j} = 0\), implies that the anion concentration in the reservoir must be double the cation concentration. Here we choose the cation reservoir concentration to be the same as in the reference system, i.e. \(2 \rho _{r,+} = \rho _{r,-} = 2\) mol\(\cdot \hbox {L}^{-1}\). Because the symmetry between cations and anions is broken, ions exchange with the reservoir resulted in distinct number of ions in the DFT calculations of Fig. 5(g). The corresponding BD simulations were based on \(N_+ = 35\) and \(N_- = 67\), following the procedure outlined in Sect. 5.3. The simulations in Fig. 5(h) impose charge neutrality in the slit, \(2 N_+ = N_- = 70\). The situation is realized in DFT at the electrode potentials \(\varPhi _\text {L} = -0.091\) V and \(\varPhi _\text {R} = 0.109\)V at the left and right electrode, respectively.

The most interesting difference between the reference system and this case is the little hump in the anion density profiles around \(z=1\) nm. This effect is referred to as overscreening [58], where one finds a negatively charged layer of anions next to the positively charged first layer of cations adjacent to the cathode. Again, excellent agreement is observed between DFT and BD.

### 5.6 Slit Width

Lastly, the distance between the electrodes *H* was varied from \(H=1.5\) nm in Fig. 5(i) to \(H=12\) nm in Fig. 5(h). Because a very long production run was required for the latter when using BD, the simulation was performed using the Nosé–Hoover thermostat rather than Langevin Dynamics, as explained in Sect. 5.4. At the lower slit width the EDLs overlap substantially, while for the large width the electrolyte acquires the flat distribution of a bulk fluid in the middle of the system. The DFT and BD results are again in excellent agreement.

### 5.7 Capacitance

The capacitance was calculated as a function of the surface potential difference \(\varPsi \), at both a constant reservoir concentration and at constant number of ion pairs in the slit. In the former case, which comes naturally to DFT, the DFT calculations at a concentration in the reservoir of \(\rho _r=1\) mol\(\cdot \hbox {L}^{-1}\) were used to determine the numbers of ions in the BD simulations. In the latter case, which comes naturally to BD, the number of ion pairs was fixed at \(N = 156\) and the concentration in the reservoir was varied to reach the desired number of ions in DFT. The charge on the electrode surface in the former case is shown in Fig. 6(a), where the line represents the DFT calculations and the markers the BD simulations. Note that each simulation, although performed at constant numbers of ions, belongs to the same chemical potential. As expected, the charge on the wall and the number of ions in the slit increase with the potential difference between the electrodes. The two methods are in good agreement. The corresponding capacitance is presented in Fig. 6(b), where several calculation methods have been used. The blue solid line and the blue circles represent \(C_\mu ^\varDelta \) Eq. 22 using the data in Fig. 6(a). Because the number of time-consuming BD simulations is necessarily low, the numerical derivative is limited in its accuracy, especially for the last data point at \(\varPsi =2\) V. Nevertheless, the agreement is satisfactory and both methods yield similar camel-shaped curves [59]. Also shown in Fig. 6(b) are calculations of \(C_N\), where it should be emphasized that *N* is not constant across the plot but varies with \(\varPsi \). The capacitance \(C_N^\delta \) (orange squares) is based on the charge fluctuations in the BD simulations, given in Eq. 21 where also \(C_0\) appears. The value for \(C_0\), which depends neither on the number of particles nor on the potential difference, is found to be \(C_0=17.6\) \(\mu \)F·\(\hbox {cm}^{-2}\) (see Appendix B). The DFT calculations of \(C_N^{\alpha _\mu }\) (green dotted line) and \(C_N^{\alpha _\varPsi }\) (green dashed line) are based on the relations in Eq. 17. The approximation made in Sect. 3.2, namely the assumed dependence of the direct correlation function \(c^{\text {MSA}}\) in Eq. 11 on the chemical potential, resurfaces at this point. The adsorption \(\Gamma \) can be obtained either from Eq. 15 or from the derivative of Eq. 14 with respect to the chemical potential, as derived in Appendix C. In the latter case, the derivative of \({\mathcal {F}}^{\text {ES}}_{\text {ex}}[\{\rho \}]\) does not vanish, though in principle it should have. The capacitance \(C_N\) can therefore be calculated from \(C_\mu \) using either \(\alpha _\varPsi \) or \(\alpha _\mu \), where the expression for \(\Gamma \) in Eq. 15 was used to calculate \(\alpha _\mu \). Note, however, that the calculation of the surface charge density \(\sigma \) *is* consistent by construction, since charge neutrality is imposed.

As expected from Eq. 16, in both cases \(C_N\) is smaller than \(C_\mu \). Both DFT calculations are in reasonable agreement with the BD results; notably, all three show a bell-shaped curve. The plot shows a substantial difference between \(C_N\) and \(C_\mu \), and although the various calculations do not exactly match quantitatively, they agree reasonably well and support the qualitative difference. The reason for the rather large difference between \(C_\mu \) and \(C_N\) is due to the small electrode-electrode separation, where the region of the EDLs contribute substantially to the total number of ions in the system. In the limit where the separation between the electrodes is infinite, the difference between \(C_\mu \) and \(C_N\) disappears.

Lastly, we consider the system with a fixed number of ion pairs, \(N = 156\), and vary the surface potential difference \(\varPsi \). Shown in Fig. 7 are the capacitances using the same colour and line coding as in Fig. 6, with the addition of an orange curve for \(C_N^\varDelta \) using DFT. For \(\varPsi = 0\) V to \(\varPsi = 0.3\) V, the simulations were run for 800 ns, treating the first 200 ns as equilibration phase, since for lower potential differences the simulations required a long production run for the capacitances to converge. Both differential capacitances are bell-shaped. The agreement between simulations and DFT is remarkably good, and compared to the results in Fig. 6(b), there is little to no qualitative difference between \(C_N\) and \(C_\mu \). The small qualitative difference, especially at small potential differences, is mainly due to the relative large number of ions in the system and therefore a corresponding large reservoir concentration. For comparison, the number of ions at \(\varPsi =0.2\) V in Fig. 6 is 51, while only at \(\varPsi =2\) V it is 156. The camel shaped curve in \(C_\mu \) is only existent for small reservoir concentrations \(\rho _r<1.5\) mol\(\cdot \hbox {L}^{-1}\) and bell shaped otherwise. Hence, no camel-shaped capacitance curve is observed within these parameters.

## 6 Discussions, Conclusions and Outlook

We presented ionic density profiles for a broad range of parameters applicable to aqueous electrolytes confined between a planar cathode and anode, and found very good agreement between results from DFT calculations and BD simulations. Both methods were also used to calculate differential capacitances, either \(C_\mu \) at constant ionic chemical potential \(\mu \) or \(C_N\) at constant number *N* of ions, via several routes. For a fixed chemical potential of mono-valent ions, at which the ionic reservoir concentration equals \(\rho _r=1\) mol\(\cdot \hbox {L}^{-1}\), the capacitance curves obtained from DFT and BD are overall in good agreement. The DFT prediction for the capacitance at fixed *N*, however, gave two somewhat different results due to the approximation for the electrostatic part of the employed functional. Nevertheless, the DFT predictions bracket those of the BD simulations, except at potential differences between cathode and anode below 0.3 V where the simulations were extremely slow. Interestingly, the qualitative difference between \(C_\mu \) and \(C_N\) is substantial, where \(C_\mu \) is camel shaped and \(C_N\) is bell shaped. This has to do with the nonlinear relation between \(\mu \) and *N*. Furthermore, \(C_\mu \) is found from a linear cut through the landscape in the three-dimensional space spanned by \(\{\sigma ,\varPsi ,\mu \}\), whereas \(C_N\) is the result of a non-trivial path through this landscape. We also considered capacitance curves at constant numbers of ions, \(N=156\), and found excellent agreement between DFT and BD simulations. In this case there is no qualitative difference between \(C_\mu \) and \(C_N\). Let us stress the time it takes to obtain the results from DFT and BD simulations. A typical BD simulation of a state point took 2 to 3 days on 32 cores, whereas the DFT calculations took not even 2 seconds on a regular laptop, which amounts to a difference of about 7 orders of magnitude. The accuracy that is lost by applying DFT on these systems is very small, as we have shown throughout this article.

We conclude that with DFT, one can obtain the same accuracy in *structural and thermodynamic* quantities as in BD simulations, at least for aqueous systems. This allows one to explore parameter space much more effectively and to study the properties of these systems thoroughly. A drawback of DFT is that it gives only an equilibrium description of the system, whereas BD simulations also provide the dynamics. We furthermore conclude that one needs to be careful and specify the differential capacitance that is being studied, e.g. \(C_\mu \) or \(C_N\), because they can differ both qualitatively and quantitatively. Also the natural choice changes depending on the method employed i.e. \(C_\mu \) for DFT and \(C_N\) for BD, meaning the direct comparison of results from different methods is not straightforward.

A natural next step will be to divert from aqueous systems, to study systems with a lower dielectric constant. An interesting direction will be to study room temperature ionic liquid (ILs). Although the concentration of \(\rho _r=5\) mol\(\cdot \hbox {L}^{-1}\) in Fig. 5(b) is comparable to that of ionic liquids, the dielectric constant here is considerably higher due to the solvent. It is not sufficient to simply reduce the dielectric constant and redo the calculations, since the electrostatic correlations become much stronger at the low dielectric constants of ILs: a cation-anion pair of sub-nm diameter will bind at contact by Coulombic attractions of several tens of \(k_{\text {B}} T\). It is therefore not evident whether DFT or BD simulation will work in this regime. Moreover, the ionic shape in ILs is often non-spherical and needs to be accounted for in DFT. Interestingly, there have been developments in DFT to account for chain-like ions and molecules [60], and these have been applied to some extent to study ILs [9,10,11,12,13,14]. Besides chain-like ions, another approach to implement shape and polarizability is via molecular DFT [61,62,63,64]. Although molecular DFT has been mostly applied to model water, it might prove worthwhile to use this approach for ionic liquids in the future. Not only DFT is challenging at lower dielectric constant, but also simulations become much more challenging due to clustering that occurs at low dielectric constant as a result of the stronger electrostatic interactions. This leads to longer simulation times, which were already non-negligible in the aqueous systems. Hence, a proper functional can provide the means to study ILs and electrolytes at low dielectric media effectively.

A different line of investigation would be the study of the differences of the differential capacitance \(C_N\) and \(C_\mu \). Until now the distinction has not often been made explicitly and further studies are needed to map out the properties and relations between both.

## Data Availability

The simulation data will be made freely available from the 4tu.nl website.

## References

Revankar, S.T.: Chemical energy storage. In: Bindra, H., Revankar, S. (eds.) Storage and Hybridization of Nuclear Energy, pp. 177–227. Academic Press, London, UK (2019). https://doi.org/10.1016/B978-0-12-813975-2.00006-5

Wang, Y., Song, Y., Xia, Y.: Electrochemical capacitors: mechanism, materials, systems, characterization and applications. Chem. Soc. Rev.

**45**, 5925–5950 (2016). https://doi.org/10.1039/C5CS00580AWinter, M., Brodd, R.J.: What are batteries, fuel cells, and supercapacitors? Chem. Rev.

**104**(10), 4245–4270 (2004). https://doi.org/10.1021/cr020730k. PMID: 15669155Béguin, F., Presser, V., Balducci, A., Frackowiak, E.: Carbons and electrolytes for advanced supercapacitors. Adv. Mater.

**26**(14), 2219–2251 (2014). https://doi.org/10.1002/adma.201304137Liu, H., Yu, H.: Ionic liquids for electrochemical energy storage devices applications. J. Mater. Sci. Technol.

**35**(4), 674–686 (2019). https://doi.org/10.1016/j.jmst.2018.10.007Galiński, M., Lewandowski, A., Stȩpniak, I.: Ionic liquids as electrolytes. Electrochim. Acta

**51**(26), 5567–5580 (2006). https://doi.org/10.1016/j.electacta.2006.03.016Salanne, M.: Ionic liquids for supercapacitor applications. In: Kirchner, B., Perlt, E. (eds.) Ionic Liquids II, pp. 29–53. Springer, Cham, Switzerland (2018). https://doi.org/10.1007/978-3-319-89794-3_2

Härtel, A.: Structure of electric double layers in capacitive systems and to what extent (classical) density functional theory describes it. J. Phys. Condens. Matter

**29**(42), (2017). https://doi.org/10.1088/1361-648x/aa8342Forsman, J., Woodward, C.E., Trulsson, M.: A classical density functional theory of ionic liquids. J. Phys. Chem. B

**115**, 4606–4612 (2011). https://doi.org/10.1021/jp111747wFedorov, M.V., Kornyshev, A.A.: Ionic liquids at electrified interfaces. Chem. Rev.

**114**(5), 2978–3036 (2014). https://doi.org/10.1021/cr400374x. PMID: 24588221Henderson, D., Lamperski, S., Jin, Z., Wu, J.: Density functional study of the electric double layer formed by a high density electrolyte. J. Phys. Chem. B

**115**(44), 12911–12914 (2011). https://doi.org/10.1021/jp2078105. PMID: 21970815Jiang, D., Meng, D., Wu, J.: Density functional theory for differential capacitance of planar electric double layers in ionic liquids. Chem. Phys. Lett.

**504**(4), 153–158 (2011). https://doi.org/10.1016/j.cplett.2011.01.072Yang, J., Lian, C., Liu, H.: Chain length matters: Structural transition and capacitance of room temperature ionic liquids in nanoporous electrodes. Chem. Eng. Sci.

**227**, 115927 (2020). https://doi.org/10.1016/j.ces.2020.115927Shen, G., Sun, Y., Wang, Y., Lu, X., Ji, X.: Interfacial structure and differential capacitance of ionic liquid/graphite interface: a perturbed-chain saft density functional theory study. J. Mol. Liq.

**310**, 113199 (2020). https://doi.org/10.1016/j.molliq.2020.113199Lanning, O.J., Madden, P.A.: Screening at a charged surface by a molten salt. J. Phys. Chem. B

**108**(30), 11069–11072 (2004). https://doi.org/10.1021/jp048102pFedorov, M.V., Kornyshev, A.A.: Ionic liquid near a charged wall: structure and capacitance of electrical double layer. J. Phys. Chem. B

**112**(38), 11868–11872 (2008). https://doi.org/10.1021/jp803440q. PMID: 18729396Feng, G., Zhang, J.S., Qiao, R.: Microstructure and capacitance of the electrical double layers at the interface of ionic liquids and planar electrodes. J. Phys. Chem. C

**113**(11), 4549–4559 (2009). https://doi.org/10.1021/jp809900wKislenko, S.A., Samoylov, I.S., Amirov, R.H.: Molecular dynamics simulation of the electrochemical interface between a graphite surface and the ionic liquid [bmim][pf6]. Phys. Chem. Chem. Phys.

**11**, 5584–5590 (2009). https://doi.org/10.1039/B823189CPaek, E., Pak, A.J., Hwang, G.S.: A computational study of the interfacial structure and capacitance of graphene in [BMIM][PF

_{6}] ionic liquid. J. Electrochem. Soc.**160**(1), A1–A10 (2013). https://doi.org/10.1149/2.019301jesSi, X., Li, S., Wang, Y., Ye, S., Yan, T.: Effects of specific adsorption on the differential capacitance of imidazolium-based ionic liquid electrolytes. ChemPhysChem

**13**(7), 1671–1676 (2012). https://doi.org/10.1002/cphc.201200013Vatamanu, J., Borodin, O., Smith, G.D.: Molecular insights into the potential and temperature dependences of the differential capacitance of a room-temperature ionic liquid at graphite electrodes. J. Am. Chem. Soc.

**132**(42), 14825–14833 (2010). https://doi.org/10.1021/ja104273r. PMID: 20925318Merlet, C., Salanne, M., Rotenberg, B., Madden, P.A.: Imidazolium ionic liquid interfaces with vapor and graphite: interfacial tension and capacitance from coarse-grained molecular simulations. J. Phys. Chem. C

**115**(33), 16613–16618 (2011). https://doi.org/10.1021/jp205461gMerlet, C., Péan, C., Rotenberg, B., Madden, P.A., Simon, P., Salanne, M.: Simulating supercapacitors: Can we model electrodes as constant charge surfaces? J. Phys. Chem. Lett.

**4**(2), 264–268 (2013). https://doi.org/10.1021/jz3019226. PMID: 26283432Wang, Z., Yang, Y., Olmsted, D.L., Asta, M., Laird, B.B.: Evaluation of the constant potential method in simulating electric double-layer capacitors. J. Chem. Phys.

**141**(18), 184102 (2014). https://doi.org/10.1063/1.4899176Vatamanu, J., Cao, L., Borodin, O., Bedrov, D., Smith, G.D.: On the influence of surface topography on the electric double layer structure and differential capacitance of graphite/ionic liquid interfaces. J. Phys. Chem. Lett.

**2**(17), 2267–2272 (2011). https://doi.org/10.1021/jz200879aReed, S.K., Lanning, O.J., Madden, P.A.: Electrochemical interface between an ionic liquid and a model metallic electrode. J. Chem. Phys.

**126**(8), 084704 (2007). https://doi.org/10.1063/1.2464084Pounds, M., Tazi, S., Salanne, M., Madden, P.A.: Ion adsorption at a metallic electrode: an ab initiobased simulation study. J. Phys. Condens. Matter

**21**(42), (2009). https://doi.org/10.1088/0953-8984/21/42/424109Vatamanu, J., Borodin, O., Smith, G.D.: Molecular simulations of the electric double layer structure, differential capacitance, and charging kinetics for

*N*-methyl-*N*-propylpyrrolidinium bis(fluorosulfonyl)imide at graphite electrodes. J. Phys. Chem. B**115**(12), 3073–3084 (2011). https://doi.org/10.1021/jp2001207. PMID: 21384838Bo, Z., Yang, H., Zhang, S., Yang, J., Yan, J., Cen, K.: Molecular insights into aqueous NaCl electrolytes confined within vertically-oriented graphenes. Sci Rep

**5**, 14652 (2015). https://doi.org/10.1038/srep14652Jiang, G., Cheng, C., Li, D., Liu, J.Z.: Molecular dynamics simulations of the electric double layer capacitance of graphene electrodes in mono-valent aqueous electrolytes. Nano Res.

**9**, 174–186 (2016). https://doi.org/10.1007/s12274-015-0978-5Crozier, P.S., Rowley, R.L., Henderson, D.: Molecular dynamics calculations of the electrochemical properties of electrolyte systems between charged electrodes. J. Chem. Phys.

**113**(20), 9202–9207 (2000). https://doi.org/10.1063/1.1320825Crozier, P.S., Rowley, R.L., Henderson, D.: Molecular-dynamics simulations of ion size effects on the fluid structure of aqueous electrolyte systems between charged model electrodes. J. Chem. Phys.

**114**(17), 7513–7517 (2001). https://doi.org/10.1063/1.1362290Spohr, E.: Molecular dynamics simulations of water and ion dynamics in the electrochemical double layer. Solid State Ionics

**150**(1), 1–12 (2002). https://doi.org/10.1016/S0167-2738(02)00275-8. Ringberg Workshop 2000 Special IssueAllen, M.P., Tildesley, D.J.: Computer Simulation of Liquids. Clarendon Press, New York (1989)

Voukadinova, A., Valiskó, M., Gillespie, D.: Assessing the accuracy of three classical density functional theories of the electrical double layer. Phys. Rev. E

**98**, 012116 (2018). https://doi.org/10.1103/PhysRevE.98.012116Valiskó, M., Kristóf, T., Gillespie, D., Boda, D.: A systematic monte carlo simulation study of the primitive model planar electrical double layer over an extended range of concentrations, electrode charges, cation diameters and valences. AIP Adv.

**8**(2), 025320 (2018). https://doi.org/10.1063/1.5022036Plimpton, S.: Fast parallel algorithms for short-range molecular dynamics. J. Comput. Phys.

**117**(1), 1–19 (1995). https://doi.org/10.1006/jcph.1995.1039Hockney, R.W., Eastwood, J.W.: Computer Simulation Using Particles. Adam Hilger, Bristol (1989)

Yeh, I.C., Berkowitz, M.L.: Ewald summation for systems with slab geometry. J. Chem. Phys.

**111**(7), 3155–3162 (1999). https://doi.org/10.1063/1.479595Ballenegger, V., Arnold, A., Cerdá, J.J.: Simulations of non-neutral slab systems with long-range electrostatic interactions in two-dimensional periodic boundary conditions. J. Chem. Phys.

**131**(9), 094107 (2009). https://doi.org/10.1063/1.3216473Frenkel, D., Smit, B.: Understanding Molecular Simulations. From Algorithms to Applications, 2nd edn. Academic Press, San Diego, CA (2002). https://doi.org/10.1016/B978-0-12-267351-1.X5000-7

Siepmann, J.I., Sprik, M.: Influence of surface topology and electrostatic potential on water/electrode systems. J. Chem. Phys.

**102**(1), 511–524 (1995). https://doi.org/10.1063/1.469429Evans, R.: The nature of the liquid–vapour interface and other topics in the statistical mechanics of non-uniform, classical fluids. Adv. Phys.

**28**(2), 143–200 (1979). https://doi.org/10.1080/00018737900101365Tarazona, P.: Free-energy density functional for hard spheres. Phys. Rev. A

**31**, 2672–2679 (1985). https://doi.org/10.1103/PhysRevA.31.2672Rosenfeld, Y.: Free-energy model for the inhomogeneous hard-sphere fluid mixture and density-functional theory of freezing. Phys. Rev. Lett.

**63**, 980–983 (1989). https://doi.org/10.1103/PhysRevLett.63.980Roth, R.: Fundamental measure theory for hard-sphere mixtures: a review. J. Phys. Condens. Matter

**22**(6), (2010). https://doi.org/10.1088/0953-8984/22/6/063102Hansen-Goos, H., Roth, R.: Density functional theory for hard-sphere mixtures: the white bear version mark II. J. Phys. Condens. Matter

**18**(37), 8413–8425 (2006). https://doi.org/10.1088/0953-8984/18/37/002Mier-y-Teran, L., Suh, S.H., White, H.S., Davis, H.T.: A nonlocal free-energy density-functional approximation for the electrical double layer. J. Chem. Phys.

**92**(8), 5087–5098 (1990). https://doi.org/10.1063/1.458542Waisman, E., Lebowitz, J.L.: Exact solution of an integral equation for the structure of a primitive model of electrolytes. J. Chem. Phys.

**52**(8), 4307–4309 (1970). https://doi.org/10.1063/1.1673642Härtel, A., Janssen, M., Samin, S., van Roij, R.: Fundamental measure theory for the electric double layer: implications for blue-energy harvesting and water desalination. J. Phys. Condens. Matter

**27**(19), (2015). https://doi.org/10.1088/0953-8984/27/19/194129Blum, L., Rosenfeld, Y.: Relation between the free energy and the direct correlation function in the mean spherical approximation. J. Stat. Phys.

**63**, 1177 (1991)Hiroike, K.: Supplement to Blum’s theory for asymmetric electrolytes. Mol. Phys.

**33**(4), 1195–1198 (1977). https://doi.org/10.1080/00268977700101011Limmer, D.T., Merlet, C., Salanne, M., Chandler, D., Madden, P.A., van Roij, R., Rotenberg, B.: Charge fluctuations in nanoscale capacitors. Phys. Rev. Lett.

**111**, 106102 (2013). https://doi.org/10.1103/PhysRevLett.111.106102Scalfi, L., Limmer, D.T., Coretti, A., Bonella, S., Madden, P.A., Salanne, M., Rotenberg, B.: Charge fluctuations from molecular simulations in the constant-potential ensemble. Phys. Chem. Chem. Phys.

**22**, 10480–10489 (2020). https://doi.org/10.1039/C9CP06285HGillespie, D., Nonner, W., Eisenberg, R.S.: Density functional theory of charged, hard-sphere fluids. Phys. Rev. E

**68**, 031503 (2003). https://doi.org/10.1103/PhysRevE.68.031503Roth, R., Gillespie, D.: Shells of charge: a density functional theory for charged hard spheres. J. Phys. Condensed Matter

**28**(24), 244006 (2016). https://doi.org/10.1088/0953-8984/28/24/244006Davidchack, R., Laird, B., Roth, R.: Hard spheres at a planar hard wall: Simulations and density functional theory. Cond. Matter Phys.

**19**(2), 23001 (2016). https://doi.org/10.5488/CMP.19.23001Bazant, M.Z., Storey, B.D., Kornyshev, A.A.: Double layer in ionic liquids: overscreening versus crowding. Phys. Rev. Lett.

**106**, 046102 (2011). https://doi.org/10.1103/PhysRevLett.106.046102Kornyshev, A.A.: Double-layer in ionic liquids: Paradigm change? J. Phys. Chem. B

**111**(20), 5545–5557 (2007). https://doi.org/10.1021/jp067857oYu, Y.X., Wu, J.: Density functional theory for inhomogeneous mixtures of polymeric fluids. J. Chem. Phys.

**117**(5), 2368–2376 (2002). https://doi.org/10.1063/1.1491240Levesque, M., Vuilleumier, R., Borgis, D.: Scalar fundamental measure theory for hard spheres in three dimensions: application to hydrophobic solvation. J. Chem. Phys.

**137**(3), 034115 (2012). https://doi.org/10.1063/1.4734009Jeanmairet, G., Levesque, M., Borgis, D.: Molecular density functional theory of water describing hydrophobicity at short and long length scales. J. Chem. Phys.

**139**(15), 154101 (2013). https://doi.org/10.1063/1.4824737Ding, L., Levesque, M., Borgis, D., Belloni, L.: Efficient molecular density functional theory using generalized spherical harmonics expansions. J. Chem. Phys.

**147**(9), 094107 (2017). https://doi.org/10.1063/1.4994281Jeanmairet, G., Rotenberg, B., Borgis, D., Salanne, M.: Study of a water–graphene capacitor with molecular density functional theory. J. Chem. Phys.

**151**(12), 124111 (2019). https://doi.org/10.1063/1.5118301van Roij, R.: Statistical thermodynamics of supercapacitors and blue engines. In: Dean, D., Dobnikar, J., Naji, A., Podgornik, R. (eds.) Electrostatics of Soft and Disordered Matter. Pan Stanford Publishing, Boca Raton, FL (2014)

Blundell, S.J., Blundell, K.M.: Concepts in Thermal Physics, 2nd edn. Oxford University Press, Oxford, UK (2010)

## Acknowledgements

We would like to thank our project partners at JNCASR in Bangalore, in particular, Prof. S. Balasubramanian and Nikhil V. S. Avula for fruitful discussions. This work forms part of the D-ITP consortium and the Data-driven science for smart and sustainable energy research program, with Project Number 16DDS014. Both programs are from the Netherlands Organisation for Scientific Research (NWO) that is funded by the Dutch Ministry of Education, Culture and Science (OCW).

## Author information

### Authors and Affiliations

### Corresponding author

## Additional information

### Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Appendix

### Appendix

### 1.1 A Thermodynamics Derivation

For details see Ref. [65]. The differential for surface grand potential \(\gamma \) (or also called the surface tension) can be derived from taking the differential of \(\varOmega =-pV+\gamma A\) and equating it with Eq. 13, i.e.

One now needs to separate the volumetric bulk terms from the surface terms. For convenience, let us define \(N_j=V\rho _{r,j}+A\Gamma _j\) and \(S=Vs_r+As_s\), where \(\rho _{r,j}\) and \(s_r\) denote the particle density and the entropy density in the reservoir, respectively, while \(\Gamma _j\) denotes the adsorption of species *j* and \(s_s\) the areal excess entropy. This separation into volumetric and surface terms allows us to properly gather the volume terms on the left and the surface terms on the right of the equation, i.e.

Given that the surface has no influence on the volume term, both sides vanish and we obtain both the Gibbs-Duhem as well as the full Lipmann equation

The systems that we considered when calculating the capacitances were at constant temperature *T* and constant electrode separation *H*. Moreover, in those calculations we considered the RPM such that \(\Gamma=(\Gamma _{++} \Gamma_-)/2\) and \(\mathrm {d}\mu _+=\mathrm {d}\mu _-\equiv \mathrm {d}\mu /2 \) and we symmetrized the surface potentials so that \(\mathrm {d}\varPhi _\text {R}=-\mathrm {d}\varPhi _\text {L}= \mathrm {d}\varPsi /2\) and \(\sigma _{\text {R}}=-\sigma _{\text {L}}= \sigma \). The Lipmann equation in this situation simplifies to

Within the \(\varOmega \) ensemble \(\sigma (\mu ,\varPsi )\) is a function of \(\mu \) and \(\varPsi \), hence

Because \(N(\mu )\) is a function of \(\mu \), we therefore find that

which can be rewritten using the Maxwell relation \(\left( \frac{\partial \sigma }{\partial \mu }\right) _\varPsi =\left( \frac{\partial \Gamma }{\partial \varPsi }\right) _\mu \), that can be obtained from Eq. 28, and the identity \(\left( \frac{\partial \mu }{\partial \varPsi }\right) _N=-\left( \frac{\partial \mu }{\partial N}\right) _\varPsi \left( \frac{\partial N}{\partial \varPsi }\right) _\mu \). Using the differential capacitances from Eq. 16 and introducing the compressibilities

and the Maxwell relation

one can rewrite Eq. 29 as

Using the same relations, one can show that

These relations allows us to relate the differential capacitance obtained from simulations \(C_N\) to the differential capacitance from DFT \(C_\mu \). Within DFT one can calculate \(C_\mu \), \(\chi _\varPsi \) and \(\alpha _\varPsi \), which through Eq. 17 gives access to \(C_N\). Notice the similarity with the relations between the heat capacity at constant pressure \(c_p\) and the heat capacity at constant volume \(c_V\) (see e.g. the thermodynamics book [66]). Although this derivation was done for the symmetric RPM, one can generalize these equations for any system. This is necessary when considering unequal ion sizes/valencies, but also when the potential on both electrodes differ. Hence, in general one needs to consider both electrodes separately.

### 1.2 B Calculation of the Capacitance

The calculation of a differential capacitance \(C_N\) in BD using the fluctuation expression of Eq. 21 requires the evaluation of the constant \(C_0\) accounting for the neglected thermal charge fluctuations around the idealized charges calculated by CPM. Because \(C_0\) is a property of the electrodes that depends neither on the number of ions nor on surface potential, its value was determined as the difference between the \(C_N\) obtained from the conventional charge-potential relation, see Eq. 16, and that obtained from the fluctuating contribution in Eq. 21 for \(C_0 = 0\). This difference, plotted in Fig. 8 for a range of potentials, appears indeed to be a constant, with a value of \(C_0=17.6\) \(\mu \)F·\(\hbox {cm}^{-2}\). The noise in the data is higher at low potentials, because the simulations converge more slowly at low potentials as well as due to the increased signal-to-noise ratio at the smaller step sizes in numerical differentiation.

### 1.3 C Adsorption Inconsistency

The adsorption can be calculated via the two routes

which are both plotted in Fig. 9 at a reservoir concentration of \(\rho _r=1\) mol\(\cdot \hbox {L}^{-1}\). As a short note, any functional that is based upon a bulk expansion like the one we use for the electrostatics suffers from this inconsistency.

### 1.4 D Constant Potential Versus Fixed Charge

The constant potential method (CPM) and fixed charge method (FCM) were compared by running simulations at zero voltage and zero charge, respectively. Based on DFT calculations, the equilibrium with a 1 mol\(\cdot \hbox {L}^{-1}\) reservoir results in 47 ion pairs in the simulated slit. In the BD simulations the total charges on the left and right electrodes fluctuate around averages of \(\pm 7\,n\)C\(\cdot \hbox {cm}^{-2}\), which is less then 1% of their standard deviations of 0.8 \(\mu \)C\(\cdot \hbox {cm}^{-2}\). Hence, the mean total charge on the electrodes is essentially zero. It should be noted that the slab option in LAMMPS can handle non-neutral systems [39, 40]. The ionic number densities in both CPM and FCM simulations are similar, see Fig. 10. The slightly higher density peaks near the electrodes for CPM are probably caused by the ions inducing a mirror charge in the electrode and being attracted by that mirror charge; this effect evidently does not occur at fixed wall charges.

## Rights and permissions

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

## About this article

### Cite this article

Cats, P., Sitlapersad, R.S., den Otter, W.K. *et al.* Capacitance and Structure of Electric Double Layers: Comparing Brownian Dynamics and Classical Density Functional Theory.
*J Solution Chem* **51**, 296–319 (2022). https://doi.org/10.1007/s10953-021-01090-7

Received:

Accepted:

Published:

Issue Date:

DOI: https://doi.org/10.1007/s10953-021-01090-7