Tracking the structural arrangement of ions in carbon supercapacitor nanopores using in situ small-angle X-ray scattering

The charge storage mechanism and ion arrangement inside electrically charged carbon nanopores is a very active research field with tremendous importance for advanced electrochemical technologies, such as supercapacitors or capacitive deionization. Going far beyond the state of art, we present for the first time a comprehensive study of tracking ion electrosorption in aqueous electrolytes during charging and discharging of porous carbon electrodes using in situ X-ray scattering. We provide novel and quantitative insights into the local concentration of anions and cations and demonstrate that the global number of ions within the pores does not vary during charging and discharging. In addition, we have unique access to the spatial arrangement of ions inside carbon nanopores by using a simple, yet powerful two-phase model. Applying this model to our data, we show that double-layer formation is accomplished by a unique combination of preferred counter-ion adsorption directly at the pore wall which drains ions from their local surrounding inside carbon nanopores. Effectively, this leads to a situation which globally appears as ion swapping. Broader context The demand for green energy technologies has increased tremendously over the past few years. A serious bottleneck for sustainable energy management on large- and small-scales (from renewable energy sources to e-mobility or microelectronics) is efficient energy storage. Among such systems, supercapacitors have emerged as an advanced technology for rapid energy storage and recovery at high efficiency and long life expectancy. Yet, further advancement of supercapacitor technology requires a better understanding of the fundamental charge storage mechanisms via ion electrosorption in nanoporous carbon materials. This is also the basis to capitalize advanced modelling for an improved design of electrode materials and structures. Yet, even the most advanced experimental in situ methods fall short in combining global information on charge and ion concentration with the local arrangement of ions inside carbon nanopores. The present work illustrates the potential of in situ small-angle X-ray scattering as a complementary experimental approach providing novel insights into ion transport and charge storage within carbon nanopores.


