### DEFINE SIMULATION BOX GEOMETRY ### lattice sc 0.2 ### The density was varied here (0.2 and 0.8) 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 ### The temperature was varied here (2.0, 2.2, 2.4, 2.6, 2.8) variable timestep equal 0.0025 ### This timestep was found to be the most appropriate ### 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 fix nvt all nvt temp ${T} ${T} ${tdamp} ### Changed as per the script run 10000 reset_timestep 0 unfix nvt ### Switching off the thermostat fix nve all nve ### MEASURE SYSTEM STATE ### thermo_style custom step etotal temp atoms vol variable etotal equal etotal variable etotal2 equal etotal*etotal variable temp equal temp variable temp2 equal temp*temp variable X equal atoms variable X2 equal atoms*atoms variable vol equal vol fix aves all ave/time 100 1000 100000 v_etotal v_etotal2 v_temp v_temp2 run 100000 variable aveetotal equal f_aves[1] variable aveetotal2 equal f_aves[2] variable avetemp equal f_aves[3] variable ave2etotal equal f_aves[1]*f_aves[1] variable heatcapacity equal ${X2}*(${aveetotal2}-${ave2etotal})/(${avetemp}*${avetemp}) ### Equation for calculating the heat capacity variable heatcapacityvolume equal (${X2}*(${aveetotal2}-${ave2etotal})/(${avetemp}*${avetemp}))/vol ### Equation for calculating the heat capacity per unit volume print "Averages" print "--------" print "Temperature: ${avetemp}" print "Heat Capacity: ${heatcapacity}" print "Heat Capacity Volume: ${heatcapacityvolume}"