Is it possible to control the pressure of certain group?

I am simulating some liquid between two fixed solid surface. I want to control the pressure of the liquid in x and y direction to be 1atm. But the fix npt command control the pressure of whole system. Is it possible to do npt on one group?

No, that is not possible.

To elaborate on my answer. You can change box dimensions only for the whole system. But it is possible to adjust only x and/or y and have them changed individually or isotropically (= coupled). Details are - as always - in the LAMMPS manual.

Axel, thanks for your reply. I noticed someone mentioned that developing a new compute pressure/group for the fix_modify press command with npt could achieve what I said. I am not sure if it is proper to only control the pressure of one group and change the whole box size while the other groups remain steady. For example, I have two solid surfaces with certain structure and set them as rigid groups. And the liquid between them should reach equilibrium under NPT ensemble. It seems to be a rational system.

First off. You may be using fix npt, but that doesn’t mean that you will be simulating a real NPT ensemble. That would only be true for a homogeneous bulk system and no additional modifications of forces.

That said, measuring pressure in a confined volume is a tricky issue for MD simulations, since the volume itself is often not a very well defined property (after all you are simulating point particles that have no real volume).

For a system confined by walls, things can be even more complex, if the walls are represented by real particles. If you change the box, you need to scale all positions, but then you are changing the walls, too. If you keep them unchanged (check out the dilate keyword of fix npt) then you have problems at the boundaries due to generating unphysical close contacts.

A more physical approach to relaxing liquids between solids would be to move the solid (as a whole) in z-direction rather than changing the box in x- and y-direction. This could be done with fix controller. It is particularly straightforward with wall potentials, but not confined to that.

Please note that a lot of issues like you are describing have their origin in trying to apply an understanding of macroscopic processes and methods to the atomic scale, and that is not always possible. The connection of those two “worlds” is what Statistical Mechanics and Thermodynamics is all about.

Does the controller approach you mentioned means that move the solid in z direction and control the pressure in x and y direction to be expected values? I am trying similar method now. Thanks again!

Please always study the documentation and think about it before asking questions.