Introduction
Electrical double-layer capacitors (EDLCs), also known as supercapacitors or ultracapacitors, are advanced electrochemical energy storage devices preferred for high power handling and long lifetime applications. 1 Energy storage is accomplished by fast ion electrosorption at the electrostatically charged electrode surface and this mechanism effectively mitigates kinetic limitations caused by slow faradaic reactions or limited ion transport during ion intercalation notoriously found in battery systems. 2 Over the last few years, significant improvements in the basic understanding of ion charge storage mechanisms in nanopores of highly porous carbon electrodes have been obtained. [3][4][5][6][7] Tremendous efforts have been made recently to design new electrodes and electrolytes to optimize performance parameters such as power-and energy density or cycling stability. On the theory side, models for charge storage mechanisms have advanced vastly by applying atomistic modelling approaches, and also new experimental in situ methods have rapidly developed. 5,6,[8][9][10][11][12][13] As one of the first, Chmiola et al. demonstrated an enhanced capacitance for nanopores with a size comparable to the desolvated ion diameter, which implies that ions partly or fully lose their solvation shell in order to fit into such pores. 14 The importance of ion size with respect to the pore size has been shown for electrolytes with or without solvent, 1,14,15 and has also been supported by molecular dynamics (MD) studies using aqueous electrolytes. 16 Moreover the specific arrangement of ions (and solvent molecules) across the pore is crucial to understand the dependency of the areal capacitance (F m À2 ) on the micropore size (i.e., pores smaller than 2 nm). 5,[16][17][18][19] Based on these findings, we have started to gain a better understanding of the rather complex process of charge storage via double-layer formation from a structural point of view. There are different ways by which ion electrosorption can accomplish charge storage (Fig. S1a, ESI †). 20 In the simplest case, one could assume counter-ion adsorption, where each electrode charge carrier is compensated by the adsorption of an ion of opposite charge compared to the pore wall leading to an increase in the total number of ions in nanopores. 21 The other extreme would be pure co-ion expulsion, leading to a decrease in the total ion number of pores. 20 A third possibility is the combination of both mechanisms via ion swapping, where every two electrode charge carriers are compensated by a counter-ion entering and a co-ion leaving the pore. 6 In the latter case, the total number of ions (i.e., anions plus cations inside pores) remains constant. Whether ion swapping or preferred counterion adsorption/co-ion desorption dominates may depend on a variety of parameters, such as the ion concentration, the cationto-anion size ratio, or hydration energies. 20 Standard electrochemical methods are commonly used to determine the total amount of accumulated/depleted charge per time unit, thus failing in probing the nature of the actual charge storage mechanism. 22 Advanced electrochemical testing, for example by using impedance spectroscopy, deconvoluting time constants, and fitting equivalent circuit models, can greatly help to advance our knowledge on charge transfer and storage, but still requires validation by a complementary method. Until now, there exist only very few experimental tools that allow a distinction between the different species (cations, anions, and solvent molecules) involved in the charging process. 6,23,24 The electrochemical quartz crystal microbalance (eQCM) for instance is very powerful to measure the mass change of a thin film electrode during electrosorption, yielding mass-related information on the ions for one electrode. 11 This information can be used to get global information on the ion transport in-and out of a working electrode. However, no information on the local arrangement of ions with respect to the charged electrode surface within the pore space is obtained by this method. In contrast, spectroscopic techniques such as nuclear magnetic resonance (NMR) spectroscopy are highly sensitive to the local ion environment, 6 and thus provide rather specific information on whether a certain ion species is preferentially adsorbed to the electrode surface or not. Yet, information on the ion concentration in different sized pores and the local ion arrangement remains limited using this method.
In this study, we employ small-angle X-ray scattering (SAXS) as a powerful technique sensitive to track ion kinetics and local concentrations across the nanopores. X-ray or neutron scattering methods generally have the advantage of providing direct access to structural parameters from molecular length scales up to several tens of nanometers, which has been capitalized by only a few initial studies so far. In the ideal case of ordered mesopores with small size distribution, the electron density distribution of a liquid within the pores can be determined, as was recently shown for the density distribution of water in confinement. 25 In situ SAXS has been applied previously to study electrosorption of sodium ions or the electrochemical activation in activated carbons. 26,27 Also, small-angle neutron scattering (SANS) has been applied successfully to study supercapacitors, where the change in the SANS signal was related to the equilibrium ion concentration within carbon nanopores. 28,29 For the first time, these studies demonstrated the unique ability of small-angle neutron scattering to extract poresize dependent information on electrowetting and electrosorption within microporous electrodes.
However, the full potential of small-angle scattering has not been unlocked so far to obtain selective information on cation and anion concentrations independent from each other and, at the same time, on the specific re-arrangement of ions within carbon nanopores during charging and discharging. In the present study, we demonstrate for the first time that in situ SAXS is a powerful technique to provide this unique information for aqueous electrolytes in highly disordered activated carbons. Following complementary analysis, we combine the information derived from SAXS with the X-ray transmission (XRT) signal, which allows evaluating the photoelectric absorption of the X-rays in order to track changes of the absolute ion concentration during voltage cycling of an actual supercapacitor cell. We investigate three different salts (CsCl, KCl, and NaCl) in aqueous solution at 1 M concentration to make use of their different absorption and scattering cross-sections for X-rays within the pores of an activated carbon with an average pore size of 1.3 nm. This pore size was important for our study to exclude the presence of strong ion size related effects, such as ion sieving. 30,31 The choice of aqueous electrolytes is motivated by the simplicity of the ions on the one hand, but also by the renaissance of water-based electrolytes for highpower supercapacitors 32 and their importance for capacitive deionization 33 or capacitive mixing energy harvesting. 34

