# ---------- Initialize Simulation --------------------- clear units metal dimension 3 boundary p p p atom_style atomic atom_modify map array neighbor 3.0 bin # ---------- define variables --------------------- variable stemperature equal 80 # temperature in kelvin variable alattice equal 3.610 # lattice constant (unit A) variable myseed equal 12345 # the value seed for the velocity variable xmax equal 45 # size in the x-direction variable ymax equal 39 # size in the y-direction variable zmax equal 630 # size in the z-direction variable time_step equal 0.0005 # time step in pico seconds variable time_eq equal 10 # time steps for the equlibration part variable time_shock equal 10 # time steps for the piston variable vpiston equal 1.2 # piston speed in (km/s) multiply by ten to obtain (A/ps) variable atomrate equal 5 # the rate in timestep that atoms are dump variable thermorate equal 1 # # the rate in timestep for thermo variable tdamp equal "v_time_step*100" # DO NOT CHANGE variable pdamp equal "v_time_step*1000" # DO NOT CHANGE variable Up equal "10*v_vpiston" timestep ${time_step} # ---------- Create Atoms --------------------- lattice fcc ${alattice} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 # define size of the simulation box region sim_box block 0 ${xmax} 0 ${ymax} 0 215 units lattice create_box 8 sim_box # define atoms in a small region region piston block 0 ${xmax} 0 ${ymax} 0 3.5 units lattice create_atoms 1 region piston region firstcu block 0 ${xmax} 0 ${ymax} 200 207.5 units lattice create_atoms 1 region firstcu region secondcu block 0 ${xmax} 0 ${ymax} 210 211.5 units lattice create_atoms 1 region secondcu region thirdcu block 0 ${xmax} 0 ${ymax} 212 214 units lattice create_atoms 1 region thirdcu lattice custom 4.26 a1 0.57735 0.0 0.0 a2 0.0 1.0 0.0 a3 0.0 0.0 0.8 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 basis 0.25 0.16666666666 0.76 basis 0.75 0.3333333333 0.76 basis 0.75 0.6666666666 0.76 basis 0.25 0.83333333333 0.76 region GrRegion block 0 66 0 33 4.5 5.5 units lattice create_atoms 3 region GrRegion lattice fcc ${alattice} origin 0.0 0.0 0.0 orient x 1 0 0 orient y 0 1 0 orient z 0 0 1 region dumpfirst block 0 ${xmax} 0 ${ymax} 0 215 units lattice #region piston block INF INF INF INF INF 14.44 units box region bulk block 0 ${xmax} 0 ${ymax} 13 INF units box # define a group for the atom_box region group dumpfirst region dumpfirst group piston region piston group bulk region bulk group sim_box region sim_box set group piston type 2 # ---------- Define Interatomic Potential --------------------- pair_style hybrid airebo 2 airebo 2 airebo 2 airebo 2 airebo 2 airebo 2 eam/alloy lj/cut 5 lj/cut 5 lj/cut 5 lj/cut 5 lj/cut 5 lj/cut 5 lj/cut 5 pair_coeff * * airebo 1 CH.airebo NULL NULL C NULL NULL NULL NULL NULL pair_coeff * * airebo 2 CH.airebo NULL NULL NULL C NULL NULL NULL NULL pair_coeff * * airebo 3 CH.airebo NULL NULL NULL NULL C NULL NULL NULL pair_coeff * * airebo 4 CH.airebo NULL NULL NULL NULL NULL C NULL NULL pair_coeff * * airebo 5 CH.airebo NULL NULL NULL NULL NULL NULL C NULL pair_coeff * * airebo 6 CH.airebo NULL NULL NULL NULL NULL NULL NULL C pair_coeff * * eam/alloy Cu.lammps.eam Cu Cu NULL NULL NULL NULL NULL NULL pair_coeff 1 3*8 lj/cut 1 0.03793596 3.1385 pair_coeff 2 3*8 lj/cut 2 0.03793596 3.1385 pair_coeff 3 4*8 lj/cut 3 0.0035 3.5 pair_coeff 4 5*8 lj/cut 4 0.0035 3.5 pair_coeff 5 6*8 lj/cut 5 0.0035 3.5 pair_coeff 6 7*8 lj/cut 6 0.0035 3.5 pair_coeff 7 8 lj/cut 7 0.0035 3.5 mass 1 63.546 mass 2 63.546 mass 3 12.011 mass 4 12.011 mass 5 12.011 mass 6 12.011 mass 7 12.011 mass 8 12.011 compute myCN all centro/atom 12 compute myKE all ke/atom compute myPE all pe/atom compute myCOM all com compute peratom all stress/atom compute vz all property/atom vz # ------------ Equilibrate --------------------------------------- reset_timestep 0 # Now, assign the initial velocities using Maxwell-Boltzmann distribution velocity sim_box create ${stemperature} ${myseed} rot yes dist gaussian fix equilibration all npt temp ${stemperature} ${stemperature} ${tdamp} iso 0 0 ${pdamp} drag 1 variable eq1 equal "step" variable eq2 equal "pxx/10000" variable eq3 equal "pyy/10000" variable eq4 equal "pzz/10000" variable eq5 equal "lx" variable eq6 equal "ly" variable eq7 equal "lz" variable eq8 equal "temp" variable eq9 equal "etotal" fix output1 bulk print 10 "${eq1} ${eq2} ${eq3} ${eq4} ${eq5} ${eq6} ${eq7} ${eq8} ${eq9}" file run.out screen no variable temp atom c_myKE/(1.5*8.61e-5) variable meanpress atom -(c_peratom[1]+c_peratom[2]+c_peratom[3])/3 dump pre1 dumpfirst custom ${atomrate} dump.pre1_*.ovi id type x y z c_myPE c_myKE c_myCN v_meanpress thermo_style custom step pxx pyy pzz lx ly lz temp etotal thermo ${thermorate} thermo_modify lost ignore norm no run ${time_eq} unfix equilibration unfix output1 undump pre1