bug when a sphere cross 10 times the periodic cell

Asked by Raphaël Maurin

Hi all,

I am simulating flows of particles due to an external fluid force. Then, the phenomenon is dynamic, I use periodic boundary condition in the streamwise direction and I have particles with velocity as high as 0.5m/s.

I noticed a problem of stability when considering small periodic cell. After some times to isolate the problem, I found out that the problem arises when a particle travel for more than 10 times the size of the periodic cell. This does not seem to depend on the contact law, neither on the time step or the velocity of the particle, but only on the number of time the particle is crossing the periodic cell. I am not sure but I think this problem was not present some times ago.

Have you already heard about such a bug ? What can I do to fix that ?
It is a real problem for me as I would be interested to study the effect of the reduction of the size of the periodic cell and reduce it if possible.

Raphaël

I am using Ubuntu 12.04 and yade daily 1.10.0-72-d9ab58c~precise
Here is a simple script to reproduce the bug :

O.dt = 1e-7
lengthCell = 10 #Streamwise length of the periodic cell in diameter
slope = 0.5 #Angle of the slope in radian

#Particles parameters
diameterPart = 6e-3 #Diameter of the particles, in meter, 6mm here.
densPart = 2500 #density of the particles, in kg/m3
#Contact law
cnPart = 0.0 #Normal viscous damping coefficient.
knPart = 1e4 #Normal stiffness of the particle
partFrictAngle = 0.0 #28 *pi/180 #friction angle of the particles, in radian
csPart = 0 #tangential viscous damping coefficient (=0)
ksPart = 0.5*knPart #tangential stiffness of the contact

##Definition of the materials
O.materials.append(ViscElMat(cn=cnPart, cs=csPart, kn=knPart, ks=ksPart, density=densPart, frictionAngle=partFrictAngle, label='sphereMat'))

#
#Geometrical configuration
#
length = lengthCell*diameterPart
width = length/2.0
height = length/3.0
g = Vector3(9.81*sin(slope),0,-9.81*cos(slope))
groundPosition = height/3.0
#Definition of the semi-periodic cell
O.periodic = True
O.cell.setBox(length,width,height)
# build the ground
lowPlane = box(center= (length/2.0,width/2.0,groundPosition),extents=(length*10,width*10,0),fixed=True,wire=False,color = (0.8,0.8,0.8),material = 'sphereMat')

#Send the ground box and the particle to simulation
O.bodies.append(lowPlane)
O.bodies.append(sphere((length/2.0,width/2.0,groundPosition+diameterPart),radius = diameterPart*0.5, material = 'sphereMat'))

#########################
#### SIMULATION LOOP#####
#########################

O.engines = [
 # Reset the forces
 ForceResetter(),
 # Detect the potential contacts
 InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Wall_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()],label='contactDetection',allowBiggerThanPeriod = True),
 # Calculate the different interactions
 InteractionLoop(
    [Ig2_Sphere_Sphere_ScGeom(), Ig2_Box_Sphere_ScGeom()],
    [Ip2_ViscElMat_ViscElMat_ViscElPhys()],
    [Law2_ScGeom_ViscElPhys_Basic()]
 ),
 # Integrate the equation and calculate the new position/velocities...
 NewtonIntegrator(damping=0.0, gravity=g, label='newton')
 ]

O.saveTmp()

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi Raphael,
I tried your script and it worked without any problem. I am using Ubuntu
14.04 and yade compiled from source, version 1.11.0-1-g9bafd30
cheers
Jan

2014-08-21 15:07 GMT+02:00 Raphaël Maurin <
<email address hidden>>:

