NewtonIntegrator won't work

Asked by Giovanni Lorenzon

Hello,

my name's Giovanni, I recently started using both Ubuntu and Yade to perform some particle deposition simulations.
I'm definitely new to Yade's environment and I believe that's the very cause of my problem, which apparently seems pretty stupid (but no matter how hard I looked for an answer, I haven't been able to get on top of the question yet).
I'm trying to perform a simple deposition (a cylindrical pack of particles set to fall inside of a cylinder), but I can't get the translational engine to work properly: I use "NewtonIntegrator", set with damping=.2 and common gravity (0,0,-9.81). Although the formulation is that simple, once the simulation is lauched, all the particles start free flowing as they were set in outer space with no gravity (I mean like brownian motion, with no hint to fall in the proper direction).
Although I already revised all text enters, I really can't find the error in my code (which I report hereafter, in order to help you locate the problem).

Thanks in advance for your help!

#===================================================================================================
# SCRIPT FOR PARTICLE DEPOSITION
#===================================================================================================
from yade import pack

#-----GEOMETRY-DEFINITION-------------------------------------------------------------------------
container=geom.facetCylinder((0,0,0), 1.0, 4.0, segmentsNumber=20, wallMask=6)
O.bodies.append(container)

#-----PACK-SHELL-STRUCTURE-DEFINITION-------------------------------------------------------------
pred=pack.inCylinder((0,0,0), (0,0,1), radius=.99)

#-----PACK-GENERATION-----------------------------------------------------------------------------
sp=pack.randomDensePack(pred, spheresInCell=2000, radius=.05)

#-----PARTICLE-ADDITION-TO-SIMULATION-------------------------------------------------------------
O.bodies.append(sp)
sp.toSimulation()

#-----ENGINES-DESCRIPTION-------------------------------------------------------------------------
O.engines=[
    ForceResetter(),
    InsertionCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom_Inc(), Ig2_Wall_Sphere_ScGeom_Inc()],
        [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_ScGeom_FrictPhys_CundallStrack()]
    ),
    GravityEngine(gravity=(0,0,-9.81)),
    NewtonIntegrator(damping=.2,label='newton')
]

O.dt=utils.PWaveTimeStep()
O.saveTmp()

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
Gary Pekmezi (gpekmezi) said :
#1

I do not see a material definition/assignment. The "Brownian motion" effect is likely due to the particles not having any mass.

You can add a material like this:

O.materials.append(FrictMat(young=var1,poisson=var2,frictionAngle=var3,density=var4,label='spheres'))

Then assign it to the particles in the scene with:

sp.toSimulation(material='spheres')

By the way, O.bodies.append(sp) and sp.toSimulation() do the same thing. You only need one of them.

Revision history for this message
Robert Caulk (rcaulk) said :
#2

Hello,

Welcome to Yade!

I should introduce you to some resources that will help you along.

First, the class reference [1] is your best friend. There you will find all the different functionalities available to you through Yade's huge class library. You might also notice how certain engines are "Deprecated" (GravityEngine being one of them), and links to the proper engine.

Second, the examples folder [2]. These are great working templates to start from. For example, funnel.py uses gravity to funnel particles. We know the script is working, it is a matter of tweaking it to your needs slowly but surely.

Finally, to answer the question. Try removing GravityEngine and editing NewtonIntegrator to:

