Temperature does not rise with fix nvt

I want to place Na,Si,O randomly and then compress the volume with fix nvt to 3000K, then do structural relaxation, then lower the temperature to 2000K, then do structural relaxation, but with the following code the temperature does not increase at first and goes to 0K, and when I try to lower the temperature Temp goes to nan.
Please let me know how to solve this problem.

units real
boundary p p p
atom_style charge

region region1 block 0 300 0 300 0 300
create_box 3 region1


create_atoms 1 random 600 243 region1
create_atoms 2 random 600 643 region1
create_atoms 3 random 1500 8764 region1

#(1:Na, 2:Si, 3:O)
mass 1 22.989769
mass 2 28.0855
mass 3 15.999
set atom 1 charge 0.4725
set atom 2 charge 1.89
set atom 3 charge -0.945
pair_style born/coul/long 7.5
kspace_style ewald 1.0e-3



pair_coeff 1 1 0.08 0.08 2.32 400.0067161 0 10
pair_coeff 1 2 0.063 0.063	1.8804 482.041826 0 10 
pair_coeff 2 2 0.046 0.046	1.4408 580.9010516 0 10

pair_coeff 1 3 0.178 0.178	2.9815 885.9596319 0 10
pair_coeff 2 3 0.161 0.161	2.5419 1067.656071 0 10 
pair_coeff 3 3 0.276 0.276	3.643 1962.278227 0 10

timestep 0.5

fix nvt_fix all nvt temp 3000 3000 0.1 

fix deform_fix all deform 50 x final 0 32.511  y final 0 32.511 z final 0 32.511 

thermo 100 
thermo_style custom step temp press lx etotal

run 90000

unfix deform_fix
unfix nvt_fix

fix nvt2 all nvt temp 3000 2000 0.1

thermo 100 
thermo_style custom step temp press lx etotal
run 10000
unfix nvt2
fix nvt3 all nvt temp 2000 2000 00.1

dump 3 all atom 100 dump_3000K_kCal.lammpstrj
dump 4 all custom 140000 dump.relaxed_3000K_kCal.* type x y z

run 40000

Please study the fix nvt documentation about how to correctly choose the Tdamp parameter.

Consider using the “overlap” keyword here with a suitable distance to avoid close contacts. Your choice of pair style does not handle that situation well.

Are you sure you want “set atom” here? and not “set type”??

Kspace convergence of 1.0e-3 is far to loose, specifically when changing the box dimensions. Also, performance may be better with a larger cutoff on the pair style and when replacing ewald with pppm.

You can speed up the heating process by setting initial atom velocities using the velocity create command.

There is an equilibration step missing here and your simulation times (i.e. number of time steps) are rather short (45ps, 5ps, 20ps).

1 Like