Bug in particleField - advanceParticles

I found a bug in particleField2D.hh (or its 3D equivalent): In advanceParticles() it loops over all cells of the domain, then over the particles at that grid position. There it advances the individual particles. When their new position is not their old position the particle gets push_backed to the particleGrid at the new position. But that new position might be one that hasn’t been looped over yet and then if it is looped over that particle gets advanced again. This happens if one velocity component is positive.

This was discovered in tests where the setup was: a uniform particle field initialized at the center of a domain that doesn’t reach the boundaries. Each time step half the particles are then assigned positive velocities, half negative. After advancing them for a while one can observe them drift in positive direction.

Hi Juva,

I confirm the bug you are reporting. We have fixed it and will publish a corrected Palabos version shortly. Thanks a lot for taking your time and reporting the bug! Bug reports are always highly appreciated.