Materials
Electrolytes were prepared by mixing distilled water and salts with high purity (CsCl: 99.9%; NaCl: 99.99%; both provided by Alfa Aesar). The 1 M KCl aqueous solution was used as received (Alfa Aesar). As an electrode material a 300 mm thick activated carbon (AC) film was made employing YP-80 (Kuraray Chemicals). Activated carbon and polytetrafluoroethylene (PTFE in a 60 wt% aqueous solution from Sigma Aldrich) were mixed using a mortar and pestle in a 95 to 5 wt% ratio. Ethanol was added to the blend and the final films with a thickness of 300 AE 15 mm (determined via a microcaliper) were obtained by using a hot rolling press. Finally, the electrodes were dried for 24 h at 120 1C under vacuum. Nitrogen gas sorption measurements at À196 1C revealed an average pore diameter of 1.3 nm from micro-(o2 nm) and mesopores (2-50 nm) which yielded a specific surface area of 1672 m 2 g À1 for the electrode film (Fig. S2, ESI †). The AC particles had a size of up to several mm, leading to an additional volume of macropores (450 nm) within the electrode for the space comprised between such particles; yet, in terms of the specific surface area their contribution is negligible (o1 m 2 g À1 ). A sketch of the pore system in AC is given in the ESI, † Fig. S1, where the basic mechanisms of charge accommodation within single micropores are also indicated. For the cell assembly, a thin platinum paper (Dukatshop.de; B200 nm) was used as a current collector (CC) and a porous Whatman (GF/A) membrane as a separator.
Electrochemical in situ experiments X-ray experiments were conducted at the SAXS beamline of the synchrotron radiation source ELETTRA in Trieste, Italy. 35 A monochromatic X-ray beam with a wavelength of 0.154 nm was selected. The beam spot at the sample was quadratic with a size of 1 mm 2 . Fig. 1 shows schematically the experimental setup to record simultaneously the X-ray transmission (XRT) signal and a twodimensional (2D) SAXS pattern during the cyclic voltammetry measurement of an activated carbon electrode. While applying the cyclic voltage signal with a potentiostat, each transmission value and SAXS pattern are measured in a period of 10 s. The small-angle scattering signal is recorded using a 2D position sensitive X-ray detector (SAXS: Pilatus 1M) and the transmission signal using an X-ray sensitive photodiode. In addition to the small-angle data, the wide-angle X-ray scattering (WAXS) intensity was also recorded using a second 2D detector (Pilatus 100K). The specific design of the in situ supercapacitor cells enables us to selectively probe only one electrode at a time, so that all data can be related just to the working electrode. As outlined in Fig. 1, the in situ cells were tested in a two-electrode arrangement with a ca. 4 time oversized counter electrode (CE). The assembly of the platinum current collector/working electrode/separator/counter electrode (YP-80)/platinum current collector was sandwiched in a polyether ether ketone (PEEK) housing and was kept in contact with titanium end plates similar to the in situ cell developed by Ruch et al. 27 Moreover, two sticky polyimide (Kapton) tapes sealed the cell at the X-ray entrance holes between the platinum current collectors and the titanium/PEEK casing. Electrochemical measurements were carried out using a Gamry Ref 600 Potentiostat and cyclic voltammetry was performed at a scan rate of 5 mV s À1 . Additional transmission measurements were carried out using a laboratory SAXS instrument (Nanostar, Bruker AXS) using Cu-Ka radiation and the Glassy Carbon Method for transmission measurements. 36

SAXS data treatment
Before analyzing the in situ SAXS data, the scattering raw data were treated in the following way. First, the 2D scattering data were averaged azimuthally using the software FIT2D. 37 The resulting scattering intensity as a function of the scattering vector length Q was normalized by the corresponding transmission value and divided by the exposure time of 9 s. Finally, background contributions from air scattering and the polyimide tape were subtracted.
The so-called radius of gyration is a parameter sensitive to any structural change within the system of ions, water molecules, and the carbon pore structure. It is easily assessable from the SAXS signal by performing a conventional Guinier analysis. 38,39 The Guinier analysis was conducted for Q-values larger than 1.2 nm À1 in order to avoid any impact of the scattering contribution from the large carbon particles. Moreover, an ion concentration dependent background contribution originating from the carbon and electrolyte structure factor (see Fig. 4b) was subtracted from the SAXS intensity. This background was evaluated by a modified Porod analysis. 39 In a perfect twophase material, the intensity at large Q decays with a power law I(Q) B Q À4 . In disordered microporous carbons on the other hand the exponent might be significantly smaller than 4. This fact is explained by a breakdown of the validity of the ideal twophase model with sharp interfaces due to the small size of the pores with a rough or fractal surface. [40][41][42] From a power law fit, an exponent of À3.28 was obtained for Q-values between 4 nm À1 and 8 nm À1 . Assuming a SAXS intensity of the form AQ À3.28 + BG, the background was evaluated by the common Porod procedure and then subtracted from the data.

Electrochemical performance
Characteristic cyclic voltammograms (CVs) at a scan rate of 5 mV s À1 of three aqueous electrolytes are shown in Fig. 2a. Each of the in situ experiments was carried out in a new cell, with identical geometry and components except for the electrolyte. All tested electrolytes reveal near-ideal EDLC performance with specific capacitance values of about 75 F g À1 and the absence of detrimental effects like electrochemical degradation, ion sieving, or parasitic faradaic reactions. 30 Slight differences are visible at the vertex potentials, which can be attributed to differences in the ionic conductivity of the electrolytes or the differences in the ion size and, therefore, different ion transport properties inside the porous structure. Furthermore, the size of the hole, cut in all materials except WE, determines the kinetics of the in situ cells. In the case of the CsCl measurement, this hole (6 mm) was larger as compared to KCl and NaCl (3 mm), leading to a larger equivalent serial resistance due to an increased ion diffusion pathway. In conclusion, the in situ cell shows an electrochemical performance comparable to conventional cells and, thus, can be used as an ideal platform for meaningful operando testing.

