softmatter:Periodic boundary conditions
From NSDL Materials Digital Library Soft Matter Wiki
Simulations are usually conducted with periodic boundary conditions to mitigate wall effects and more effectively simulate the bulk.
When using periodic boundary conditions, a particle which exits the system on the right, will reappear on the left. In the schematic below, our simulation volume is colored in red. As the yellow particle exits on the right, it will re-enter on the left. This can be thought of as having identical simulation boxes surrounding the system. As the yellow particle enters the next simulation on the right, a particle from the periodic image on the left will enter.
In practice, as a particle leaves the box, its new position on the other side of the box is calculated using the simple equation:
where x is the particle coordinate, L is the box length and rint rounds to the nearest integer for a system with coordinates -(L/2) to (L/2).