> New question #253399 on Yade:
> https://answers.launchpad.net/yade/+question/253399
>
> Hi all,
>
> I am simulating flows of particles due to an external fluid force. Then,
> the phenomenon is dynamic, I use periodic boundary condition in the
> streamwise direction and I have particles with velocity as high as 0.5m/s.
>
> I noticed a problem of stability when considering small periodic cell.
> After some times to isolate the problem, I found out that the problem
> arises when a particle travel for more than 10 times the size of the
> periodic cell. This does not seem to depend on the contact law, neither on
> the time step or the velocity of the particle, but only on the number of
> time the particle is crossing the periodic cell. I am not sure but I think
> this problem was not present some times ago.
>
> Have you already heard about such a bug ? What can I do to fix that ?
> It is a real problem for me as I would be interested to study the effect
> of the reduction of the size of the periodic cell and reduce it if possible.
>
> Raphaël
>
> I am using Ubuntu 12.04 and yade daily 1.10.0-72-d9ab58c~precise
> Here is a simple script to reproduce the bug :
>
> O.dt = 1e-7
> lengthCell = 10 #Streamwise length of the periodic cell in diameter
> slope = 0.5 #Angle of the slope in radian
>
> #Particles parameters
> diameterPart = 6e-3 #Diameter of the particles, in meter, 6mm here.
> densPart = 2500 #density of the particles, in kg/m3
> #Contact law
> cnPart = 0.0 #Normal viscous damping coefficient.
> knPart = 1e4 #Normal stiffness of the particle
> partFrictAngle = 0.0 #28 *pi/180 #friction angle of the particles, in
> radian
> csPart = 0 #tangential viscous damping coefficient (=0)
> ksPart = 0.5*knPart #tangential stiffness of the contact
>
> ##Definition of the materials
> O.materials.append(ViscElMat(cn=cnPart, cs=csPart, kn=knPart, ks=ksPart,
> density=densPart, frictionAngle=partFrictAngle, label='sphereMat'))
>
> #
> #Geometrical configuration
> #
> length = lengthCell*diameterPart
> width = length/2.0
> height = length/3.0
> g = Vector3(9.81*sin(slope),0,-9.81*cos(slope))
> groundPosition = height/3.0
> #Definition of the semi-periodic cell
> O.periodic = True
> O.cell.setBox(length,width,height)
> # build the ground
> lowPlane = box(center=
> (length/2.0,width/2.0,groundPosition),extents=(length*10,width*10,0),fixed=True,wire=False,color
> = (0.8,0.8,0.8),material = 'sphereMat')
>
> #Send the ground box and the particle to simulation
> O.bodies.append(lowPlane)
> O.bodies.append(sphere((length/2.0,width/2.0,groundPosition+diameterPart),radius
> = diameterPart*0.5, material = 'sphereMat'))
>
> #########################
> #### SIMULATION LOOP#####
> #########################
>
> O.engines = [
> # Reset the forces
> ForceResetter(),
> # Detect the potential contacts
> InsertionSortCollider([Bo1_Sphere_Aabb(),
> Bo1_Wall_Aabb(),Bo1_Facet_Aabb(),Bo1_Box_Aabb()],label='contactDetection',allowBiggerThanPeriod
> = True),
> # Calculate the different interactions
> InteractionLoop(
> [Ig2_Sphere_Sphere_ScGeom(), Ig2_Box_Sphere_ScGeom()],
> [Ip2_ViscElMat_ViscElMat_ViscElPhys()],
> [Law2_ScGeom_ViscElPhys_Basic()]
> ),
> # Integrate the equation and calculate the new
> position/velocities...
> NewtonIntegrator(damping=0.0, gravity=g, label='newton')
> ]
>
> O.saveTmp()
>
>
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Raphaël Maurin (raphael-maurin) said :
#2

Hi Jan,

Surprising, I tried also with a version compiled from source and I still have the same problem...
Any idea what it can be due to ? Otherwise I can try to update Ubuntu.

Raphaël

Revision history for this message
Raphaël Maurin (raphael-maurin) said :
#3

Ok, in fact I just realize that I forgot most of the explanation and I understand why you say it works .
I was not clear with 'stability problem'. The problem is that after crossing 10 times the periodic cell, the particle is passing through the box and does not have any interaction with it any more. It is just falling like if there were no box.
Can you reproduce that ?
Sorry for the bad description.
Raphaël

Revision history for this message
Best Jérôme Duriez (jduriez) said :
#4

Hello Raphaël,

Your box has dimensions equal to 10 times those of the periodic cell : lowPlane = box(...,extents=(length*10,width*10,0)

This corresponds to *finite* dimensions as bodies as box are not supposed to be replicated in periodic space, contrary to spheres. So it is completely normal that your sphere at a moment does not see it anymore and falls !

 It is a bit tricky, so am I clear enough ?

Jérôme

Revision history for this message
Jérôme Duriez (jduriez) said :
#5

So, the solution is to increase a lot your "10", and pray that you typed a "good" number...

(see https://answers.launchpad.net/yade/+question/246392 and related bug)

Revision history for this message
Raphaël Maurin (raphael-maurin) said :
#6

Ok, I see your point, I didn't think at the problem this way. Thank you for the answer ! So if I understood well, it is not a bug and I 'just' need to put a huge length of the box, no ?
Is there a limit of length I can put and will this affect the computational time ?
Raphaël

Revision history for this message
Jan Stránský (honzik) said :
#7

Hi Raphael,
sorry for misunderstanding, I was expecting some error or segmentation
fault :-)
Jan

2014-08-21 15:46 GMT+02:00 Raphaël Maurin <
<email address hidden>>:

> Question #253399 on Yade changed:
> https://answers.launchpad.net/yade/+question/253399
>
> Raphaël Maurin gave more information on the question:
> Ok, in fact I just realize that I forgot most of the explanation and I
> understand why you say it works .
> I was not clear with 'stability problem'. The problem is that after
> crossing 10 times the periodic cell, the particle is passing through the
> box and does not have any interaction with it any more. It is just falling
> like if there were no box.
> Can you reproduce that ?
> Sorry for the bad description.
> Raphaël
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#8

>So if I understood well, it is not a bug

Right, it is a feature!

Revision history for this message
Jérôme Duriez (jduriez) said :
#9

Finally, no I do not think there is a length limit, and that the number you put could affect the computational time.

But, for me it remains still the quite annoying issue that you can not be sure that the number you put gives "correct" results (see my previous links)

Revision history for this message
Raphaël Maurin (raphael-maurin) said :
#10

Thanks Jérôme Duriez, that solved my question.