some question about lammps

Dear all
In lammps, I want to keep the density of the gas constant in a certain area . Which command will do this?

It would be appreciated if you could provide any suggestions. Thanks

With Regards !

zhang

You can group atoms of that particular regions and apply npt ensemble. It may helps you keep your density of the gas constant in that particular area.

I’m very sorry, wrong question, I was wondering how do I keep the solute in some region through lammps. dose npt ensemble can work on it , too?

Anyway, thank you very much for your reply!

You can group atoms of that particular regions and apply npt ensemble. It may helps you keep your density of the gas constant in that particular area.

that suggestion is incorrect in two ways:

  • fix npt does NOT preserve density. on the contrary, it varies the density by changing the cell volume. the purpose is to keep the pressure constant
  • there can be only one fix npt instance active at a time, since it will rescale the simulation cell. you cannot make it work on subsets. with multiple fix npt instances, you would have them compete for changing the cell and then obtain bogus (and most of the time crashing) simulations.

axel.