Simulating bulk fluid between two walls

Converting a liquid bulk system into a non-periodic system can be tricky business.

Technically, the procedure should be very simple:

However, there are complications from having to “split” a bulk system. If you have spend significant simulation time, you will probably have lots of atoms with non-zero image flags. They can create problems with expanding the box, because that can change their relative positions, if not all atoms have the same image flags. A simple approach to address with would be to use the reset_atoms command — LAMMPS documentation with the image option to fold back molecules as much as possible into the original cell and then use an atom style variable storing the image flag in the direction that you want to make non-periodic (most people choose z) and then use this with the delete_atoms command — LAMMPS documentation with the “mol yes” option to delete all molecules that are still “sticking out”.

As second complication is that you creating a significant “shock” for the atoms that used to be in the bulk and are now suddenly at an interface. That can create phonons that can mess up your dynamics for a significant amount of time. So it is necessary to do more equilibration after that, and best with a dissipative thermostat, like fix langevin using a time constant at the shorter end of the typical scale to get rid of those effects.

1 Like