# periodic boundary conditions along all three dimensions boundary p p p # Set neighbor skin variable neigh_skin equal 2.0*${_u_distance} variable neigh_skin equal 2.0*1 neighbor ${neigh_skin} bin neighbor 2 bin # create a supercell with cubic lattice (fcc, bcc, sc, or diamond) # using 10*10*10 conventional (orthogonal) unit cells variable latticeconst_converted equal 3.645130544900895*${_u_distance} variable latticeconst_converted equal 3.645130544900895*1 lattice diamond ${latticeconst_converted} lattice diamond 3.6451305449009 Lattice spacing in x,y,z = 3.6451305 3.6451305 3.6451305 region simbox block 0 10 0 10 0 10 units lattice create_box 1 simbox Created orthogonal box = (0 0 0) to (36.451305 36.451305 36.451305) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 8000 atoms using lattice units in orthogonal box = (0 0 0) to (36.451305 36.451305 36.451305) create_atoms CPU = 0.001 seconds variable mass_converted equal 12.0107*${_u_mass} variable mass_converted equal 12.0107*1 kim interactions C #=== BEGIN kim interactions ================================== pair_style kim Tersoff_LAMMPS_KinaciHaskinsSevik_2012_BNC__MO_105008013807_000 pair_coeff * * C #=== END kim interactions ==================================== mass 1 ${mass_converted} mass 1 12.0107 # initial volume variable v equal vol # assign formula variable V0 equal ${v} # evaluate initial value variable V0 equal 48432.7645798071 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 48432.7645798071/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 48432.7645798071/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 48432.7645798071/(1*1*${_u_distance}) variable V0_metal equal 48432.7645798071/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 48432.7645798071*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 48432.7645798071 Angstroms^3 # set the time step to 0.001 picoseconds variable timestep_converted equal 0.001*${_u_time} variable timestep_converted equal 0.001*1 timestep ${timestep_converted} timestep 0.001 variable temp_converted equal 333.15*${_u_temperature} variable temp_converted equal 333.15*1 variable Tdamp_converted equal 0.01*${_u_time} variable Tdamp_converted equal 0.01*1 variable press_converted equal 0.0*${_u_pressure} variable press_converted equal 0.0*1 variable Pdamp_converted equal 0.1*${_u_time} variable Pdamp_converted equal 0.1*1 # create initial velocities consistent with the chosen temperature velocity all create ${temp_converted} 17 mom yes rot yes velocity all create 333.15 17 mom yes rot yes # set NPT ensemble for all atoms fix ensemble all npt temp ${temp_converted} ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 0.01 iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 0.01 iso 0 ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 0.01 iso 0 0 ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 0.01 iso 0 0 0.1 # compute the time averages of pressure, temperature, and volume, respectively # ignore the first 5000 timesteps variable etotal_metal equal etotal/${_u_energy} variable etotal_metal equal etotal/1 variable pe_metal equal pe/${_u_energy} variable pe_metal equal pe/1 variable T_metal equal temp/${_u_temperature} variable T_metal equal temp/1 variable V_metal equal vol/(${_u_distance}*${_u_distance}*${_u_distance}) variable V_metal equal vol/(1*${_u_distance}*${_u_distance}) variable V_metal equal vol/(1*1*${_u_distance}) variable V_metal equal vol/(1*1*1) variable P_metal equal press/${_u_pressure} variable P_metal equal press/1 fix avgmyTemp all ave/time 5 20 100 v_T_metal ave running start 1000 fix avgmyPress all ave/time 5 20 100 v_P_metal ave running start 1000 fix avgmyVol all ave/time 5 20 100 v_V_metal ave running start 1000 # extract fix quantities into variables so they can be used in if-else logic later. variable T equal f_avgmyTemp variable P equal f_avgmyPress variable V equal f_avgmyVol # set error bounds for temperature and pressure in original metal units (K and bar) variable T_low equal "333.15 - 1.0" variable T_up equal "333.15 + 1.0" variable P_low equal "0.0 - 5.0" variable P_up equal "0.0 + 5.0" # print to logfile every 1000 timesteps thermo_style custom step etotal v_etotal_metal pe v_pe_metal temp v_T_metal vol v_V_metal press v_P_metal thermo 1000 # Run a simulation for at most 2000*1000 timesteps. At each 1000th time step, check # whether the temperature and pressure have converged. If yes, break. label top variable a loop 2000 run 1000 CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE Your simulation uses code contributions which should be cited: - OpenKIM Project: doi:10.1007/s11837-011-0102-6 @Article{tadmor:elliott:2011, author = {E. B. Tadmor and R. S. Elliott and J. P. Sethna and R. E. Miller and C. A. Becker}, title = {The potential of atomistic simulations and the {K}nowledgebase of {I}nteratomic {M}odels}, journal = {{JOM}}, year = 2011, volume = 63, number = 17, pages = {17}, doi = {10.1007/s11837-011-0102-6} } - OpenKIM potential: https://openkim.org/cite/MO_105008013807_000#item-citation CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update: every = 1 steps, delay = 0 steps, check = yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 4.1 ghost atom cutoff = 4.1 binsize = 2.05, bins = 18 18 18 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, ghost pair build: full/bin/ghost stencil: full/ghost/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 5.827 | 5.827 | 5.827 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 0 -51948.079 -51948.079 -52292.54 -52292.54 333.15 333.15 48432.765 48432.765 7596.6405 7596.6405 1000 -51591.424 -51591.424 -51937.236 -51937.236 334.45661 334.45661 48676.06 48676.06 2450.3733 2450.3733 Loop time of 23.4476 on 1 procs for 1000 steps with 8000 atoms Performance: 3.685 ns/day, 6.513 hours/ns, 42.648 timesteps/s, 341.186 katom-step/s 100.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 23.165 | 23.165 | 23.165 | 0.0 | 98.80 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.026059 | 0.026059 | 0.026059 | 0.0 | 0.11 Output | 9.9457e-05 | 9.9457e-05 | 9.9457e-05 | 0.0 | 0.00 Modify | 0.23628 | 0.23628 | 0.23628 | 0.0 | 1.01 Other | | 0.02003 | | | 0.09 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 6725 ave 6725 max 6725 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 368000 ave 368000 max 368000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 368000 Ave neighs/atom = 46 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 333.051183544407, Press = 81.170326878917 next a jump SELF top variable a loop 2000 run 1000 Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule Neighbor list info ... update: every = 1 steps, delay = 0 steps, check = yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 4.1 ghost atom cutoff = 4.1 binsize = 2.05, bins = 18 18 18 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, ghost pair build: full/bin/ghost stencil: full/ghost/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 5.829 | 5.829 | 5.829 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 1000 -51591.424 -51591.424 -51937.236 -51937.236 334.45661 334.45661 48676.06 48676.06 2450.3733 2450.3733 2000 -51599.997 -51599.997 -51942.774 -51942.774 331.52135 331.52135 48740.906 48740.906 -2974.0911 -2974.0911 Loop time of 24.8671 on 1 procs for 1000 steps with 8000 atoms Performance: 3.474 ns/day, 6.908 hours/ns, 40.214 timesteps/s, 321.710 katom-step/s 97.7% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 24.564 | 24.564 | 24.564 | 0.0 | 98.78 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.025856 | 0.025856 | 0.025856 | 0.0 | 0.10 Output | 8.1813e-05 | 8.1813e-05 | 8.1813e-05 | 0.0 | 0.00 Modify | 0.25128 | 0.25128 | 0.25128 | 0.0 | 1.01 Other | | 0.02569 | | | 0.10 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 6725 ave 6725 max 6725 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 367178 ave 367178 max 367178 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 367178 Ave neighs/atom = 45.89725 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" jump SELF break # Write final averaged volume to file if temperature and volume have converged; otherwise wirte a # flag to indicate non-convergence. variable myStep equal step if "${myStep} < 2000000" then "print '${V}' file output/vol_T333.15.out" else "print 'not_converged' file output/vol_T333.15.out" print '${V}' file output/vol_T333.15.out 48705.91570856 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0