"fix npt" and "fix setforce 0 0 NULL"

Hello all, I tried to simulate the free expansion of two layers in aqueous solution using LAMMPS. I used the “fix setforce 0 0 NULL” to make both layers only move in the z-direction. And I used the “fix 7 all npt temp 300 300 (100 * dt) aniso 1 (1000 * dt)” to control pressure, the average pressure output by “thermo_style press” was about “20”, but both layers kept crossing boundaries in the z-direction, which I believe is an abnormal phenomenon.

I have reviewed similar issues on the forum and found that when I modify the command to “fix rigid1 MMT-OH rigid single force * off on torque * off off”, “neigh_modify exclude group MMT2-OH MMT2-OH”, “neigh_modify exclude group MMT1-OH MMT1-OH”, “fix 7 all npt temp 300 300 (100 * dt) aniso 1 (1000 * dt) dilate Mobile”, there are still the issues I mentioned above, and at this time, LAMMPS outputs the average value of the press was about “1300”.
I don’t know how to solve this problem, and I would be thankful if you make your comments about this issue.
Test.data (787.0 KB)
Test.in (152.2 KB)


If you let them move freely in z-direction, they should be able to freely diffuse in z, and that would include crossing periodic boundaries. So why should they not do that? All the solvent can do it.

P.S.: please make an effort to properly format your posts. When quoting LAMMPS input it should be done correctly or else special characters will be interpreted as markup.

Thanks for your prompt reply! My confusion lies in the fact that the initial positions of the two layers are symmetric about the simulated box and there is no initial velocity. Therefore, if the system controls the pressure in all three directions to be constant, shouldn’t the layers be basically stable? Instead of moving in the z-direction like now.

How about the forces from the solvent? It is not immobile and thus the forces are not symmetric.