Pressure data from thermo_style command not matching with the pressure I gave by fix npt command

Dear all

Just a simple question. I’ve used fix npt command to get the equilibrium state of my system at 300K and 0bars, but the thermo datas given from the thermo_style,thermo command outputs pressure values that are far from 0bars. Ive tried to use fix nve command to isolate the system and check the pressure of the system, but still the pressure is far bigger than 0bars. Why is this happening? How can I solve this?

Any help would be greatly appreciated.


There are several factors that may contribute to what you observed.

  1. the barostat does not “lock” the system pressure at a specific value; instead, it allows the system pressure to fluctuate around the specified value. In other words, if you have fix npt with pressure set to 0, (if everything goes well) the actual pressure should be sometimes >0 and sometimes <0, with the long time average close to 0. For small simulation cells and condensed phase systems the fluctuation can be rather large (like ~100 or ~1000 bars, depending on the configuration), and in many cases that’s fine as long as the long-time average is correct.
  2. the system pressure is only meaningful if the system is homogeneous and periodic. So if you’re simulating e.g. slabs or isolated molecules the pressure values calculated by LAMMPS is likely not useful (and using npt is probably not a good idea in such cases).
  3. Generally speaking, the overall system pressure is meaningful only at equilibrium states. It usually takes some time before the system reaches equilibrium in a MD simulation, especially if the initial configuration is not very physical. You may try using a longer simulation time to see if the situation improves (several times of the barostat relaxation time should be enough in many cases).
1 Like

On the atomic scale, pressure always fluctuates; just like temperature but more so; and quite a bit more so for condensed systems, since they are not very compressible. The latter effect is particularly noticeable when you are trying to establish atmospheric pressure (i.e. low pressure), the fluctuations are then gigantic when compared to the target value.

All fluctuations resulting from sampling too small a system can be reduced by using a larger system. For a system in equilibrium, you can also average over time instead of just averaging across the system. In LAMMPS you can use fix ave/time for that. But recall that converging the averaged pressure to your target may take a long time for a large system…

Thanks a lot for your support.
I’ve understood what you’ve provided. Then, is it possible to use the fix nve command to check what pressure and temparature the system has reached equilibrium? Im not sure of the purpose of the fix nve command, but since it isolates the system, I thought that it could give me information about the equilibrium state of the system.

Thanks a lot for your support.
According to what you were saying, is it okay if I use fix ave/time on pressure to calculate the average pressure, and work on a different input script and use the average pressure and see what pressure it reaches equilibrium in?