Integral ion concentrations from XRT
While the electrochemical data for all three tested electrolytes were roughly identical, we see that the XRT data during charging and discharging exactly differentiate the different ionic systems ( À lnðtÞ ¼ À ln The carbon contribution (last term) in the sum in eqn (1) is constant, and the change in the water contribution can be neglected due to its low mass attenuation coefficient compared to the ions (see Table 1). Hence, changes in the measured transmission signal correspond to the sum of cation (c cat ) and anion concentration (c an ) changes weighted by their mass attenuation coefficients and molar masses. The mass attenuation coefficient of Cs + is much larger than the one of Cl À (see Table 1). Hence, the transmission decreases at negative voltages since the cation concentration increases and the anion concentration decreases (and vice versa at positive voltages; cf. Fig. 2b). The situation is different for NaCl, where the Cl À attenuation coefficient is larger than the one of Na + . Consequently, the periodic transmission signal behaves just oppositely. Since the attenuation coefficients of K + and Cl À are similar, we see much smaller cyclic variations of the transmission signal. In contrast, we note (as mentioned before) that the charge signal for all three systems is very similar (blue curves in Fig. 2b). It is calculated by integrating the current signal over time and normalized by the electrolyte volume, which was estimated from the transmission value at zero applied voltage (see ESI †).
Using the data shown in Fig. 2b, it is possible to obtain quantitative information on the change in the ion concentration with time. Eqn (1) constitutes an equation with two unknown concentrations c an and c cat . A second independent equation containing the same two unknown concentrations is obtained from the total charge Q calculated by integrating the Fig. 2 (a) Cyclic voltammograms (CVs) of the in situ measurements using a scan rate of 5 mV s À1 . (b) Measured X-ray transmission (left scale, red color) and total charge Q obtained from the time integration of the electrical current and normalized by the electrolyte volume (right scale, blue color) for all three electrolytes (CsCl, KCl, and NaCl). Note the different scaling on the transmission axes. On the bottom, the voltage applied to the working electrode using a scan rate of 5 mV s À1 is given.  (2)).
In this way, the co-and counter-ion concentrations can be calculated as a function of the applied voltage or, more usefully, the applied charge (Fig. 3). Evidently, the data for all three electrolytes follow the same general trend that an increase in counter-ions results in an equal decrease in co-ions which is exactly the case for ion swapping. Accordingly, the total number of ions (i.e., the number of cations plus anions) remains constant while the anion or cation concentration changes to compensate a certain applied charge (at least for our systems at 1 M ion concentration). This result aligns well with recent findings from NMR using organic electrolytes, 6 but here we present the first experimental evidence for aqueous media. There is also a small deviation from that rule which emerges at very large polarization, as shown in Fig. S3 (ESI †). There, we see a small increase in the total ion number inside carbon nanopores which may serve as an indication for a transition from ion swapping to preferred counter-ion adsorption at high charges. Such a transition would also depend on the total ionic strength of the electrolyte as known from the theoretical work for capacitive deionization. 43

Assessing complementary information from SAXS
Beyond information on the ion concentration from XRT, SAXS allows to unravel more details about the ion electrosorption mechanism. The SAXS curves from carbon electrodes in air or when soaked with electrolyte are shown in Fig. 4. These curves can be categorized into three main regions, having their origin in different levels of hierarchy of the carbon structure. At very small values of the scattering vector modulus Q (Q o 0.7 nm À1 ), the power law decay of the SAXS intensity is at least partly attributed to large pores between the micrometer-sized AC particles (macroporosity). 44 Scattering from disordered micropores dominates the intermediate region between 0.7 nm À1 and 5 nm À1 . This region is often described by the so-called Debye-Anderson-Brumberger (DAB) model 45 to obtain average correlation parameters that are related to the size and surface area of the pores. 44 At larger Q-values (i.e., Q 4 5 nm À1 ), the molecular structure factors of the carbon matrix and the electrolyte dominate, corresponding to the correlation of individual carbon atoms and electrolyte ions. 46

