[Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Raphaël Maurin
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Jan Stránský
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Status: Open => Answered

Jan Stránský proposed the following answer:
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 <
question253...@answers.launchpad.net>:

> 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 : yade-users@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Raphaël Maurin
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Status: Answered => Open

Raphaël Maurin is still having a problem:
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

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Raphaël Maurin
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Jérôme Duriez
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Status: Open => Answered

Jérôme Duriez proposed the following answer:
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

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Jérôme Duriez
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Jérôme Duriez proposed the following answer:
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)

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Raphaël Maurin
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Status: Answered => Open

Raphaël Maurin is still having a problem:
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

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Jan Stránský
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Status: Open => Answered

Jan Stránský proposed the following answer:
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 <
question253...@answers.launchpad.net>:

> 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 : yade-users@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~yade-users
> More help   : https://help.launchpad.net/ListHelp
>

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Bruno Chareyre
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Bruno Chareyre posted a new comment:
>So if I understood well, it is not a bug

Right, it is a feature!

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-21 Thread Jérôme Duriez
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Jérôme Duriez proposed the following answer:
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)

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp


Re: [Yade-users] [Question #253399]: bug when a sphere cross 10 times the periodic cell

2014-08-22 Thread Raphaël Maurin
Question #253399 on Yade changed:
https://answers.launchpad.net/yade/+question/253399

Status: Answered => Solved

Raphaël Maurin confirmed that the question is solved:
Thanks Jérôme Duriez, that solved my question.

-- 
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 : yade-users@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp