[lammps-users] Error in rdf and Coordination number

Dear lammps user, I made the following lammps input file to compute rdf but in output I obtained all zero values of rdf and coordination number. How to correct this?

#create a simulation box

dimension 3
units micro
boundary p p p
atom_style charge

lattice fcc 4.58
region myregion block 0 10 0 10 0 10
create_box 1 myregion
create_atoms 1 region myregion

mass 1 39.948

pair_style yukawa 2.0 2.5
pair_coeff 1 1 100.0 2.3
minimize 1e-20 1e-20 10000 10000

timestep 0.001

velocity all create 5 12345 dist gaussian mom yes rot yes
compute srdf all rdf 1000 1 1 cutoff 2.0
fix myfix all ave/time 1 10000 10000 c_srdf[1] c_srdf[2] c_srdf[3] file Arrdf_solid.txt mode vector

fix 1 all nve

dump dump_1 all custom 1000 rdf.dump id type x y z ix iy iz vx vy vz
thermo_style custom step time temp pe ke etotal press vol

thermo 1000
run 10000

undump dump_1
unfix 1

Arrdf_solid.txt (13.7 KB)

The code in question has been thoroughly tested and compared against similarly thoroughly tested code.
So the only explanation is that the result you get is the result you should get.

And if I look at your input and make a run, it all seems very reasonable.

  • you are creating atoms that are about 3.25 micrometer apart, but your pair style has a cutoff of 2.5 micrometer so there are no forces
  • because there are no forces, your atoms don’t move.
  • because the atoms don’t move, they will never come as close as 2 micrometer, which is the cutoff you have selected for your rdf compute

you can confirm this by seeing that your potential energy is always. Also, when I compute the rdf with a different tool from the dump, you can see that my observations are correct.

Thus there is no error but LAMMPS has done exactly what you have asked for.
The rest is PEBCAC!