Hi everyone,
I am trying to compute diffusion coefficient of atoms in a specific sphere by compute chunk/msd, but the results seemed unreasonable. I plotted the msd versus steps in each spheres, but the plots show no relationship between msd and timestep (Figure 1). However, I tried compute msd without sphere, a linear relationship can be seen (Figure 2). I would like to know that did I make some mistakes in using compute msd/chunk? Thank you very much for replying.
Here is my script:
#---------------------------Initialization-------------------------------------
units real
boundary p p p
atom_style charge
atom_modify map array sort 5000 2
read_data matrix.dat
#----------------------------Simulation settings-----------------------
# 1 is O 2 is Si 3 is Al 4 is Ca
pair_style hybrid/overlay coul/dsf 0.25 8.0 table linear 8000
pair_coeff * * coul/dsf
pair_coeff 1 1 table Pedone_CAS.table OO
pair_coeff 1 2 table Pedone_CAS.table SiO
pair_coeff 1 3 table Pedone_CAS.table AlO
pair_coeff 1 4 table Pedone_CAS.table CaO
neighbor 2.0 bin
neigh_modify delay 0 every 5 check yes
thermo 1000
thermo_style custom step atoms temp pe lx pxx ly pyy lz pzz density
timestep 2
velocity all create 300 1234 dist gaussian
fix 1 all npt temp 300 1800 200 iso 1.01325 1.01325 2000
run 150000
unfix 1
group O type 1
group Si type 2
group Al type 3
group Ca type 4
variable cx equal "(xhi+xlo)/2"
variable cy equal "(yhi+ylo)/2"
variable cz equal "(zhi+zlo)/2"
compute bins_O O chunk/atom bin/sphere ${cx} ${cy} ${cz} 10 50 200
compute bins_Si Si chunk/atom bin/sphere ${cx} ${cy} ${cz} 10 50 200
compute bins_Al Al chunk/atom bin/sphere ${cx} ${cy} ${cz} 10 50 200
compute bins_Ca Ca chunk/atom bin/sphere ${cx} ${cy} ${cz} 10 50 200
compute msd_O all msd/chunk bins_O
compute msd_Si all msd/chunk bins_Si
compute msd_Al all msd/chunk bins_Al
compute msd_Ca all msd/chunk bins_Ca
fix 1 all nve
fix 2 all ave/time 1 1 1 c_msd_O[4] c_msd_Si[4] c_msd_Al[4] c_msd_Ca[4] file msd_chunk_matrix.txt mode vector
run 250000
unfix 1
fix 3 all nvt temp 1800 1800 200
run 250000