Hello everyone, I now want to use MD / MC hybrid simulation to calculate the number of solute atoms at the grain boundary of Mg-4 % Ca alloy, using the fix atom / swap command to carry out, but found that the calculated number of solute atoms at the grain boundary fluctuates greatly, sometimes more and sometimes less, what is the cause of this situation, what is the wrong parameter setting ,Thank you. Here is my in file:
#-------------Initial Variable--------------#
variable etol equal 1e-15
variable ftol equal 1e-15
variable maxiter equal 5000
variable maxeval equal 1e4
units metal
boundary p p p
atom_style atomic
timestep 0.0025
read_data polycrystal13.lmp
mass 1 24.305 # Mg
mass 2 40.078 # Ca
region upper block INF INF 0 62 INF INF units box
group upper region upper
region lower block INF INF 62 124 INF INF units box
group lower region lower
set type 1 type/ratio 2 0.04 23985
group solute type 2
group body type 1
region mid block INF INF 59 65 INF INF units box
group mid dynamic all region mid every 10
region left block INF INF 43 49 INF INF units box
group left dynamic all region left every 10
region right block INF INF 75 81 INF INF units box
group right dynamic all region right every 10
write_data Mg.data
pair_style meam/c
pair_coeff * * library.meam Ca Mg CaMg.meam Mg Ca
neighbor 2.0 bin
neigh_modify delay 10 check yes
#---------Run minimize for tx and tz------
thermo 10000
thermo_style custom step pe lx ly lz press pxx pyy pzz
min_style cg
minimize {etol} {ftol} {maxiter} {maxeval}
compute Pe_atom all pe/atom
compute mytemp all temp
compute_modify mytemp dynamic/dof yes
compute_modify thermo_temp dynamic yes
variable N3 equal count(mid)
variable N4 equal count(left)
variable N5 equal count(right)
variable N6 equal count(solute,mid)
variable N7 equal count(solute,left)
variable N8 equal count(solute,right)
variable N equal v_N6-v_N3v_N7/v_N4
variable M equal v_N6-v_N3v_N8/v_N5
variable O equal v_N6/v_N3
variable P equal v_N7/v_N4
variable Q equal v_N8/v_N5
variable R equal v_N6
variable S equal v_N7
variable istep equal step
dump 1 all custom 10000 wending.dump id type x y z vx vy vz
fix 1 all npt temp 873 873 0.1 iso 0.0 0.0 1000
run 400000
undump 1
reset_timestep 0
unfix 1
dump 1 all custom 1000 static.dump id type x y z vx vy vz
fix 1 all npt temp 873 873 0.1 iso 0.0 0.0 1000
fix_modify 1 temp mytemp
fix 3 all print 1000 “{istep} {N} {M} {O} {P} {Q} {R} {S}” file N-static.txt screen no
fix SGMC all atom/swap 20 240 29494 873 semi-grand yes types 1 2 mu 0 -0.7
run 1200000
write_data Mg3.data