Hi everyone. I am doing a simulation in which the two halves above and below the XOZ plane are nearly symmetric to the plane. To save computational cost, I wonder whether I can only simulate the lower region. This conception is depicted in the diagram below:
The simulation box is only the lower region (x<0). A mirror box will be created together with mirror particles. Since the two halves are symmetric to the XOZ plane, a mirror particle will have the opposite velocities in the x direction and identical velocities in the y and z direction. During the calculation of particle interactions near the symmetry plane, the central atom #1 will interact with not only the real particles (#2, #3, #4), but also the mirror particles (#1’, #2’, #4’) in the cutoff range.
In other cases, if the symmetric plane is XOZ/XOY plane, the velocity of the mirror particle will be (vx, -vy, vz)/(vx, vy, -vz).
I have read some posts mentioning the fix wall/reflect. I don’t think it can apply to my circumstance because the particles won’t bounce back when touching the symmetry plane, but will move according to their interactions with the real particles and mirror particles.
@jasmine969 This kind of setup cannot be done with the existing code. It would require to program extra functionality into LAMMPS in C++ and in this case it is not trivial to make this work in parallel. There is a very similar model for representing the polarization of an ideal metal by charged particles called “image charges”. Various people have tried to implement it, but the only working implementation that I know of is restricted to non-parallel execution as the domain decomposition parallelization of LAMMPS makes it extremely tricky to propagate the mirror charges exactly as needed across multiple subdomains. Since LAMMPS has quite good strong scaling behavior, it will be far easier to find double the CPU power than implementing your model.
There is also a problem with your model: what will happen when particles come close to the mirror plane? The mirroring boundary conditions will add a constraint to them, that would be unphysical compared to explicit particles.
A long, long time ago, in a galaxy far, far away*, Kaitlyn Dwelle wrote a functioning imagecharges fix that does roughly what you are talking about:
Inspired by that, I wrote a zmirror fix into my own USER-CONP2:
I won’t re-document either of those, because there’s a good reason both these projects are dormant. I agree with @akohlmey that compute capacity (to say nothing of GPUs) is growing so rapidly that doubling compute is much better than taking on unphysical behaviours of unknown impact.
That said, the mirrored cell is a general tactic for efficiently constructing asymmetric transverse profiles in MD: build one cell “facing left” and one “facing right” so that their periodic repetition has no net dipole moment, and show that the cells’ observables are statistically independent so that you indeed have twice the sampling from twice the computational work.
Thanks @akohlmey@srtee . The reason why I came up with the conception is due to my background in computational fluid dynamics (CFD) research, which commonly uses mesh-based methodologies and Eulerian framework. Symmetry boundary is widely employed in CFD. On the symmetry plane, the normal volecity is zero: \boldsymbol{v}\cdot\boldsymbol{n}=0. This follows that for a YOZ symmetry plane, we have v_x=0.
Recently I am more interested in SPH, a particle-based method in the Lagragian framework, and LAMMPS is a very powerful tool for particle-based simulation. So I’m pondering how this symmetry boundary can be transferred from the Eulerian framework to the Lagrangian framework in LAMMPS.
The parallelization is indeed an issue to be reckoned with. Chances are that I spend much time implmenting the symmetry boundary but end up in slower computation than merely doubling the computational power So I’d better give up this idea.