View Article Online
When the electrode is infiltrated with the electrolyte, the SAXS intensity (Fig. 4b, blue curve) at low and medium Q significantly decreases due to the decreased electron density difference (SAXS contrast) (Dr) 2 = (r c À r el ) 2 between the carbon matrix and electrolyte-filled pores (Fig. 4a). 39 At the same time, the intensity at large Q increases due to the contribution of the electrolyte molecular structure factor in addition to the carbon structure factor (Fig. S4a, ESI †). If the ions are randomly distributed within the water matrix, the electrolyte structure factor contribution is constant in the SAXS regime 47 (indicated in Fig. 4b), its value being determined by the concentration and the type of ion within the irradiated sample volume. 48 A more detailed description of the small-and wide-angle scattering intensity (SAXS & WAXS) of both dry and wet AC is given in the ESI. † Moreover, SAXS intensities of all three cells at 0 V cell potential are also shown.
When a voltage is applied to the electrolyte-filled carbon electrode, the change in the electron density contrast in the pores (red arrow in Fig. 4a) is expected to lead to a change in the SAXS intensity, as was previously demonstrated. [26][27][28] However, not only the mean electron density within the pores is expected to change, but also the re-arrangement of the ions within the pores due to counter-ion adsorption at the pore walls. Qualitatively, this causes a change in the shape of the SAXS curve, which goes beyond a simple vertical shift of the intensity due to an average contrast change considered widely in the literature so far.
In order to visualize the voltage-dependence of the SAXS signal, all SAXS curves were normalized by the first curve measured at 0 V and are displayed in Fig. 4c-e as color-coded relative intensity versus time and Q. As the very low-Q region is not of primary interest here, the scattering curves were conveniently classified into two main regions Q-A (o5 nm À1 ) and Q-B (45 nm À1 ) (indicated in Fig. 4c-e), emphasizing essentially the SAXS region and the onset of the molecular structure factor region.
As shown in the ESI, † the electrolyte structure factor for the given systems can be approximated by eqn (3): where f i are the number fractions and n i are the electron numbers of the corresponding species, and A and C are constants. This signal contains similar information on the ion concentration as the transmission signal (eqn (1)), and the behavior of the SAXS intensity in the region Q-B being linked quantitatively to ion concentration via eqn (3) with the electron numbers of the ions given in Table 1. In the case of CsCl, the change of the electrolyte scattering will be dominated by the cation concentration due to the much higher number of electrons of the Cs + ion (Table 1). Thus, the scattering intensity will increase if Cs + is inserted at negative voltages. The intensity will decrease at positive voltages because a large number of Cs + ions are expelled due to ion swapping. This is in agreement with the experimental data (Fig. 4c). Surprisingly, a qualitatively similar behavior of the scattering intensity in the Q-B region was observed also for the KCl electrolyte (Fig. 4d). In this case, both the K + and the Cl À ions have 18 electrons (Table 1). Therefore, the electrolyte structure factor should remain constant in the case of ion swapping (as implied from XRT data). Even more surprising, the intensity changes of the NaCl electrolyte are qualitatively similar to experiments with KCl and CsCl (Fig. 4e). In the case of NaCl, the number of electrons in the cation (10) is considerably smaller than the one in the anion (18) and, consequently, ion swapping should result in an inversion of the scattering signal in the Q-B region as compared to the CsCl electrolyte. A possible explanation for this unexpected behavior of the scattering intensity for KCl and NaCl can be given when we also consider the role of the solvent, that is, exchange or densification of water. An increased amount of water molecules transported by small cations has been proposed in a recent eQCM study. 21 Instead of just considering the bare ions in eqn (3), a densified water layer surrounding each ion is taken into account. 47 This leads to the concept of an effective electron number. The numbers of tightly bound water molecules evaluated by Levi et al. 21 for carbon nanopores were used to calculate these effective values, which are listed in Table 1. The effective electron numbers of the K + and Na + ions are now similar, and both are larger than the one of the Cl À ion, in qualitative agreement with the experimental observation.
We shall now discuss the SAXS intensity in region Q-A (Fig. 4). If a simple two-phase model of a homogeneous electrolyte within the pores of the carbon matrix is applicable, the intensity in the SAXS regime should behave just opposite to the electrolyte structure factor in Q-B, since it is determined by the scattering contrast (Dr) 2 = (r c À r el ) 2 . This is obviously not the case for any of the used electrolytes (Fig. 4c-e). Again, for CsCl the situation should be the simplest one, since the scattering intensity changes will be dominated by the Cs + concentration changes. When assuming pure ion swapping, one would expect an intensity increase at positive voltage (when Cs + is expelled) and a decrease at negative voltage (when Cs + is adsorbed). However, at negative voltage not a minimum, but a strong intensity maximum is observed experimentally, which cannot be simply related to ion concentration changes. In the case of the KCl electrolyte at intermediate Q-values (1 nm À1 o Q o 5 nm À1 ), the intensity signal reveals maxima at positive and minima at negative voltages (Fig. 4d). This behavior would be consistent with the simple two-phase model considering the results from the electrolyte scattering. However, similar to the CsCl sample, an additional intensity maximum is observed at negative voltages at Q o 1 nm À1 , although this maximum is less pronounced. Finally, considering the effective electron number of Na + ions (Table 1) and the measured concentration changes (Fig. 3), the intensity change in the Q-A region should be rather similar to KCl, which is obviously the case (Fig. 4d and e).
We conclude that a simple two-phase model with an essentially homogeneous electron density distribution of the electrolyte within the micropores is not able to explain the behavior of the SAXS intensity within the Q-A regime. A peculiar feature, namely an intensity maximum at negative voltages, occurs for all electrolytes at medium to low Q-values. This maximum scales roughly with the effective electron number of the cations adsorbed, being largest for Cs + and smaller for K + and Na + .

