# Find minimum energy fcc configuration # Mark Tschopp, 2010 # This requires the variable latconst to be input via the command line # e.g., lmp_win_no-mpi -var latconst 4 < calc_fcc_ver1.in # ---------- Initialize Simulation --------------------- clear units metal dimension 3 boundary p p p atom_style atomic atom_modify map array timestep 0.0005 variable latconst equal 3.2506 # ---------- Create Atoms --------------------- region simbox block -80 80 -20 85 -80 100 #Creating tool lattice custom ${latconst} a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 #region tool union 3 red blue yellow region 1 prism -2 2 21 26 -15 -7 0 0 -3 region 2 prism -2 2 24 80 -9 -6 0 0 -10 region 3 intersect 2 1 2 region tool union 2 1 2 create_box 2 simbox create_atoms 2 region tool basis 1 2 basis 2 1 lattice custom ${latconst} a1 1 0 0 a2 0 1 0 a3 0 0 1 basis 0 0 0 basis 0.5 0.5 0.5 region core cylinder y 0 0 2 5 20 region middle cylinder y 0 0 3 5 20 region outer cylinder y 0 0 5 5 20 region external intersect 2 core middle side out region thermw intersect 2 external middle region external2 intersect 2 outer middle side out region newton intersect 2 external2 outer region workpiece union 3 core thermw newton create_atoms 2 region workpiece basis 1 2 basis 2 1 delete_atoms region 3 delete_atoms region 2 group tool region tool group core region core group thermw region thermw group newton region newton group workpiece region workpiece group moving union newton thermw # ---------- Define Interatomic Potential --------------------- pair_style meam pair_coeff * * library.meam Zr Cu ZrCu.meam Zr Cu #pair_style eam/fs #pair_coeff * * Cu-Zr_2.eam.fs Zr Cu neighbor 2.0 bin neigh_modify delay 10 check yes # ---------- Define Settings --------------------- #compute eng all pe/atom #compute eatoms all reduce sum c_eng dump 1 all atom 100 dump.structure # ---------- Run Minimization --------------------- #reset_timestep 0 #fix 1 all box/relax iso 0.0 vmax 0.001 #thermo 10 #thermo_style custom step pe lx ly lz press pxx pyy pzz c_eatoms #min_style cg minimize 1.0-e4 1.0e-4 1000 100000 # initialize temperature, except for fixed atoms velocity moving create 293 58142275 units box fix thermw thermw langevin 293.0 293.0 0.05 832743 fix tempw2 newton langevin 293.0 293.0 0.05 928349 run 15000 variable natoms equal "count(all)" variable teng equal "c_eatoms" variable length equal "lx" variable ecoh equal "v_teng/v_natoms" unfix thermw unfix tempw2 variable A equal 2 variable T equal 0.1 variable omega equal 2.0*PI/$T variable x equal swiggle(100*dt*step,$A,$T) variable v equal v_omega*($A-cwiggle(0.0,$A,$T)) variable vmax equal 500 variable sin equal abs(sin(0.5*v_omega*dt*step)) variable velocity equal (v_vmax*v_sin) fix 3 core move rotate 0 0 0 0 1 0 ${T} fix 1 tool move variable NULL NULL NULL NULL NULL v_velocity fix 5 moving nve fix 4 tool setforce 0 0 0 compute ke all ke/atom variable fx equal fcm(tool,x) variable fy equal fcm(tool,y) variable fz equal fcm(tool,z) thermo 1000 thermo_style custom step temp pe ke v_fx v_fy v_fz dump 2 all custom 10 v_ht.*.lammpstrj id type xu yu zu vx vy vz c_ke run 5000 #print "Total energy (eV) = ${teng};" #print "Number of atoms = ${natoms};" print "Lattice constant (Angstoms) = ${length};" #print "Cohesive energy (eV) = ${ecoh};" print "All done!"