Hello
It seems to me that the coordination number calculation when I use compute rdf in this particular simulation is wrong.
When I calculate the CN myself from the rdf output by LAMMPS, I get different values than the CN from LAMMPS, and the values seem to be off by some factor.
Code example of how to calculate CN:
from scipy import integrate
import math
# store LAMMPS RDF from rdf.dat as variable RDF, store centers of bins as variable centerbin, store box volume as variable volume
CN = integrate.cumulative_trapezoid(RDF*4*math.pi*centerbin**2,centerbin, initial=0)*182/volume
# 182 is here the number of jtypeN, so 182/volume should be the global average volume density of jtypeN.
I have attached the start configuration restart_eq.data and parameters system.settings, along with the input file rdf.lmp. The output rdf from the simulation is rdf.dat. The LAMMPS version is LAMMPS (29 Aug 2024). The simulation is run on a cluster with Intel Xeon Gold 6348 CPUs and Rocky Linux release 9.4 (Blue Onyx).
Would be great if someone could double check that I am not doing a mistake in my CN calculation (and try to reproduce the data I get here). Here are the LAMMPS RDF, LAMMPS CN and the calculated CN (CN manual) plotted together:
I can note finally that the calculated CN becomes similar to the LAMMPS CN if I multiply by the factor 14/volume instead of 182/volume. 14 is here the number of itypeN (central atom type) so that would be wrong, I think.
rdf.lmp (1.1 KB)
rdf.dat (5.1 KB)
restart_eq.data (971.5 KB)
system.settings (1.2 KB)
log.lammps (8.1 KB)