The radius of gyration as a correlation length parameter
The deviation from a simple two-phase model is not unexpected, since -at least for large enough pores -the counter-ions are expected to accumulate close to the pore walls during doublelayer formation. Yet, SAXS from a multiphase system in connection with the complex disordered pore structure of activated carbons is not treatable without introducing too many ad hoc assumptions. Therefore, in order to understand the basic features of the structural arrangement of the ions within the pore space, Guinier analysis of the SAXS data is a convenient tool. 38 As the Guinier approximation is strictly applicable only for particulate systems of low volume fraction, the radius of gyration obtained from this analysis is merely a correlation length parameter without direct connection to a real size in the system. In Fig. 5, the relative change of the radius of gyration (R g ) is plotted as a function of the applied charge, with the values being normalized to the R g value at zero voltage. The magnitude of the normalized radius of gyration is high for CsCl and lower for KCl and NaCl at maximum negative voltage. Going from zero to maximum positive charge, all electrolytes show an increase of R g . The increase of R g left and right to the minimum is clearly correlated with the effective electron number (Table 1) of the individual counter-ions (Cs + , K + , or Na + at negative charge and Cl À at positive charge). Hence, the change in the correlation length rather than the change in the intensity seems to open a way to a better understanding of the in situ SAXS signals. This will be discussed in the following section.

