Open Access Article
John A.
Baker
and
Jonathan. D.
Hirst
*
School of Chemistry, University of Nottingham, University Park, Nottingham, NG7 2RD, UK. E-mail: Jonathan.Hirst@nottingham.ac.uk; Fax: +44 1159 513562; Tel: +44 1159 513478
First published on 5th March 2014
Traditionally, electrostatic interactions are modelled using Ewald techniques, which provide a good approximation, but are poorly suited to GPU architectures. We use the GPU versions of the LAMMPS MD package to implement and assess the Wolf summation method. We compute transport and structural properties of pure carbon dioxide and mixtures of carbon dioxide with either methane or difluoromethane. The diffusion of pure carbon dioxide is indistinguishable when using the Wolf summation method instead of PPPM on GPUs. The optimum value of the potential damping parameter, α, is 0.075. We observe a decrease in accuracy when the system polarity increases, yet the method is robust for mildly polar systems. We anticipate the method can be used for a number of techniques, and applied to a variety of systems. Substitution of PPPM can yield a two-fold decrease in the wall-clock time.
Electrostatic interactions can be divided into first-order effects, which comprise point charge interactions decaying reciprocally with respect to intermolecular distance and higher-order interactions that decay more rapidly. Electrostatic interactions can be modelled explicitly by various methods, including: cut-off truncation,5–7 switched/shifted cut-off truncation,8 Ewald9 and its mesh derivatives, particle mesh Ewald (PME),10 particle–particle particle mesh (PPPM)11 and smoothed particle mesh Ewald (SPME).12 The Ewald summation provides a good approximation for the electrostatic energy, as the algorithm accounts for periodicity of the simulation domain, but it scales as O(N3/2). An approximation that is frequently adopted is PPPM, due to its superior scaling, O(NlogN), over the Ewald summation. SPME,13 PPPM14 and multi-level summation15 have been implemented on the GPU, yet the requirement for fast Fourier transforms (FFTs) intrinsic to Ewald methods, like SPME and PPPM, reduces the parallelism14 and leads to poor scaling on GPUs. Pair-wise algorithms derived from cut-off techniques show superior scaling O(N) and greater effectiveness on GPUs.
Cut-off techniques can reproduce experimental quantities, for instance, the Madelung constant. Wolf et al.16 reported that the electrostatic (Coulombic) potential for condensed systems was effectively short-ranged, and the energies are in agreement with Ewald methods when the cut-off sphere reached neutrality. This was observed whilst calculating the Madelung constant for rocksalt (NaCl), where the relationship between truncation distance and electrostatic energy was investigated. When the cut-off sphere was truncated at a distance to achieve charge neutrality, the electrostatic energy was significantly closer to the Madelung energy. The repeating lattice structure of NaCl is well-suited for treatment with the Wolf method, but the supercritical phase of polar solutes can be more difficult to model as the atomic partial charges within the cut-off sphere are dynamic. The resulting shifted Coulomb potential achieves charge neutrality by projecting each atom charge, qj, from qi onto the edge of the solvation sphere. Therefore, every jth atom in the solvation sphere of atom i has a charge of equal but opposite sign set at the cut-off (Rc). This results in an artificially neutral solvation sphere for every ith atom, which effectively makes the system charge neutral.
Simple cut-off based methods are unreliable for computing the forces, as the potential truncates abruptly at the cut-off, which causes forces to be undefined if the molecule lies at the cut-off boundary. The reliance upon Ewald methods instead of efficient cut-off methods has been discussed by Fennel and Gezelter,17 who compared the accuracy of damped shifted-force (DSF) and shifted potential cut-off methods for water, argon in water, and NaCl. Benchmarking and validation of the DSF potential was applied to polyelectrolyte brushes on GPUs; speedups were achieved of a factor between 1.1 and 3.9, depending on the system and size of the cut-off with respect to PPPM.19 Group based cut-offs, where the cut-off is dynamically allocated to ensure entire molecules are within the solvation shell, were investigated,17 but the energies deviated significantly from those obtained using PME.
In this work we assess the applicability of the Wolf method to model electrostatic interactions for various systems in the supercritical region of carbon dioxide. Supercritical carbon dioxide (scCO2) is an attractive ‘green solvent’ used in many industrial processes, such as caffeine extraction,20 polymer solvation21 and synthesis,22,23 enzyme catalysis24,25 and stabilization26,27 and transition metal catalysis.28,29 Although carbon dioxide does not possess a dipole, it has a significant quadrupole30 (13.4 × 10−40 Cm2), which means that electrostatic interactions are an important component of interactions involving scCO2. Su and Maroncelli31 observed that neglecting electrostatic interactions, i.e., considering only Lennard-Jones interactions, led to a systematic 14% error in the solvation free energies of polymer-scCO2 systems. This observation is attributed to quadrupole–dipole and quadrupole–quadrupole interactions,31 which are inherently modelled in all point charge models. A nonpolar fluid should be well suited for treatment using the Wolf method, as quadrupolar interactions decay more rapidly than dipolar ones. This bodes well for the efficient electrostatic treatment of systems solvated by carbon dioxide by utilizing the Wolf method on GPU architectures. We also investigate the computational cost of the DSF method, with respect to the Wolf method.
Fluorous polymers are well known to dissolve in scCO2,32,33 which has been partially explained by 19F-NMR experiments, which suggested a number of specific interactions between carbon dioxide and the fluorous solute that increase the solubility.34 Many biomolecular systems are stable in the presence of scCO2, but this is dependent on the species, the water content, and experimental conditions.24 Protein stability can be observed when scCO2 solvates the hydrophobic residues, and water solvates the polar/hydrophilic residues.26 Water possesses a strong dipole moment, which will make it less amenable to treatment with the Wolf method. We aim to follow this work with an investigation for protein systems solvated by water and carbon dioxide.
To assess the applicability of the Wolf method to systems containing carbon dioxide, important physical quantities, such as PVT relationships and diffusion coefficients, can be calculated and compared with the values calculated using PPPM. The applicability of the Wolf method to study methane plus carbon dioxide gas hydrates has been reported, and the results show good agreement between lattice sum and reaction field methods.35 Analysis of the convergence behaviour of the Wolf method by Angoshtari and Yavari36 shows the method to be robust, but convergence can be problematic if poor choices are made for the cut-off or α values. In our study, we investigate the effect of increasing the polarity of the fluid by incorporating difluoromethane molecules, which possess a strong dipole. For low polarity systems the Wolf method should be well suited, but as the polarity increases the effect of long-range dipole interactions will become important and we assess the point where Ewald techniques will become necessary.
| Atom site | A 1/12 | B 1/6 | q (|e|) |
|---|---|---|---|
| C (CO2) | 2.448 | 2.173 | −0.3256 |
| O (CO2) | 2.922 | 2.815 | +0.6512 |
| C (CH4) | 3.200 | 3.200 | −0.4160 |
| H (CH4) | 1.910 | 1.390 | +0.1040 |
| C (CH2F2) | 2.900 | 3.590 | +0.0500 |
| H (CH2F2) | 1.712 | 0.000 | +0.1550 |
| F (CH2F2) | 2.650 | 2.237 | −0.1800 |
We utilized the LAMMPS software to simulate scCO2 at several densities, comparing the results obtained by using PPPM or the Wolf method. We selected a tolerance setting of 0.0001 for the calculations involving PPPM that enables the root mean square error to be within a factor of 10
000 of the reference force, which is calculated analytically for short-range interactions41 and in k-space.42 The optimum value of α was investigated for binary mixtures of carbon dioxide and methane or difluoromethane. The criterion for selecting α is the level of agreement between the Coulombic energies computed by PPPM and Wolf. To consider the effects of neglecting only the periodic long-range Coulombic effects, we treat the cut-off as being half the length of the simulation box. We also investigate the level of approximation that arises from use of a quarter box cut-off in conjunction with the Wolf method.
000 and 50
000 carbon dioxide molecules were constructed with a molar density of 0.01 mol cm−3 and minimized for 1000 iterations using the conjugate gradient method, to an energy tolerance of 1 × 10−6 kcal mol−1. Both systems were heated from 0 K to 308.2 K using the Nosè–Hoover thermostat43 with a damping time of 500 fs for 2 ns, followed by 5 ns of equilibration at 308.2 K. We evaluated the performance of the Wolf method on two GPU architectures, Tesla (Tesla C1060) and Kepler (Tesla K10). The K10, released in 2012, is designed for high throughput calculations performed in single precision. The number of giga floating-point operations per second (GFLOPs) is 4577 in single precision, compared to 933 for the C1060. This improvement was achieved in part by increasing the number of cores in the streaming multiprocessor from 8 (Tesla), 32 (Fermi) to 192 (Kepler). Memory bandwidth on the GPU to global memory is 103 GB s−1 for the C1060, but 320 GB s−1 for Kepler K10. We include an eight core Intel Xeon (E5-2609) CPU for benchmarking purposes that has an approximate 77 GFLOPs with 34 GB s−1 bandwidth to RAM. Calculations were performed using single-precision on two separate nodes, both comprise an eight core Xeon CPU and either a Kepler K10 or two Tesla C1060. Multiple GPU tests were only carried out using the C1060, which yielded an almost two-fold increase in performance, which corresponds well to the linear dependency. We use the FFTW 3.3.1 library in single-precision for all k-space calculations of PPPM. We considered two modes for calculations using LAMMPS-GPU, one where all force and neighbour calculations are performed on the GPU, and the other where the force and neighbour calculations are dynamically assigned between CPU and GPU. We used the CUDA 5.0 Tokito (GPU driver v. 304.54), which has produced a noticeable improvement in performance over CUDA 4.0. A new feature, CUDA dynamic parallelism, allows kernels running on the GPU to spawn more grids and to continue to generate work depending on the calculation.44 This feature has not been incorporated in our study.
000 carbon dioxide molecule system was used to generate densities (box lengths) of 0.001 (255.1 Å), 0.002 (202.5 Å), 0.004 (160.72 Å), 0.005 (149.2 Å), 0.01 (118.42 Å) and 0.02 (94.0 Å) mol cm−3, all within the supercritical region at 308.2 K. Each box was minimized for 1000 iterations using the conjugate gradient method, with an energy tolerance of 1 × 10−6 kcal mol−1. The system was heated in the NVT ensemble using the Nosè–Hoover thermostat43 with cubic periodic boundary conditions from 0 K to 308.2 K for 1 ns using a 1 fs time step. This was followed by 1 ns of equilibration. Integration was performed using the time-reversible velocity Verlet algorithm.45 The procedure was repeated nine times to generate different equilibrated configurations for the purposes of error analysis, and the resulting standard deviation is noted in the error bars. The mean square displacement (MSD) of the centre of mass of carbon dioxide was obtained by calculating the gradient of the linear portion of the relationship between MSD and lag time over 10 ns production dynamics in the NVT ensemble. The pressures were obtained every 50 fs, and averaged over 10 ns to calculate the PVT relationship.
000 carbon dioxide molecules were constructed with mole fractions χ(solute) = 0.0001, 0.001, 0.01, 0.09 and 0.5, where the solute was either methane or difluoromethane. These systems correspond to box lengths (Å) of 95.01, 95.99, 97.49, 99.27 and 125.31 for CH4/CO2 and 81.64, 81.78, 81.83, 84.44 and 105.16 for CH2F2/CO2. Each system was minimized and heated to 308.2 K using the same procedure as above. The pressure was equilibrated to 80 atmospheres (corresponding to a molar density of ∼0.02 mol cm−3), using the Berendsen barostat46 with a 1 ps damping time for 20 ns with a 1 fs time step. The procedure was repeated nine times to generate different equilibrated configurations for the purposes of error analysis, and the resulting standard deviation is noted in the error bars. The MSDs of carbon dioxide and solutes were obtained from the linear portion of the relationship over a production run of 10 ns. We compare the errors in Coulombic energy with respect to α for χ(solute) = 0.09 with PPPM and Wolf, which we performed by decomposing the energy into group contributions. We investigate the relationship between system polarity and diffusion coefficients, and the total Coulombic energy.
One method of quantifying the transport properties of a system is the MSD, and thus the diffusion coefficient using the Einstein relationship.
The pressure of a system can be calculated using the virial equation (below), and the PVT relationship has an influence on the diffusion coefficients.48 The long-range part of PPPM has a different contribution to the pressure.49
000 and 50
000 molecule systems. The timings of the implementations are calculated with respect to the number of neighbours in the cut-off sphere. Fig. 1(a) and 1(b) compare the throughput for different architectures, and show the acceleration gained when substituting PPPM for Wolf using LAMMPS-CUDA. The computational throughput is almost twice as high with the Wolf treatment than with PPPM. The Wolf method is slower than PPPM on the CPU, which is unexpected, but the CPU is well suited to handle FFTs that feature in PPPM. This is due to faster memory accesses between cache and compute cores, and the less parallel nature of the algorithm. The DSF method is marginally slower than PPPM in LAMMPS-CUDA, but is marginally faster than the Wolf method for the LAMMPS-GPU implementation. The difference between pair styles using LAMMPS-GPU is much less pronounced than LAMMPS-CUDA, where the acceleration gained by using the Wolf or DSF method is approximately 1.5 times faster. The difference between dynamic partitioning and exclusive GPU computation is small for the cut-off methods, and the dynamic mode is marginally quicker. For PPPM the opposite is observed, which could be due to the CPU already being used for the k-space calculations. The Kepler K10 GPU shows the greatest acceleration, which bodes well for future GPU releases.
We observe for half box cut-offs the best agreement for Wolf is at low values of α, where for both the polar and non-polar systems the optimum value for α is 0.075. For non-polar systems increasing α beyond 0.2 results in an ∼2–3% error (with respect to the PPPM Coulombic energy), whilst for the polar system the average error is ∼20%. The non-polar CH4/CO2 system resulted in the lowest average errors of 0.05% for CO2–CO2 interactions, 0.39% for CO2–CH4 and 0.34% for CH4–CH4. We observe a similar trend for the polar system of CO2/CH2F2 with increased average errors of 0.44% for CO2–CO2, 0.47% for CO2–CH2F2 and 0.67% for CH2F2–CH2F2. At α = 0.075 the greatest variance in the non-polar system is σ2 = 0.2 for CH4–CH4, and for the polar system the maximum variance is σ2 = 2.94 for CH2F2–CH2F2.
A quarter box cut-off gives greater errors in the Coulombic energies, but follows the same trends as the half box cut-off. For the non-polar system the optimum value for α is 0.05, which is seen for all pair interactions of methane and carbon dioxide.
The average error increases to 0.5% for CO2–CO2 and to ∼0.75% for energies involving interactions with methane. The errors vary more when used with the polar system over a wide range of α, but at α = 0.075 the error for all interactions is below 2%. The error increases sharply for the polar system with varying α. For interactions between CH2F2–CH2F2 the variance is higher than for methane, which can be attributed to the high polarity of both substituents.
:
1 ratio, the errors increase, which indicates, as anticipated, that the Wolf approach is not suitable when the system becomes highly polar. The errors for α = 0.075 are reasonable (0.9%) but for α = 0.2 the errors are 3%. We observe better agreement for methane. For the 1
:
1 binary mixture, the error in α = 0.2 is 1.8% and α = 0.075 is 0.15%. The total Coulombic energy for difluoromethane is more negative than for methane, which can be explained by NPT dynamics resulting in a lower volume box and therefore closer contacts.
Experimental results from O'Hern and Martin51 indicate pure carbon dioxide has a diffusion coefficient of 5 (× 108 m2 s−1) at 308.2 K, 80 atmospheres. The non-polar binary mixture of CH4/CO2 has a diffusion coefficient of ∼5 (× 108 m2 s−1) for the inclusion of one methane molecule in 10
000 molecules of carbon dioxide (Fig. 5). As the number of methane molecules increases, the overall diffusion coefficients remain relatively constant. Diffusion coefficients for CH4 and carbon dioxide are similar, with an average increase of ∼0.6 (× 108 m2 s−1) between carbon dioxide and CH4. As χ(solute) increases, the accuracy of the solute diffusion coefficients increase, due to better averaging from more solute molecules. With the exception of χ(solute) = 0.0001 where averaging is poor, the agreement between Wolf and PPPM is good. We observe a reduction in diffusion coefficients for difluoromethane as the polarity increases. The values decay from 4.5 (× 108 m2 s−1), to 1.3 (× 108 m2 s−1), which can be attributed to favourable interactions between solute and solvent. Agreement between Wolf and PPPM is good, although there is an observable increase in the error in the diffusion coefficients for difluoromethane when the fraction of solute reaches 10%. This indicates the difluoromethane interacts strongly with carbon dioxide, thus limiting diffusion.
To characterise the interactions between difluoromethane and carbon dioxide, we calculate the radial distribution (RDF) between the centre of mass for CH4/CO2 and CH2F2/CO2 (Fig. 6) and the associated residence times and coordination numbers are shown in Table 2.
![]() | ||
| Fig. 6 Radial distribution function between the centre of mass of carbon dioxide and CH4 (solid line), and CH2F2 (dashed line) for χ(solute) = 0.1 at 308.2 K, 80 atmospheres. | ||
| Shell | Distance limit (Å) | Residence time – Wolf (ps) | Residence time – PPPM (ps) | Coordination number - Wolf | Coordination number - PPPM |
|---|---|---|---|---|---|
| Methane | |||||
| 1st | 0.00–5.95 | 1.2 | 1.2 | 8.6 | 8.6 |
| 1st + 2nd | 0.00–9.60 | 2.6 | 2.5 | 37.2 | 37.1 |
| 2nd | 5.95–9.60 | 1.3 | 1.3 | 28.6 | 28.5 |
| Difluoromethane | |||||
| 1st | 0.00–5.65 | 4.6 | 4.6 | 12.1 | 12.1 |
| 1st + 2nd | 0.00–9.24 | 10.5 | 10.3 | 55.6 | 55.6 |
| 2nd | 5.65–9.24 | 5.9 | 5.7 | 45.5 | 45.5 |
The RDF shows a larger density of carbon dioxide molecules in the difluoromethane mixture in the first and second solvation shell compared to methane. The same trend was noticed in the RDF by Do et al.,53 where the first solvation shell has a higher density for difluoromethane than for methane. The number of carbon dioxide molecules present in the first and second solvation shells is ∼30% higher for difluoromethane, and carbon dioxide resides about four times longer compared to methane. This indicates that carbon dioxide has a higher affinity for difluoromethane.
:
1 mixture of carbon dioxide and difluoromethane with α = 0.075. We observe a strong affinity of carbon dioxide to difluoromethane compared to methane, which can be seen by a decline in diffusion coefficients with increasing mole fraction of solute. Carbon dioxide resides about four times longer in the solvation sphere of difluoromethane compared to methane.
We can conclude that the significance of using the Wolf method on GPUs allows simulations to reach timescales twice as long as those run with PPPM, without significant loss in accuracy for a carefully chosen value of α for non-polar and mildly polar systems. We aim to follow up the investigation with further analysis of solvent–solute interactions and the study of fluorinated polymers, which have high solubilities in scCO2. We will be investigating the free energy changes of fluorinated polymers, with an aim of further understanding the high affinity of fluorous polymers for carbon dioxide. Many free energy methods require long timescales in order to reach convergence; utilizing the Wolf method for this purpose will help achieve this goal.
Footnote |
| † Electronic Supplementary Information (ESI) available: See DOI: 10.1039/c4fd00012a |
| This journal is © The Royal Society of Chemistry 2014 |