1# sample LAMMPS input script for diffusion of 2d LJ liquid 2# mean-squared displacement via compute msd 3 4# settings 5 6variable x equal 40 7variable y equal 40 8 9variable rho equal 0.6 10variable t equal 1.0 11variable rc equal 2.5 12 13# problem setup 14 15units lj 16dimension 2 17atom_style atomic 18neigh_modify delay 0 every 1 19 20lattice sq2 ${rho} 21region simbox block 0 $x 0 $y -0.1 0.1 22create_box 1 simbox 23create_atoms 1 box 24 25pair_style lj/cut ${rc} 26pair_coeff * * 1 1 27 28mass * 1.0 29velocity all create $t 97287 30 31fix 1 all nve 32fix 2 all langevin $t $t 0.1 498094 33fix 3 all enforce2d 34 35# equilibration run 36 37thermo 1000 38run 5000 39 40unfix 2 41 42# data gathering run 43 44reset_timestep 0 45 46# factor of 4 in 2 variables is for 2d 47 48compute msd all msd com yes 49variable twopoint equal c_msd[4]/4/(step*dt+1.0e-6) 50fix 9 all vector 10 c_msd[4] 51variable fitslope equal slope(f_9)/4/(10*dt) 52 53thermo_style custom step temp c_msd[4] v_twopoint v_fitslope 54 55# only need to run for 10K steps to make a good 100-frame movie 56 57#dump 1 all custom 1 tmp.dump id type vx vy vz 58 59#dump 2 all image 100 image.*.jpg type type zoom 1.6 adiam 1.2 60 61thermo 1000 62run 100000 63