How to simulate a Open system in Lammps

Dear lammps-user

I want to use create_atoms random command continuously to add atoms into an existing system. In the initial system, There are two kinds of atoms. One is Ar and the other is Ag. In this simulation, the Ar is controlled by nvt ensemble and the Ag is given velocities by velocity command. The Ag only applies nve ensemble to update the velocity and position. After the system reaches the equilibrium, I add the Ag atoms into the system and the added Ag atoms also use velocity to give a velocity and only perform nve ensemble to update velocities and position. After running the simulation for a while, it is found the temperatures in the initial system and added Ag atoms previously drop while Ag atoms are added into the box and the magnitude of the decline is bigger as the added atoms become larger. However, I want not to occur this phenomenon and the temperature both does not drop. Please help me to teach me how to solve it. And the input script and the resulted log file are attended. Thanks for your help!

Sincerely yours (1.9 KB)

log.lammps (114 KB)

Using NVT for a non-constant # of atoms is a generally bad idea.

It is a thermostat that stores state which depends on the previous # of

atoms. I suggest you try fix langevin instead. Also make

sure that any temperature compute that you define (or a thermostat

fix defines, read its doc page) is set with compute_modify dynamic yes,

That includes any temperature compute used be thermo ouput

(read its doc page). Otherwise the temp compute doesn’t track

a changing # of atoms. That could be the reason you think the temperature

is dropping, when it really isn’t.