### DEFINE SIMULATION BOX GEOMETRY ### variable dens equal 0.2 lattice sc ${dens} 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.0025 ### 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 ### 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} run 10000 reset_timestep 0 ### SWITCH OFF THERMOSTAT ### unfix nvt fix nve all nve ### MEASURE SYSTEM STATE ### thermo_style custom etotal temp atoms vol variable temperature equal temp variable temperaturesqd equal temp*temp variable volume equal vol variable energy equal etotal variable energysqd equal etotal*etotal variable atoms equal atoms variable atomssqd equal atoms*atoms fix aves all ave/time 100 1000 100000 v_temperature v_energy v_energysqd v_temperaturesqd run 100000 variable avtemperature equal f_aves[1] variable avenergy equal f_aves[2] variable avenergysqd equal f_aves[3] variable avtemperaturesqd equal f_aves[4] variable heatcapacity equal ${atomssqd}*(${avenergysqd}-(${avenergy}*${avenergy}))/${avtemperaturesqd} print "Averages" print "--------" print "Temperature: ${avtemperature}" print "Number of Atoms, N: ${atoms}" print "Volume: ${volume}" print "Heat Capacity: ${heatcapacity}"