Problem in thermostating for molecule deposition

Hello everyone,

I have a problem with the temperature when I use fix deposit command for molecule. I am depositing small organic molecules on the surface. I use NVT ensemble and my temperature should be fixed after some molecules inserted into simulation box. But temperature keeps reducing always after each insertion. I have a group called “molec”, and I added all inserted atoms into this group and use fix nvt command also for molec group. fix_modify dynamic/dof yes command didn’t help.
When I visualize trajectories, I can see that molecules are getting immobile and after many insertion they are almost frozen.

Any suggestion would be helpful.

Thank you in advance.

Please provide an input deck for a minimal example demonstrating this behavior. It is very difficult to suggestions based on your rather vague description and without knowing whether there would be something not quite correctly done.
Please also let us know which LAMMPS version exactly you are using, what platform you are running on, and what your command line is.

Sorry, here is my input example:

# 1) Initialization
units metal
dimension 3
atom_style full
boundary p p f

# 3) Simulation settings
read_data  geom_in.lmpdat
molecule pent pentacene.txt toff 1

pair_style hybrid/overlay airebo 0.5 0 1 ilp/graphene/hbn 16.0 1
pair_coeff * * airebo CH.airebo NULL C H NULL
pair_coeff * * ilp/graphene/hbn BNCHO.ILP B C H N

group layer molecule 1
group molec molecule 2

region mybox block 7 33 7 28 5 28 units box
fix 9 molec deposit 82 0 1000 585286 region mybox mol pent near 1.5 vz -0.5 -1.0 units box

neighbor 1.0 bin
neigh_modify every 1 delay 0 check yes
neigh_modify one 10000

fix 12 layer setforce 0 0 0
fix 10 molec wall/reflect zhi 33 units box

# 4) Visualization
thermo 1000
compute add molec temp
compute_modify add dynamic/dof yes extra/dof 0
variable kinetic_energy equal ke
variable potential_energy equal pe
variable total_energy equal etotal
variable tmp equal temp
variable tmpmolec equal c_add

fix myat1 all ave/time 100 1 100 v_tmp v_tmpmolec  v_kinetic_energy   v_potential_energy v_total_energy file energy.dat

dump mydump all xyz 100
dump_modify mydump element B C H N

timestep 0.001
velocity  molec create 300.0 4928459 loop geom
fix mynvt molec nvt temp 300.0 300.0 0.1
#fix_modify mynvt temp add

run 300000

In my geometry file, there is hBN layer and one pentacene molecule on top of it,and I want to add more pentacene. In this input, if I use fix_modify mynvt temp add (which is commented now), temperature is increasing (even up to 600K), if I don’t use it, then temperature is decreasing.
LAMMPS version is 23 Jun 2022

You should be using fix_modify mynvt dynamic/dof yes, which will likely have a similar effect than your commented out fix_modify command since by default the internal temperature compute of the fix will not be aware of the change of the number of degrees of freedom of the “molec” group.

It is quite likely to get a jump in the kinetic energy (and thus the temperature) since you are adding molecules with a velocity added. And you will get a rise of the potential energy, when the molecule is within the cutoff distance of the surface.