This section outlines how to optimise the accuracy of the Ewald sum parameters for a given simulation. In what follows the directive spme may be used anywhere in place of the directive ewald if the user wishes to use the Smoothed Particle Mesh Ewald method.
As a guide to beginners DL_POLY_2 will calculate reasonable parameters if the ewald precision directive is used in the CONTROL file (see section 4.1.1). A relative error (see below) of 10 is normally sufficient so the directive
ewald precision 1d-6
will cause DL_POLY_2 to evaluate its best guess at the Ewald parameters , kmax1, kmax2 and kmax3. (The user should note that this represents an estimate, and there are sometimes circumstances where the estimate can be improved upon. This is especially the case when the system contains a strong directional anisotropy, such as a surface.) These four parameters may also be set explicitly by the ewald sum directive in the CONTROL file. For example the directive
ewald sum 0.35 6 6 8
would set Å, kmax1 = 6, kmax2 = 6 and kmax3 = 8. The quickest check on the accuracy of the Ewald sum is to compare the Coulombic energy () and the coulombic virial () in a short simulation. Adherence to the relationship shows the extent to which the Ewald sum is correctly converged. These variables can be found under the columns headed eng_cou and vir_cou in the OUTPUT file (see section 4.2.2).
The remainder of this section explains the meanings of these parameters and how they can be chosen. The Ewald sum can only be used in a three dimensional periodic system. There are three variables that control the accuracy: , the Ewald convergence parameter; the real space forces cutoff; and the kmax1,2,3 integers 3.1 that effectively define the range of the reciprocal space sum (one integer for each of the three axis directions). These variables are not independent, and it is usual to regard one of them as pre-determined and adjust the other two accordingly. In this treatment we assume that (defined by the cutoff directive in the CONTROL file) is fixed for the given system.
The Ewald sum splits the (electrostatic) sum for the infinite,
periodic, system into a damped real space sum and a reciprocal space
sum. The rate of convergence of both sums is governed by .
Evaluation of the real space sum is truncated at so it
is important that be chosen so that contributions to the real
space sum are negligible for terms with . The relative
error () in the real space sum truncated at is
given approximately by
The recommended value for is 3.2/ or greater
(too large a value will make the reciprocal space sum very slowly
convergent). This gives a relative error in the energy of no greater
than
in the real space sum. When using
the directive ewald precision DL_POLY_2 makes use of a more sophisticated
approximation:
(3.2) |
The relative error in the reciprocal space term is approximately
(3.3) |
(3.4) |
For a relative error of
this means using
. kmax is then
(3.5) |
In a cubic system, implies . In practice the above equation slightly over estimates the value of kmax required, so optimal values need to be found experimentally. In the above example kmax = 5 or 6 would be adequate.
If your simulation cell is a truncated octahedron or a rhombic dodecahedron then the estimates for the kmax need to be multiplied by . This arises because twice the normal number of -vectors are required (half of which are redundant by symmetry) for these boundary contributions [30].
If you wish to set the Ewald parameters manually (via the ewald sum or spme sum directives) the recommended approach is as follows. Preselect the value of , choose a working a value of of about and a large value for the kmax (say 10 10 10 or more). Then do a series of ten or so single step simulations with your initial configuration and with ranging over the value you have chosen plus and minus 20%. Plot the Coulombic energy (and ) versus . If the Ewald sum is correctly converged you will see a plateau in the plot. Divergence from the plateau at small is due to non-convergence in the real space sum. Divergence from the plateau at large is due to non-convergence of the reciprocal space sum. Redo the series of calculations using smaller kmax values. The optimum values for kmax are the smallest values that reproduce the correct Coulombic energy (the plateau value) and virial at the value of to be used in the simulation.
Note that one needs to specify the three integers (kmax1, kmax2, kmax3) referring to the three spatial directions, to ensure the reciprocal space sum is equally accurate in all directions. The values of kmax1, kmax2 and kmax3 must be commensurate with the cell geometry to ensure the same minimum wavelength is used in all directions. For a cubic cell set kmax1 = kmax2 = kmax3. However, for example, in a cell with dimensions (ie. a tetragonal cell, longer in the c direction than the a and b directions) use 2kmax1 = 2kmax2 = (kmax3).
If the values for the kmax used are too small, the Ewald sum will produce spurious results. If values that are too large are used, the results will be correct but the calculation will consume unnecessary amounts of cpu time. The amount of cpu time increases with .