Here is my problem: I performed NVT simulation on my system with a volume that I knew was larger than the system's relaxed volume. As expected, I observed a negative pressure, I then used the average value of this negative pressure in an NPT run on the same system. I expected the density to remain unchanged (more or less) since I applied the same pressure that was computed before in NVT. However, the density after NPT was significantly larger.
Is my understanding of what I'm doing wrong? Can the pressure LAMMPS computes in NVT be different from the one imposed in NPT?
Some details about the runs:
System is a molecular fluid with bonds, angles, LJ and Coulomb interactions and 7000 atoms. Imposed density in NVT was 0.92 g/m³, relaxed density is 1.09. Average pressure computed in NVT was -400 bar and density computed after NPT with that same pressure was 1.05 g/m³. Temperature was kept unchanged. Both NVT and NPT runs were 1 ns long. No special fixes were used.
Institut Charles Gerhardt
Université de Montpellier
So the NVT density was 0.92 g/m3 (I think you meant g/cc), and the NPT density was 1.05. That does seem rather a large increase. In theory, the two should be very similar, but there are lots of complicating factors that might cause differences. The only thing you can really expect from a barostat is that the average pressure approximate the target pressure, and sometimes it can’t even achieve that. So, if the average pressure in the NPT simulation was -400 bar, the barostat is working just fine. One common source of difference is the kspace contribution. If the numerical parameters used for kspace (e.g. g_ewald) are not the same in both simulations, this will cause a pressure difference, and then a density difference. You should also be careful to prevent the NPT simulation from undergoing an initial large excursion in density, either high or low. Finally, if you simulation is in some sense inaccurate e.g. because the tilmestep is too large, this could be a cause of the density difference in the two simulations. More research required.
Thank you Aidan, the ewald numerical parameters were changed between both runs. Correcting that resolved the density issue.