Continuing the discussion from Trouble finding water diffusion:

#Input file for chloride diffusion in jennite crystal using MSD method

units real

atom_style atomic

boundary p p p

read_data jennitecombined3.lmp

neigh_modify delay 0 every 1

# Define the group for chloride atoms

group chloride type 8

group csh1 id 1 2 3 4 1:690

group water id 5 6 691:1770

group csh2 id 1 2 3 4 1771:2460

group sodiumchloride id 7 8 2461:2466

region 1 block 0.0 28.00 -2.00 35.00 -3.0 10.85

group csh1 region 1

region 2 block 0.0 28.00 -2.00 35.00 10.85 49.80

group water region 2

region 3 block 0.0 28.00 -2.00 35.00 49.80 60.00

group csh2 region 3

# Fix the positions of groups csh1 and csh2

fix fix_csh1 csh1 setforce 0.0 0.0 0.0

fix fix_csh2 csh2 setforce 0.0 0.0 0.0

#fix fix_water water setforce 0.3 0.0 0.0

# Set the communication cutoff to 10 Angstrom

comm_modify cutoff 5

#Define the force field

pair_style lj/cut 2.5

neighbor 2.5 bin

pair_coeff * * 0.294397063 0.033562214

pair_coeff * * 0.38501583 0.033692483

pair_coeff * * 0.287659646 0.041740485

pair_coeff * * 0.407152299 0.002963415

pair_coeff * * 0.497972184 0.002967482

pair_coeff * * 0.378270062 0.521398045

pair_coeff * * 0.316628818 0.650037879

pair_coeff * * 0.436240376 0.003699858

pair_coeff * * 0.0 0.0

pair_coeff * * 0.38501583 0.0

pair_coeff * * 0.436240376 0.003699858

pair_coeff * * 0.316628818 0.650037879

pair_coeff * * 0.323239045 0.042082192

pair_coeff * * 0.323239045 0.042082192

pair_coeff * * 0.294397063 0.0

pair_coeff * * 0.442973487 0.000238235

pair_coeff * * 0.330362359 0.002692308

pair_coeff * * 0.55591693 2.10055E-05

pair_coeff * * 0.378270062 0.521398045

pair_coeff * * 0.31642861 0.652509506

pair_coeff * * 0.294397063 0.0

pair_coeff * * 0.38501583 0.0

pair_coeff * * 0.258328345 0.418925676

pair_coeff * * 0.349474969 0.41580163

pair_coeff * * 0.287402102 0.523458647

pair_coeff * * 0.38501583 0.0

pair_coeff * * 0.294397063 0.0

pair_coeff * * 0.44041546 0.414524349

# set time step

timestep 0.005 # time step of 1 fs

#Set up nvt ensemble

fix 1 all nvt temp 300 300 100

velocity chloride create 300 1234 mom yes dist uniform

# Set up the minimization settings

min_style cg

min_modify line quadratic

# Run energy minimization

minimize 1.0e-10 1.0e-10 1000 10000

# Equilibrate the system for 50000 time steps

thermo 1000

run 500000

#Data gathering steps

reset_timestep 0

# Set up the compute commands

compute msd all msd com yes

# Set up the fix and compute commands

compute msd_water water msd com yes

variable twopoint equal c_msd[4]/4/(step*dt+1.0e-6)
fix 9 all vector 10 c_msd[4]
variable fitslope equal slope(f_9)/4/(10*dt)

thermo_style custom step temp c_msd[4] v_twopoint v_fitslope

# Set up the dump file for all atoms

dump 1 all atom 100 dump.xyz

#Set up the dump file for chloride atoms

dump 2 water atom 100 dump_cl.xyz

# Run the simulation

thermo 1000

run 1000000

This code is calculating all the diffusion in same amount. I mean msd of chloride ,water and all other particles are showing same result.