Probing local ion arrangement
As seen from gas sorption data (see ESI †), the volume fraction of micropores in the electrode materials is 69% and the average pore size is about 1.3 nm. Hence, on average, there is enough space for two solvated ions next to each other to build up a layer of electrosorbed ions at the charged carbon surface. Such preferred arrangement of ions should lead to a significant change in the electrolyte electron density close to the carbon surface not only in the case of Cs + ions, but also for K + and Na + taking their effective electron numbers into account. Yet, the resolution of the SAXS setup is not sufficient to deduce unambiguously the real electron density profile.
As sketched in Fig. 6a, the increase of the actual electron density near the surface may be represented within a two-phase model by an effective decrease of the pore size. Upon charging, an excess amount of counter-ions will be attracted by the pore walls leading to an electron density profile as sketched in Fig. 6a on the bottom. The green dashed line represents this profile within the pore for heavy cations like Cs + (large effective electron number) and the red dashed line indicates the electron density profile caused by light ions like Cl À (having a small effective electron number). In our resolution limited SAXS experiment, the electron density near the pore walls can be replaced by the black line to represent again a two-phase model, leading to an effective decrease of the pore volume fraction. Furthermore, the average electrolyte electron density r el changes upon changing the average ion concentrations within the pore. This model is very useful and may be employed even for pores smaller than the double-hydrated ion diameter, as the probability of ions in proximity to the pore wall is still higher compared to the pore center.
We can now implement the data obtained from our Guinier analysis. As we are still in a two-phase approximation, the radius of gyration can be related to the actual volume fraction of pores and the carbon matrix. Within the Debye-Anderson-Brumberger (DAB) model, which has been used extensively to describe the structure of disordered carbons, this relationship is explicitly given in ref. 44, 45 and 50 via eqn (4): with the volume fractions of pores (j) and carbon (1 À j), and S/V being the surface area per unit volume. Hence an effective decrease of the pore volume fraction j for j 4 0.5 would lead to an increase of the product jÁ(1 À j). For our micropore structure, this product can increase from 0.69 Â 0.31 to 0.5 Â 0.5, corresponding to an increase of roughly 4%. Assuming the volume fraction to be the only parameter that changes in eqn (4), the radius of gyration increases significantly upon decreasing the pore volume fraction. Hence the effective pore width within the sketch of Fig. 6a changes according to the R g signal, while the average electrolyte density within the pore r el changes due to pure ion swapping (vertical shift of the profile in Fig. 6). Using these two independent parameters, R g from Fig. 5 and r el from Fig. 3, as an input for model calculations using the DAB model, we can simulate the scattering curves as a function of the applied charge. As a starting point we evaluated the fit parameters needed to describe the scattering curve at 0 V (Fig. S5, ESI †). Following this, the relative changes of all fit View Article Online parameters were calculated using the effective electron numbers (Table 1), the cation and anion concentration changes from the XRT evaluation (Fig. 3) and the radius of gyration signal (Fig. 5) as an input (see ESI † for more details). Fig. 6b shows that the scattering intensity increases at small Q-values when the radius of gyration is increased (in particular at negative voltages). The simulations of all three electrolytes are in excellent agreement with the measured scattering data (Fig. 4c-e). Using only two independent signals from the XRT evaluation (ion concentrations) and the SAXS measurements (R g ) as an input for a simple model, we were able to fully reproduce the complex changes of the SAXS intensity. Hence, the relative change of the radius of gyration in Fig. 5 can be understood as a measure for ions preferably adsorbed on the pore walls and weighed by a factor related to the effective electron number (see sketch in Fig. 6a). With this we can come to a qualitative explanation of Fig. 5 as being a measure of the local ion concentration close to the pore walls.
Interestingly, the local ion concentration near the pore walls (Fig. 5) behaves quite differently as compared to the global ion concentration (Fig. 3) which was interpreted as pure ion swapping. The radius of gyration signals increase strongly at negative applied charge, but only slightly at positive values. In the simplest scenario, we expect the local ion concentration near the pore walls to behave similar to the globally measured ion swapping. In this case, we should see an increase of R g at negative and a decrease of R g at positive applied charge, since the R g signal is dominated by the local ion concentration changes of cations (having a larger effective electron number). This is actually not the case, as we have observed an increase in both directions of the applied charge. In fact, the R g signal suggests the preferred arrangement of counter-ions locally close to the pore walls, depending on the polarization of the electrode. However, on a global scale, the ion transport in and out of the pores on the other hand is accommodated by ion swapping.
Moreover, we have to point out the unique similarity between R g (Fig. 5) and eQCM data (i.e., mass change vs. charge). To our knowledge, eQCM has, so far, only shown counter-ion adsorption as the dominant charge compensating Fig. 6 (a) Sketch of the electron density profile of a carbon pore filled with the electrolyte at 0 V (top). The size of the sketched ions corresponds roughly to the dehydrated ion size with respect to the average pore size of 1.3 nm. Water molecules in the hydration shell and the solvent are not visualized. When applying a voltage, the average ion concentration within the pores will change (ion exchange in and out of the pores: indicated as black arrows on the top). Moreover the ions will re-arrange locally within the nanopore (local re-arrangement: blue arrows on the top). These changes lead to electron density profiles as sketched on the bottom. In the case of heavy ions (large effective electron number), the preferably adsorbed ions next to the pore walls will lead to a significant increase of the electron density close to the pore walls. The sketch of the real electron density across the pore (green dashed line) can be replaced by the profile shown by the black solid line suggesting an apparent decrease of the pore size. The same argument is valid for negative voltages when Cl À ions are situated preferably near the pore walls, but due to their lower effective electron number the apparent decrease of the effective pore width is smaller. The sketched profiles on the bottom describe the situation exemplarily for À0.8 V and +0.8 V. These two points are indicated as dashed lines within the simulated scattering intensities in (b). (b)-(d) Simulated scattering intensities of all three electrolytes, covering changes of the pore volume fraction, the average electrolyte density and the electrolyte structure factor. (b) CsCl, (c) KCl, (d) NaCl. The simulations reproduce very well the main features of the measured scattering intensity changes (Fig. 4c- mechanism for a variety of electrolytes and salt concentrations. Yet, pure ion swapping has not been observed so far at large enough potentials. 11,21,51 In this study only counter-ions are involved in the local re-arrangement, which explains the similarity between the R g and eQCM data. On the other hand, the ion exchange in and out of the micropores is realized by pure ion swapping, which corresponds to the actual mechanism counterbalancing the electrode charge. The minimum of the curves in Fig. 5 might be taken as an indication for the point of zero charge (PZC), similar as proposed in recent eQCM studies. 52 However, since the actual charge compensating mechanism seems to be ion swapping, the R g signal (local ion redistribution) is probably not suitable for the determination of the ''overall'' (global) PZC.
Since only relative changes of R g are discussed, the arrangement of ions under 0 V conditions can be only estimated. Hence, the presented electron density profiles and ion concentrations represent excess values with respect to the 0 V situation. MD simulations have shown the preferred position of ions near the pore walls already at 0 V. 53 However, independent of the distribution of ions across the pore at 0 V, the change of R g corresponds to a local re-arrangement of ions from the center towards the pore walls. Using combined in situ SAXS and XRT one is sensitive to both the global ion concentration (corresponding to the average ion concentration within the micropores) and the local ion arrangement within the pores. Finally, we should mention that the profiles in Fig. 6c and d were simulated by using effective electron numbers of 40 for both, the hydrated Na + and K + ions. When using instead the literature values of 31 and 32 electrons, respectively (see Table 1), the basic features are qualitatively reproduced, but the correspondence between Fig. 4d, e and Fig. 6c, d is not good. We speculate that detailed confinement effects, being different for different carbons, may be responsible for this deviation. Furthermore deviations might be induced by the different nature of the methods. However, a detailed investigation of the role of water (and hydration) must be left open for future investigations.

Conclusions
We have presented the first comprehensive and complementary in situ (operando) SAXS and XRT study of a carbon supercapacitor in aqueous media which revealed novel insights into the structural and concentration dependent changes of ions within the confinement of nanopores. X-ray transmission represents a fast, reliable, and easy-to-measure signal to study the integral ion flux independent of the pore size. SAXS data, on the other hand, allow to simultaneously investigate processes at different length scales. In this way, we combine the advantage of eQCM (global ion accounting) with in situ NMR (in pore probing) and obtain information on the local ion arrangement. The latter has, so far, only been accessible via simulation 53 or on flat plates using X-ray reflectometry 54 which is difficult to translate to the complex situation in confinement of carbon nanopores inside activated carbon particles.
Our data help to draw a clearer picture of ion electrosorption in aqueous media with high ionic strength (i.e., 1 M). Globally, charge accommodation is accomplished without changing significantly the global number of ions in the pores, that is, cations plus anions. Effectively, this corresponds to what is we call ion swapping. Only for highly charged electrodes, our data imply the onset of transition towards preferred counter-ion adsorption. Yet, ion electrosorption also entails a second component, namely local in pore ion re-arrangement. Compared to the uncharged state, counter-ions move much closer to the pore wall and facilitate the formation of a dense ion layer. This process is intimately tied with the ionic system and the solvent, in our case water. In particular, we have shown that we have to consider a much ''denser'' hydration shell with an increased amount of water molecules transported by small cations. This experimental fact should further motivate modeling groups to take the solvent (water) properly into account in atomistic simulations. 13,16,55 The ability to distinguish between cation and anion processes sets the stage to provide novel experimental insights into the complex mechanism of ion electrosorption in carbon nanopores. Even more important is the unique usefulness and the plethora of complementary information when we consider the advanced stage of modeling that now even taps into charge/discharge kinetics and adopts more realistic pore networks. 4,[56][57][58] Yet, most experimental techniques fall short to provide a molecular picture of the ion electrosorption process and we believe that our approach adds an advanced technique to the limited number of electrochemical in situ methods. More generally, this novel approach might be of interest for a variety of fields where ion adsorption within confined geometry plays an important role. Most importantly, we think that our results and the potential of this method may help to advance the growing field of capacitive deionization for which exact quantitative knowledge of the dominant charge storage mechanism (ion swapping versus counter-ion adsorption) determines the so-called charge efficiency.