NewtonIntegrator(gravity=(0,0,-9.81)

Cheers,

Robert

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.GravityEngine
[2]https://github.com/yade/trunk/blob/master/examples/funnel.py

Revision history for this message
Giovanni Lorenzon (gioloren) said :
#3

Hello,

thank you very much for your help Gary and Robert!

Unfortunately, that didn't fix my problem, as I still get that brownian motion I was talking about.
In the script I reported I actually forgot about the material declaration, but I had already tried that in fact (and it didn't worked). I also tried to play around with GravityEngine and NewtonIntegrator but nothing seems to help.

Any other suggestion?
Anyhow, thanks again for your time, you guys are so helpful!

Cheers,

Giovanni

Revision history for this message
Robert Caulk (rcaulk) said :
#4

Hello Giovanni,

Your geometry functors are incorrect. Ig2_Sphere_Sphere_ScGom_Inc() does not exist AFAIK. (also you will want to use Facets, instead of Walls IINM.

Consider starting from example templates that you know work. In this case, replace your engine list to match the engine list from the funnel.py example [1].

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
 [Ig2_Sphere_Sphere_ScGeom(),
  Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,-9.81)),
]

[1]https://github.com/yade/trunk/blob/master/examples/funnel.py

Revision history for this message
Giovanni Lorenzon (gioloren) said :
#5

Hello Robert,

thank you very much for your kind answer!

I need to apologize for the code I reported, for it was just one of the many alternatives I had tried by the time I asked for help in here. In fact, I had already tested the modification you suggested, but they won't work either.
Luckily, I've been able to solve the problem with the help of a local user: the very cause of the issue was the degree of compaction of the generated sphere pack. As a matter of fact, there was some interpenetration of the particles, which led to an initial kind of "explosion" (the brownian motion that seemed to me). We solved by running a couple of initial iterations and using a "calm()" command afterwards: it just went the way I planned in the end!

Anyway, thank you very much for your help, I definitely appreciate it!

Cheers,

Giovanni

Revision history for this message
Robert Caulk (rcaulk) said :
#6

> the very cause of the issue was the degree of compaction of the generated sphere pack.

It is worth it for me to correct the thread conclusion, maybe for your sake, but more importantly for Yade documentation's sake. The cause of the problem is not the degree of compaction of the sphere pack. It does not require any special "calm()" functions to work properly, you just need to use the correct functors and engines. Here is the fully functional script:

from yade import pack

container=geom.facetCylinder((0,0,0), 1.0, 4.0, segmentsNumber=20, wallMask=6)
O.bodies.append(container)
pred=pack.inCylinder((0,0,0), (0,0,1), radius=.99)
sp=pack.randomDensePack(pred, spheresInCell=2000, radius=.05)
O.bodies.append(sp)

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop(
 [Ig2_Sphere_Sphere_ScGeom(),
  Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(gravity=(0,0,-9.81)),
]
O.dt=PWaveTimeStep()

from yade import qt
qt.Controller()
qt.View()
O.saveTmp()

Revision history for this message
Giovanni Lorenzon (gioloren) said :
#7

Hello Robert,

thank you very much for your correction, it obviously work just fine! And sorry for my answer, it wasn't intended to mislead any reader.

But at this point I still have some doubts: with the suggestions you guys gave me here, I had already corrected my previous code and designed it in the exact same way you suggested yesterday. Except for one small difference, the material declaration (as Gary suggested me to insert). I wrote it down in this way:

idLactose=O.materials.append(FrictMat(young=3.45e9,poisson=.22,frictionAngle=1.1868, density=1000,label='lactose'))
sp=pack.randomDensePack(pred,spheresInCell=2000,radius=.05,material=idLactose)

I saw that if this specification is set, I get the same problem I talked about, while omitting it, everything goes just fine.
That is the reason why I said the I solved my problem with the "calm()" command (that worked out the situation even with the declared specification).
Then my question is: is there something wrong in my material specification? Is it implemented the wrong way? Or such problem depends on the values I used? Or even, on the combination of this specification and the way I generated the pack?

Thanks again, and sorry for bothering!

Cheers,

Giovanni

Revision history for this message
Robert Caulk (rcaulk) said :
#8

Hello Giovanni,

>I saw that if this specification is set, I get the same problem I talked about

Could you be more specific about what problem you are referring to? When I assign that material in your simulation, the particles settle under gravitational forces within a cylindrical container. I see no problem. Still no need for an extra "calm()" function.

>Then my question is: is there something wrong in my material specification?

There is nothing wrong with your material specification. I mean, the friction angle is unphysically high but maybe you require that? The density is unphysically low, but maybe you require that? Neither of these properties changes the settling behavior of the simulation though.

Revision history for this message
Giovanni Lorenzon (gioloren) said :
#9

Hello Robert,

thank you so much for your help!

The problem I'm referring to is the kind of "brownian motion" I got from the very first run of the code.
Even though I've corrected all the errors you previously pointed out, I still have that problem whenever the material specification is set. On the other hand, once removed, the simulation goes just the way it is supposed to.

I really don't know why this happens. I thought it was due to the values I used for the material (to start, I just picked some random ones, that's why they're so unphysical), but - as you commented - they shouldn't play a role in this. Now I'm just starting to think there might a problem with my Yade installation.

Well, thanks again Robert, you've been the kindest aid!

Cheers,

Giovanni

Can you help with this problem?

Provide an answer of your own, or ask Giovanni Lorenzon for more information if necessary.

To post a message you must log in.