Abstract
A density-functional theory is developed in which the local density of a ionic fluid near an interface can be calculated. To find this local fluid structure, the Helmholz free energy is approximated using a perturbation expansion around an optimized reference state. The density of this reference state follows directly from the theory once an approximation for the direct correlation function in the homogeneous reference state is given; i.e., no coarse-graining procedure has to be imposed beforehand. Using the mean-spherical-approximation to the direct correlation function, the theory is applied to three different physical situations. In the restricted primitive electrolyte model near a charged wall we find layering of the counterions, and on adding a neutral third component we find spontaneous charge inversion; i.e., a negatively charged wall develops a positive potential. In the molten-salt regime the model shows very strong oscillations in the potential as a function of the distance from the wall, due to the fluctuation corrections.