### DEFINE SIMULATION BOX GEOMETRY ### variable D equal 0.8 lattice sc ${D} region box block 0 15 0 15 0 15 create_box 1 box create_atoms 1 box ### DEFINE PHYSICAL PROPERTIES OF ATOMS ### mass 1 1.0 pair_style lj/cut/opt 3.0 pair_coeff 1 1 1.0 1.0 neighbor 2.0 bin ### SPECIFY THE REQUIRED THERMODYNAMIC STATE ### variable T equal 2.0 variable timestep equal 0.001 ### ASSIGN ATOMIC VELOCITIES ### velocity all create ${T} 12345 dist gaussian rot yes mom yes ### SPECIFY ENSEMBLE ### timestep ${timestep} fix nve all nve ### THERMODYNAMIC OUTPUT CONTROL ### thermo_style custom time etotal temp press thermo 10 ### RECORD TRAJECTORY ### dump traj all custom 1000 output-1 id x y z ### SPECIFY TIMESTEP ### ### RUN SIMULATION TO MELT CRYSTAL ### run 10000 unfix nve reset_timestep 0 ### BRING SYSTEM TO REQUIRED STATE ### variable tdamp equal ${timestep}*100 variable pdamp equal ${timestep}*1000 fix nvt all nvt temp ${T} ${T} ${tdamp} run 10000 reset_timestep 0 ### MEASURE SYSTEM STATE ### thermo_style custom step etotal temp atoms variable temp equal temp variable atoms equal atoms variable etotal equal etotal variable etotal2 equal etotal*etotal fix aves all ave/time 100 1000 100000 v_temp v_etotal v_etotal2 unfix nvt fix nve all nve run 100000 variable temp equal f_aves[1] variable temp2 equal temp*temp variable etotal equal f_aves[2]*f_aves[2] variable etotalsq equal f_aves[3] variable heatcap equal ${atoms}*${atoms}*(${etotalsq}-${etotal})/${temp2} variable volume equal vol variable hcov equal ${heatcap}/${volume} print "Averages" print "--------" print "Density: ${D}" print "AvTemperature: ${temp}" print "HeatCap: ${heatcap}" print "Volume: ${volume}" print "HeatCapOverV: ${hcov}"