Track energy added/subtracted with temp/rescale

Dear all,

I have used fix temp/rescale command to keep track of energy added/subtracted.

What I expected to see was add/subtracted energy will be converging and be equal to each other after the equilibration, but it is not converging at all.

I first did NVT equilibration, and used fix temp/rescale with fix NVE command.

Does anyone have idea why it is not converging at all?
If you had similar problem before or know how to fix it, please share with me.

Thank you.

ChangJin Choi

This can be due to a lot of reasons. Have you checked the system with
just NVE after the equilibration? If it does not conserve energy,
then added/subtracted energy using fix temp/rescale will certainly not
converge.

Ray

Hi Ray,

Thank you for your response.

I did check the energy after NVE equilibration, and it is conserved at that time.
However, it is still not converged after temp/rescale.
Can you think of any other reason?

Thank you.

ChangJin Choi

Please provide a working, simple input deck to demonstrate your question.

Ray

Don’t use temp/resale. It does bad things to your system dynamics anyway.

Axel.

Ray,

Here is input code.

My question is why energy added/subtracted are not equal to each other after using temp/rescale.
I thought the net energy will be zero, but it is not.

Thank you.

---------- Initialize Simulation ---------------------

clear
units metal
dimension 3
boundary p p f
atom_style atomic
atom_modify map array
neighbor 2 bin
neigh_modify every 1
echo screen
newton on

---------- Create Atoms -------------------------------

lattice diamond 5.431
region box block 0 2 0 2 0 18.1
create_box 1 box
create_atoms 1 box

---------- Define Interatomic Potential ---------------

pair_style tersoff
pair_coeff * * Si.tersoff Si
mass 1 28.06

---------- Settings --------------------------------

size: 2218

region 2 block 0 2 0 2 0 2 units lattice # left boundary
region 3 block 0 2 0 2 16 18.1 units lattice # right boundary
region 4 block 0 2 0 2 2 5 units lattice # high temp bath
region 5 block 0 2 0 2 13 16 units lattice # low temp bath
region 6 block 0 2 0 2 5 13 units lattice # middle

region 7 block 0 2 0 2 5.5 7.5 units lattice # T1
region 8 block 0 2 0 2 8.0 10.0 units lattice # T2
region 9 block 0 2 0 2 10.5 12.5 units lattice # T3

group l_fixed region 2
group r_fixed region 3
group htemp region 4
group ctemp region 5
group mid region 6
group nowall union htemp ctemp mid

group layer1 region 7
group layer2 region 8
group layer3 region 9

fix lbdr l_fixed setforce 0.0 0.0 0.0
fix rbdr r_fixed setforce 0.0 0.0 0.0

------------------ NVT Equilibration -----------------------------

thermo 100
velocity all create 330.0 4928459 dist gaussian

fix nvt1 htemp nvt temp 310 310 0.3
fix nvt2 ctemp nvt temp 290 290 0.3
fix nvt3 mid nvt temp 300 300 0.3

display thermo

thermo_style custom step temp etotal press vol

reset_timestep 0
timestep 0.001

run 100000

unfix nvt1
unfix nvt2
unfix nvt3

------------------ NVE Equilibration -----------------------------

fix nve nowall nve

run 100000

--------------- Direct Method ---------------------

fix heatbath htemp temp/rescale 1 350.0 350.0 0.5 1.0
fix middle mid temp/rescale 1 300.0 300.0 0.5 1.0
fix coldbath ctemp temp/rescale 1 250.0 250.0 0.5 1.0

compute T1 layer1 temp
compute T2 layer2 temp
compute T3 layer3 temp

thermo_modify lost warn
thermo_style custom step temp etotal c_heatbath_temp c_middle_temp c_coldbath_temp f_heatbath f_coldbath c_T1 c_T2 c_T3