# Spheres overlap in periodic simulations

Hello,

I am currently performing a simulation of an inclined flume that goes across the X-axis with periodic walls on the sides(Y-axis). This runs without any major concern mainly thanks to the help provided on this website to many other users. However, when it comes to doing the post-processing, I have noticed that when a sphere crosses the periodic border the following thing occurs:

The sphere's Y-axis(width) coordinates do not restart despite being now on the opposite side of the flume. Instead, they keep increasing "out of the flume". This is not a big concern since this can be easily adjusted on the post-processing and I'm aware this could be useful in other scenarios. Nevertheless, When the sphere crosses the periodic border, it seems that no contact is considered against those particles that did not cross the periodic boundary(or did it more than once). This is observed after manually calculating each contact overlap. When doing this, spheres on the same "coordinates" do have normal overlaps but those who are not on the same boundary have a huge range of overlap(up to one radius) as if no interaction occurs.

Based on this I am curious if this could be a bug or if I am missing any contact law that would allow contact between particles that are not on the same "coordinates".
Finally, I have attached a few code lines regarding the engines used and how I add the spheres.
If any additional information is required, or if there are any suggestions(or ideas), I'd be delighted to read about it.
Best,

(This is not really relevant, just to emphasize that I add spheres through O.bodies.append(utils.sphere()) command.

for i in np.arange(4*d,lr,2*d):
for j in np.arange(d+hr,5*hr,2*d):
for k in np.arange(-wc/2+3*d,wc/2-3*d,2*d):

Engines:
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()],allowBiggerThanPeriod=True),
InteractionLoop(
# handle sphere+sphere and box+sphere collisions
[Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
[Ip2_ViscElMat_ViscElMat_ViscElPhys()],
[Law2_ScGeom_ViscElPhys_Basic()]),
]

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
 Revision history for this message Karol Brzezinski (kbrzezinski) said on 2021-08-28: #1

Hi Andres,

I am not familiar with the history of your simulation. Thus, I am not sure what do you mean by 'periodic'. The MWE would be useful [1].

When it comes to positions of spheres in periodic simulations, Bruno Chareyre once commented it like this [2]:
"Particles leaving from right and appearing on left is just a visualization trick. In memory positions remain untouched, they are all over the place instead of staying in their initial period. "

Cheers,
Karol