Abstract
Classical density functional theory (DFT) of fluids is a valuable tool to analyze inhomogeneous fluids. However, few numerical solution algorithms for three-dimensional systems exist. Here we present an efficient numerical scheme for fluids of charged, hard spheres that uses O(N log N) operations and O(N) memory, where N is the number of grid points. This system-size scaling is significant because of the very large N required for three-dimensional systems. The algorithm uses fast Fourier transforms (FFTs) to evaluate the convolutions of the DFT Euler–Lagrange equations and Picard (iterative substitution) iteration with line search to solve the equations. The pros and cons of this FFT∕Picard technique are compared to those of alternative solution methods that use real-space integration of the convolutions instead of FFTs and Newton iteration instead of Picard. For the hard-sphere DFT, we use fundamental measure theory. For the electrostatic DFT, we present two algorithms. One is for the “bulk-fluid” functional of Rosenfeld [Y. Rosenfeld, J. Chem. Phys. 98, 8126 (1993)] that uses O(N log N) operations. The other is for the “reference fluid density” (RFD) functional [D. Gillespie et al., J. Phys.: Condens. Matter 14, 12129 (2002)]. This functional is significantly more accurate than the bulk-fluid functional, but the RFD algorithm requires O(N2) operations.
INTRODUCTION
Since its inception 30 years ago, classical density functional theory (DFT) of fluids has developed into a fast and accurate theoretical tool to understand the fundamental physics of inhomogeneous fluids. A review of this derivation is given by Evans.1 To determine the structure of a fluid, DFT minimizes a free energy functional by solving the Euler–Lagrange equations δΩ∕δρk=0 for the inhomogeneous density profiles of all the particle species k. When solving on a computer, the density can be discretized (called free minimization) or a parameterized function form such as Gaussians can be assumed (called parameterized minimization). This approach has been used to model freezing, electrolytes, colloids, and charged polymers in confining geometries and at liquid-vapor interfaces (reviewed by Wu2). Our group has applied one-dimensional (1D) DFT to biological problems involving ion channel permeation, successfully matching and predicting experimental data.3, 4
DFT is different from direct particle simulations where the trajectories of many particles are followed over long times to compute averaged quantities of interest (e.g., density profiles). DFT computes these ensemble-averaged quantities directly. However, developing an accurate DFT is difficult and not straightforward. In fact, new, more accurate DFTs are still being developed for such fundamental systems as hard-sphere fluids,5, 6, 7 electrolytes,8, 9 and polymers.10
When a functional does exist, DFT calculations are, in principle, much faster than particle simulations because DFT requires solving only a small set of Euler–Lagrange equations. This is especially true for systems with planar, spherical, or cylindrical symmetry because in many cases the Euler–Lagrange equations can be integrated analytically over the extra dimensions. The resulting equations have only one space variable, while particle simulations are always performed in three dimensions.
In systems with little or no symmetry, however, the situation is different. Many of the DFTs for important systems such as hard spheres,5, 6, 7, 11, 12 Lennard-Jones dispersion forces,13 and electrostatic interactions8, 9, 12 require computing a significant number of convolutions. This increased computational complexity quickly increases computational time. Moreover, commonly used numerical techniques scale poorly with system size, requiring O(N2) operations (where N is the number of grid points). For a complex system (e.g., in biology) that requires N≳106 for sufficient spatial resolution, this can, in our experience, mean the difference between 1 week of computer time for an O(N2) algorithm versus 1 h for an O(N log N) algorithm. For this reason, the vast majority of DFT calculations are performed in one dimension, although there are software packages for three-dimensional (3D) system. For example, TRAMONTO software for nanostructured fluids in materials and biology has been freely available since 2007.14
For 3D DFT equations, several different methods are available to iteratively solve the equations and to evaluate the convolution integrals. Each choice offers different trade-offs in programing difficulty, computation time, memory usage, and system size scalability. For example, Newton iteration requires very few iteration steps compared to Picard (iterative substitution) iteration, but each Newton step generally takes significantly longer than a Picard step. For the convolution integrals, either fast Fourier transforms (FFTs) or real-space methods can be used. FFTs require a regular, evenly spaced grid and O(N log N) operations. On the other hand, real-space methods can (in principle) use an unevenly spaced grid (giving a smaller N than required by the FFTs), but require O(N2) operations. The TRAMONTO software used Newton iteration with real-space convolution evaluation.
In this paper, we describe a FFT-based Picard iteration method. We chose this approach for several reasons. First, our numerical experiments showed that Picard iteration was generally faster than Newton and that in systems with liquidlike concentrations Newton did not always converge. Second, we found that real-space methods are impractical for DFT because of the specific kernels of the convolution integrals used in DFT. These convolutions integrate the densities over the interiors and surfaces of spheres (described in detail in Sec. 2). Neither the sphere interior nor surface can be represented with sufficient accuracy using real-space methods; however, they can be represented exactly using Fourier transforms. Lastly, our solution method requires O(N log N) operations and O(N) memory for hard-sphere fluids. Therefore, it scales optimally with system size.
Currently, this optimal scalability is for uncharged hard spheres. Electrostatics is more complicated. There are two kinds of electrostatic DFTs in general use, both based upon a perturbation technique. In the “bulk-fluid” (BF) method, the electrostatic component of the free energy functional is expanded around a BF,12 while the “reference fluid density” (RFD) method updates the reference fluid with information from the ionic densities .8, 9 The BF method is the most commonly used (in TRAMONTO, for example) and we show how to implement it with the optimal O(N log N) operations and O(N) memory scaling. The BF electrostatic technique can, however, be qualitatively incorrect15 (as shown later in Figs. 234). As we describe in Sec. 4C, the mathematical structure of the RFD equations is fundamentally different from the convolution-based DFTs of hard spheres and the BF electrostatics method. In this paper, we also describe an O(N2) operations and O(N) memory implementation of the RFD electrostatics method. Reducing the number of operations for the RFD electrostatics method is the subject of future work.
Figure 2.
Comparing 1D and 3D DFT cation concentrations to MC simulations. The wall is uncharged, the cation concentration is 1M, and the ions are univalent. The 1D RFD DFT is shown with the blue squares, 3D RFD DFT with blue circles, and MC with green squares.
Figure 3.
Comparing 1D and 3D DFT anion concentrations to MC simulations. The wall is uncharged, the cation concentration is 1M, and the ions are univalent. The 1D RFD DFT is shown with the blue squares, 3D RFD DFT with blue circles, and MC with green squares.
Figure 4.
Comparing 1D and 3D DFT mean electrostatic potential to MC simulations. The wall is uncharged, the cation concentration is 1M, and the ions are univalent. The 1D RFD DFT is shown with the blue squares, 3D RFD DFT with blue circles, and MC with green squares.
THEORY
The DFT Euler–Lagrange equations determine the densities in equilibrium in the grand canonical ensemble which is defined by the electrochemical potential for each ion species i in the bath, . The , in turn, are determined by the bath concentrations , detailed in Appendix A. In equilibrium, the flux density for each ion species is identically zero, so that
| (1) |
constraining the electrochemical potential for each ion species μi to be a constant, .
Here the total electrochemical potential μi(x) is a functional of the densities , which is divided into three parts, an external (ext) potential, an ideal gas portion, and an excess (ex) chemical potential,
| (2) |
The ideal gas part is given by
| (3) |
where ρi represents the number density of species i, k is Boltzmann’s constant, and T is the Kelvin temperature. Moreover, is the concentration-independent part of the electrochemical potential arising from an external field. We use this to define the problem geometry, such as a hard wall. Lastly, comes from particle interactions. Thus, in equilibrium we have
| (4) |
This paper outlines an algorithm for Eq. 4 for charged, hard spheres.
For a system of charged hard spheres, DFT decomposes the excess chemical potential into two components, the hard-sphere (HS) and electrostatic (ES) interactions,
| (5) |
where the electrostatic component is further decomposed into a mean field contribution, arising from interactions between uncorrelated ions, and a screening (SC) term arising from electrostatic correlations. We define zi to be the valence of species i and e the elementary charge. The mean electrostatic potential ϕ satisfies Poisson’s equation,
| (6) |
where the dielectric coefficient ϵ is a constant throughout the entire system. The definition of the hard-sphere and the screening components of μi in terms of ρi constitute the heart of the DFT approach and are discussed in detail in the subsequent sections.
HARD-SPHERE INTERACTION
The essential DFT-specific modeling of particle interactions is contained in the definition of the chemical potentials and . In order to model the interaction of hard spheres, which defines , we use the fundamental measure theory (FMT) developed by Rosenfeld.11 In FMT, a suitable basis is produced which best captures the dependence of the potential on the densities. These basis functions, nα, are obtained from averages of the densities
| (7) |
where the integral is taken over all space and α∊{0,1,2,3,V1,V2}. The weighting functions are given by
| (8) |
where is the spherical radial vector. Note that the V1 and V2 functions are vectors, as are the associated nV1 and nV2 functions. If constant concentrations are used in Eq. 7, the “fundamental geometric measures” of the hard spheres (surface area, volume) are recovered.
The HS chemical potential is given by11
| (9) |
A number of different ΦHS(nα) functions have been developed,5, 6, 7, 11, 12 which have different consequences, most notably the equation of state for a hard-sphere fluid modeled with the DFT formalism. We have used the antisymmetrized version developed by Rosenfeld et al.,16
| (10) |
However, other choices for ΦHS(nα) do not change the numerical scheme we describe below.
It is also important to note that the nα integrals 7 are, up to the sign of the argument of the weight function, convolutions. Since the weight functions ωα are either even or odd, we can always convert the integral to a proper convolution. Therefore, they may be evaluated using the Fourier transform and the convolution theorem,
| (11) |
where F is the Fourier transform operator and the hat denotes the Fourier image of the function. The chemical potential can be calculated in exactly the same way, with ρi replaced by ∂ΦHS∕∂nα.
In order to evaluate Eq. 11, we use the FFT for both the transformation of ρi and the inverse transform of the product . However, the are distributions and are not easily represented on the rectangular grid required by the FFT. Even a very fine discretization introduces unacceptably large errors and destroys conservation properties of the basis (e.g., conservation of total mass). Thus, if constant concentrations are used in Eq. 7, the geometric measures of the sphere are not recovered with straightforward real space methods. In three dimensions, unlike in one dimension, in our numerical experiments, these errors persist no matter how fine a grid is used. This is a severe problem for real space methods, such as those used in TRAMONTO. This problem might be resolved through a specialized quadrature, however, the authors know of no solution yet proposed.
Rather than attempt to discretize the weight functions on a grid, we compute the Fourier transform of each weight function analytically, and then evaluate them on the same mesh in Fourier space as used by the FFT. The calculations of the analytic Fourier transforms of ωα are given in detail in Appendix B. This strategy allows us to calculate machine precision convolutions with arbitrary density fields, whereas the naive discretization of the weight functions produce substantial errors, often in excess of the field value itself. For example, using the convolution theorem, Eq. 11, we recover the geometric measures for a constant density field only when using analytic Fourier transforms of the weight functions.
ELECTROSTATICS
Mean field
In order to obtain ϕ, we solve the Poisson Eq. 6, for which the source is the charge density ∑iziρi. Since we have access to from the calculation of nα, we may solve Eq. 6 in the Fourier domain, in which the Laplacian is diagonal. Then the mean electrostatic potential ϕ can be calculated by dividing by the eigenvalues of the discrete Fourier transform. At grid vertex , we have
| (12) |
where hx, hy, and hz are the grid spacings in each direction and kx, ky, and kz are calculated as described in Appendix B. In order to fully specify the potential in Eq. 12, we must choose a constant for the ground since is defined only for k≠0. We do this by setting , a common boundary condition for the periodic Poisson problem that is equivalent to setting the constant Fourier mode to zero. However, this does not guarantee that at some point far from the wall since we have a finite bath. Thus, we add the constant to ϕ for some on the boundary to enforce this condition.
BF method
The component of Eq. 5 attempts to account for electrostatic screening interactions. In the BF model, it is calculated as an expansion around the bath concentration. From Ref. 8, we have
| (13) |
where Rij=Ri+Rj, Ri is the radius of ions of species i, , is the two-particle direct correlation function (DCF), and is the interaction potential of two point particles of charges zie and zje located at and , so that17
| (14) |
where λk=Rk+s with s=1∕(2Γ), the screening length of the bath.18, 19 The mean spherical approximation (MSA) screening parameter Γ is derived in Ref. 19 (see also Appendix A).
The integral in the expansion for is a convolution, which we also evaluate in the Fourier domain. This requires F(Δρj), calculated using the FFT, and the transform of Eq. 14 which is calculated analytically below. It should be noted that in this model of electrostatics, transformations of the need only be calculated once since they are fixed by the problem parameters. Additionally,
| (15) |
where we have already calculated F(ρj) for the nα calculation in Eq. 11, and F(ρbath) is a constant. Thus, the only necessary Fourier transform each iteration is the inverse transformation.
The accuracy of the transform of Eq. 14 is key to the convergence of the nonlinear iteration for the equilibrium condition. In fact, we were unable to obtain convergence when evaluating these transforms numerically using the FFT and were forced to develop analytical expressions. In order to calculate each piece of , we must take the Fourier transform of powers of r. The generic term has the form
| (16) |
where k is the magnitude of . We derive a recursive definition for the integral In using integration by parts,
| (17) |
| (18) |
For Eq. 14, we need the terms
| (19) |
| (20) |
| (21) |
We also need their limits as k tends to 0,
| (22) |
| (23) |
| (24) |
Then we have
| (25) |
RFD method
The RFD method is an alternative to the BF method to compute . As shown in Ref. 15 and Figs. 234 below, it is more accurate than the BF method. The RFD electrostatic functional is detailed in Refs. 8, 9 and briefly summarized here. This perturbation method approximates with a functional Taylor series, truncated after the quadratic term, expanded around a reference fluid,
| (26) |
with
| (27) |
where is a given (and possibly inhomogeneous) reference density profile. By defining RFD densities to be the bulk densities, we recover the BF perturbation method. The RFD approach makes the reference fluid densities functionals of the particle densities ,9
| (28) |
where is the RFD functional. In Ref. 9, it is shown that the first-order DCF is given by
| (29) |
| (30) |
where
| (31) |
| (32) |
| (33) |
For the RFD functional, the densities must be chosen so that both the first- and second-order DCFs and can be estimated. This is possible because the densities are a mathematical construct and do not represent a physical fluid. The particular choice of the RFD functional we use here is that of Ref. 8, which is also discussed in Ref. 9,
| (34) |
where the {αk} are chosen so that the fluid with densities is charge neutral and has the same ionic strength as the fluid with densities at every point . The radius of the sphere over which we average is the local electrostatic length scale. Specific formulas for and are given in Refs. 8, 9. In order to estimate the electrostatic DCFs and at each point, we use a bulk formulation (specifically the MSA) at each point with densities , detailed in Appendix A.
The RFD reference density can be rewritten as the following smoothing operation:
| (35) |
where θ(x)=1−H(x) and H is the Heaviside function20
| (36) |
Equation 35 resembles a convolution, but unfortunately the screening radius is nonconstant, and thus the convolution theorem is inapplicable. We compute RSC using [Eq. (42) in Ref. 8]
| (37) |
where indicates the density of species i after we have forced the mixture be locally electroneutral and have the same ionic strength.
We can express Eq. 35 in the compact notation
| (38) |
where the kernel is given by
| (39) |
Since the Fourier transform is an L2 isometry, this expression is equivalent to
| (40) |
where we use the hat to indicate the Fourier transform and star to indicate complex conjugation. Furthermore, we can calculate the Fourier transform of our kernel analytically. We have
| (41) |
| (42) |
| (43) |
| (44) |
| (45) |
where . This integral has been evaluated above in Sec. 4B, so that
| (46) |
Thus we can calculate the action of the screening operator by performing the dot product in Eq. 38 at each vertex of the real space grid. This algorithm has overall complexity O(N2), however it is accurate to machine precision. Alternative schemes to accelerate the operator application will be discussed in Sec. 7.
In order for this formulation to be consistent, we demand that the screening radius used to construct the RFD ρref is identical to that given by the local MSA closure. Thus, we augment our system of equations with
| (47) |
Here, the left hand side of Eq. 47 indicates the value of Γ used to determine the RFD using Eq. 35, whereas the right hand side is calculated using Eq. A6, with ρref replacing ρbath as the local equilibrium value. This equation is added to our global system at each vertex, producing the same number of additional equations as another ion species.
DISCRETIZATION AND SOLUTION IN EQUILIBRIUM
Problem (4) is solved on a rectangular prism domain, supporting a different system size in each Cartesian direction. This geometry is well supported by the PETSc DA abstraction,21 which also allows for easy parallelization. The grid is uniform in each direction, which allows one to compute the convolutions using Fourier transform techniques. PETSc supports the FFTW package22 automatically. Periodic boundary conditions are naturally enforced by the FFT.
The bath potential, , and external potential, , are calculated just once during the problem setup. The geometry is defined using external potentials, . The excess chemical potential is dependent on the concentration, as is the electrostatic potential, so these are recalculated at each residual evaluation. Moreover, the evaluation of the ten ∂ΦHS∕∂nα and the nα at each grid point must be done at each residual evaluation since they are also dependent upon ρi.
Nonlinear solver
Equation 4 is a fixed point problem for each ion species i,
| (48) |
The problem is solved using a Picard iteration since in our experiments Newton’s method was both less robust, in that it did not always converge, and less efficient, since it took more time when it did converge. Each new iterate ρ(1) is generated from an initial guess ρ(0) using
| (49) |
where ρ is understood as a vector of densities over ion species. However, with higher bath densities, it is necessary to use a line search during the Picard update rather than just successive substitution. Thus, our new guess ρ* is given by
| (50) |
where α is the line search parameter. We determine α by sampling the function G at several densities, fitting the residual values, ‖ρ−G(ρ)‖, to a polynomial in α, and choosing αmin corresponding to the minimum residual value. We currently have a quadratic line search, suggested to us by Roth,23 which fits the squared L2 norms of the residuals from Eq. 49 as this seemed to better match curves in the search parameter we sampled for testing.
In addition, because is the local packing fraction, it should never exceed unity. We bound it by 0.9 which allows us to bound the maximum allowable search parameter α since n3 is a linear function,
Here, is the L∞ norm, which picks the maximum value of in the finite dimensional case. This bound was also suggest by Roth.23 Finally, we have
| (51) |
We have also experimented with Newton’s method, forming the action of the Jacobian operator using finite differences. The linear systems are solved with GMRES.24 Both fixed linear system tolerances and those chosen according to the Eisenstat–Walker scheme were used. However, the Newton method was not competitive with Picard due to linear convergence through most Newton steps and the large cost of computing the Jacobian action.
Numerical stability
With a coarse grid, there is a potential for serious roundoff error when calculating both the average over an ion surface, n2, and the directional average, nV2. From the definition 7 we have
| (52) |
| (53) |
| (54) |
Here and S(Ri) is the surface of a sphere of radius Ri. Likewise,
| (55) |
| (56) |
| (57) |
Appendix C shows that
| (58) |
However, discretization errors in the computation of the last term of Eq. 10, or its derivative ∂Φ∕∂nα, can combine to produce large values of this ratio, stalling the nonlinear solve and leading to unphysical artifacts. These artifacts produce large density oscillations at sharp corners along the geometric boundary. These oscillations eventually cause divergence of the nonlinear iteration and prevent accurate solution of the equations. We alleviate this problem by enforcing the bound explicitly.
VERIFICATION
At several points in the calculation, we perform consistency checks of the results. Moreover, we compare our results to known thermodynamic solutions, in the limit of very fine meshes. We first check that we recover the fundamental measures, which are easily computed analytically, when we compute nα(ρ) with a constant unit density. We also check that in the bath, n3 is equal to the combined volume fraction of the ion bath concentrations.
Moreover, we can verify that in symmetric situations, such as near a hard wall, the solution must be homogeneous over each plane parallel to the wall. As described earlier, these consistency checks are satisfied when analytic Fourier transforms of the weight functions ωi are used, but not using the FFT or real space methods. We can solve an effectively 1D problem with a wall at z=0 and periodic in each dimension in order to compare with thermodynamic results. With purely hard-sphere interactions, we have another consistency check, namely a relation between the pressure P [Eq. A5] in the bath and the density of each species at its distance of closest approach to the wall (its radius Ri),15, 25
| (59) |
The FMT DFT of hard spheres is known to satisfy Eq. 59, but this relation holds only approximately for electrostatic functionals described here.15
Hard-sphere fluids
A very sensitive test for calculations of ionic solutions is the thermodynamic sum rules, such as Eq. 59. We use the relative error in Eq. 59 as the figure of merit to assess the thermodynamic consistency of our hard-sphere calculations.
A notable advantage of the DFT formulation over particle simulations, such as a Monte Carlo (MC) for hard spheres, is that both very low and very high densities can be handled efficiently with no algorithmic changes. Low densities are difficult for canonical ensembles, such as canonical MC or molecular dynamics, because very large systems are required for accurate statistics. A grand canonical formulation of MC can mitigate the problems for low densities, however, high densities still result in jamming and high rejection rates, requiring very long run times. This can sometimes be repaired using very specialized techniques,26, 27 however, currently these cannot be applied to general systems of the type we present below.
In order to demonstrate the performance of our algorithm across a range of densities, we simulate a hard-sphere liquid against a hard wall. The particles have radius 0.1 nm. In Fig. 1, we show both the simulation time and accuracy over volume fractions ranging from 10−5 to 0.4. By accuracy, here we mean the residual with respect to tests of thermodynamic self-consistency from Eq. 59. Our results are quite accurate, and even at liquid densities the calculations done on a laptop take less than 1.5 h. Note that, although this is an effectively 1D problem to facilitate verification, the computation was performed in a full 3D geometry. While specialized simulation techniques for hard spheres may compute this result more rapidly, the purpose of Fig. 1 is to show the precision and thermodynamic consistency of our code and also the O(N log N) scaling of compute time with density. Our goal is to maintain this scaling, even with the addition of electrostatics.
Figure 1.
Both relative accuracy and simulation time are shown for a hard-sphere liquid of particles with radius R=0.1 nm, where accuracy is for the thermodynamic self-consistency sum rule of Eq. 59 with pressure calculated using Eq. A5. The domain is divided into cubes which are 0.05×0.05×.00625 nm3.
Ionic fluids
Calculation of ionic densities near a hard wall also provides a sensitive test for the consistency of the DFT method. In Ref. 15, it is demonstrated that the BF version of DFT [Eqs. 13, 14] provides qualitatively incorrect densities when the surface charge is low, when compared with the RFD functional [Eqs. 27, 28, 29, 30, 31, 32, 33, 34] and high resolution MC simulation. We have successfully reproduced the 1D DFT and MC results with the 3D code, attesting to the correctness of our approach. Below, we discuss a representative simulation.
For our trial calculation, we examine a salt solution of univalent ions. The cation has radius 0.1 nm, the anion 0.2125 nm. Each species has a 1M bath concentration. The simulation cell, 2×2×6 nm3, is periodic in each direction. A hard, uncharged wall is placed a z=0. We discretize the density on a 21×21×161 grid. The results are insensitive to the resolution in the transverse (x−y) directions, but very sensitive in the normal (z) direction. We verify the homogeneity of the solution across x−y planes to machine precision. In Figs. 23, we show the excellent match between 1D and 3D DFT results, with MC results shown for comparison. The mean electrostatic potential is shown in Fig. 4, also with good agreement.
The BF calculations are currently much more efficient than the RFD calculations, needing only 1.5 min compared to more than a day to run since BF scales as O(N log N), whereas the RFD method scales as O(N2) and additional iterates are needed to obtain a converged reference density. However, the extra investment of time for RFD computations is necessary because the BF solution is qualitatively incorrect compared to MC simulations.
CONCLUSIONS AND FUTURE WORK
We have presented a full numerical strategy for solving the 3D equilibrium DFT system. The hard-sphere calculation accurately reproduces thermodynamic sum rules and agrees with prior MC simulation. Moreover, using the improved RFD electrostatic formulation due to Gillespie et al.,8 we can accurately reproduce electrostatic behavior near a hard wall for species of differing radii. Thus, the DFT can now become a powerful tool for full 3D chemical simulation, accurately capturing both the energetic and entropic contributions to the solution.
There are also several avenues for improvement of the RFD algorithm and extension of the capabilities of the current code. The dominant cost of this algorithm is the calculation of the reference density used to describe electrostatic screening. The current algorithm is very accurate, but requires O(N2) work. Since the Fourier kernel is smooth and has rapid decay, it should be possible to construct a multiresolution analysis of it, resulting in a fast method for application. Moreover, the many FFTs performed at each Picard step could be replaced by unequally spaced FFTs or wavelet decompositions, which would allow adaptive refinement and increase the size of problems we can efficiently compute. The FFT and fast wavelet transform lend themselves readily to a scalable parallel implementations. In fact, it should also be possible to offload these transforms onto a multicore coprocessor, such as the Tesla 1060C GPU.28 This will make large scale simulations of charged hard spheres accessible to working scientists even on a laptop or desktop computer. These algorithmic improvements are the focus of current research.
ACKNOWLEDGMENTS
This material is based upon work supported by, or in part by, the U. S. Army Research Laboratory and the U. S. Army Research Office under Contract No. W911NF-09-1-0488 (D.G. and M.G.K.). The work was also supported by NIH Grant No, GM076013 (R.S.E.). M.G.K. was partially supported by the U.S. Department of Energy under Contract No. DE-AC01-06CH11357. We thank Roland Roth and Dezső Boda for helpful discussions.
APPENDIX A: CALCULATION OF THE BATH CHEMICAL POTENTIAL
Here we describe the formulas for the electrochemical potential in a homogeneous fluid. Here the DFT for hard spheres uses a Percus–Yevick equation of state,29 and the electrostatics is described using MSA.18, 19 We follow the treatment in Ref. 30. The bath chemical potential has two components, hard sphere and electrostatic,
| (A1) |
which are calculated thermodynamically,31
| (A2) |
based upon the auxiliary variables, where σi is the ion diameter of species i,
| (A3) |
| (A4) |
and the pressure due to hard-sphere interaction in the bath,
| (A5) |
The calculation of as given above is straightforward, but , on the other hand, is dependent on an implicitly defined parameter Γ, the MSA inverse screening length,
| (A6) |
where η represents the effects of nonuniform ionic diameters
| (A7) |
and Ω is determined by
| (A8) |
This implicit relationship is a quartic equation in Γ, which we solve using Newton’s method. We may then calculate the bath potential
| (A9) |
APPENDIX B: EVALUATION OF THE FOURIER TRANSFORM OF THE WEIGHTING FUNCTIONS
We must be careful to evaluate our analytic transforms at the same values, in the same order, as those computed using the particular implementation of FFT we use. Given a D dimensional grid, the vector {kd} which corresponds to the vertex {jd} of our Cartesian grid is given by
| (B1) |
where Nd is the number of grid points in dimension d∊{x,y,z} and hd is the grid spacing Ld∕(Nd−1).
We begin with the calculation of ,
| (B2) |
| (B3) |
We now choose a rotated coordinate system (the prime system) in which points purely in the z′ direction, in order to take advantage of the rotational symmetry of the problem. In the new coordinate system,
| (B4) |
| (B5) |
| (B6) |
which, in the original coordinate system, is
| (B7) |
From Eq. 8, we also have
| (B8) |
Recognizing that the theta function can be obtained as the integral of a delta function, we have
| (B9) |
| (B10) |
| (B11) |
Following a similar procedure as in the calculation, but keeping track of the vector nature of ωV1 and ωV2,
| (B12) |
| (B13) |
| (B14) |
The preceding expressions for may be evaluated at , but care must be taken when calculating the limit.
It should be noted these are the limits one would expect since in the case we are simply integrating either a spherical delta or step function over all space, thereby recovering surface area and volume expressions for a sphere.
APPENDIX C: DIRECTIONAL AVERAGE BOUND
We can bound the directional average of the density over a sphere in terms of the unweighted average, and thus we can bound the ratio
| (C1) |
in the calculation of Φ(n) from Eq. 10. We let ν(θ,ϕ) be the unit vector at the surface of the sphere in the (θ,ϕ) direction. Using Fubini’s theorem and the Cauchy–Schwarz inequality, we have
| (C2) |
| (C3) |
| (C4) |
| (C5) |
| (C6) |
| (C7) |
| (C8) |
so that
| (C9) |
References
- Evans R., Adv. Phys. 28, 143 (1979). 10.1080/00018737900101365 [DOI] [Google Scholar]
- Wu J., AIChE J. 52, 1169 (2006). 10.1002/aic.10713 [DOI] [Google Scholar]
- Gillespie D., Xu L., Wang Y., and Meissner G., J. Phys. Chem. B 109, 15598 (2005). 10.1021/jp052471j [DOI] [PubMed] [Google Scholar]
- Gillespie D., Biophys. J. 94, 1169 (2008). 10.1529/biophysj.107.116798 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Roth R., Evans R., Lang A., and Kahl G., J. Phys.: Condens. Matter 14, 12063 (2002). 10.1088/0953-8984/14/46/313 [DOI] [Google Scholar]
- Yu Y. -X. and Wu J., J. Chem. Phys. 117, 10156 (2002). 10.1063/1.1520530 [DOI] [Google Scholar]
- Hansen-Goos H. and Roth R., J. Phys.: Condens. Matter 18, 8413 (2006). 10.1088/0953-8984/18/37/002 [DOI] [PubMed] [Google Scholar]
- Gillespie D., Nonner W., and Eisenberg R. S., J. Phys.: Condens. Matter 14, 12129 (2002). 10.1088/0953-8984/14/46/317 [DOI] [Google Scholar]
- Gillespie D., Nonner W., and Eisenberg R. S., Phys. Rev. E 68, 031503 (2003). 10.1103/PhysRevE.68.031503 [DOI] [PubMed] [Google Scholar]
- Yu Y. -X. and Wu J., J. Chem. Phys. 116, 7094 (2002). 10.1063/1.1463435 [DOI] [Google Scholar]
- Rosenfeld Y., Phys. Rev. Lett. 63, 980 (1989). 10.1103/PhysRevLett.63.980 [DOI] [PubMed] [Google Scholar]
- Rosenfeld Y., J. Chem. Phys. 98, 8126 (1993). 10.1063/1.464569 [DOI] [Google Scholar]
- Evans R., Fundamentals of Inhomogeneous Fluids (CRC, Boca Raton, 1992), pp. 85–176. [Google Scholar]
- URL: https://software.sandia.gov/DFTfluids/index.html.
- Gillespie D., Valiskó M., and Boda D., J. Phys.: Condens. Matter 17, 6609 (2005). 10.1088/0953-8984/17/42/002 [DOI] [Google Scholar]
- Rosenfeld Y., Schmidt M., Löwen H., and Tarazona P., Phys. Rev. E 55, 4245 (1997). 10.1103/PhysRevE.55.4245 [DOI] [Google Scholar]
- Blum L. and Rosenfeld Y., J. Stat. Phys. 63, 1177 (1991). 10.1007/BF01030005 [DOI] [Google Scholar]
- Waisman E. and Lebowitz J. L., J. Chem. Phys. 56, 3086 (1972), URL: http://link.aip.org/link/?JCP/56/3086/1. 10.1063/1.1677644 [DOI] [Google Scholar]
- Blum L., Mol. Phys. 30, 1529 (1975). 10.1080/00268977500103051 [DOI] [Google Scholar]
- URL: http://en.wikipedia.org/wiki/Heaviside_step_function.
- Balay S., Buschelman K., Eijkhout V., Gropp W. D., Kaushik D., Knepley M. G., McInnes L. C., Smith B. F., and Zhang H., Technical Report ANL-95/11-Revision 3.0.0, Argonne National Laboratory, 2009, URL: http://www.mcs.anl.gov/petsc/docs.
- Frigo M. and Johnson S. G., Proc. IEEE 93, 216 (2005) (special issue on “Program Generation, Optimization, and Platform Adaptation”). 10.1109/JPROC.2004.840301 [DOI] [Google Scholar]
- Roth R., J. Phys.: Condens. Matter 22, 063102 (2010). 10.1088/0953-8984/22/6/063102 [DOI] [PubMed] [Google Scholar]
- Saad Y. and Schultz M. H., SIAM (Soc. Ind. Appl. Math.) J. Sci. Stat. Comput. 7, 856 (1986). [Google Scholar]
- Martin P. A., Rev. Mod. Phys. 60, 1075 (1988). 10.1103/RevModPhys.60.1075 [DOI] [Google Scholar]
- Goodman J. and Sokal A. D., Phys. Rev. D 40, 2035 (1989). 10.1103/PhysRevD.40.2035 [DOI] [PubMed] [Google Scholar]
- Frenkel D., Proc. Natl. Acad. Sci. U.S.A. 101, 17571 (2004). 10.1073/pnas.0407950101 [DOI] [PMC free article] [PubMed] [Google Scholar]
- URL: http://www.nvidia.com/object/product_tesla_c1060_us.html.
- Lebowitz J. L., Phys. Rev. 133, A895 (1964). 10.1103/PhysRev.133.A895 [DOI] [Google Scholar]
- Nonner W., Catacuzzeno L., and Eisenberg B., Biophys. J. 79, 1976 (2000). 10.1016/S0006-3495(00)76446-0 [DOI] [PMC free article] [PubMed] [Google Scholar]
- Nonner W., Gillespie D., Henderson D., and Eisenberg R., J. Phys. Chem. 105, 6427 (2001). 10.1021/jp010562k [DOI] [Google Scholar]




