About Clump's Velocity Initialization

Asked by YingnanXu

Hello,

I've just started learning Yade recently. I want to consolidate several balls together and give one of them initial speed, then let it collide with the surface.

However, when I opened the 3D perspective, I found that in the process, the ball did not have any speed. After checking, I think there is something wrong with my fllowing code.

##################################code############################################
#define parameters

damp=0.1
M=1000
velocity=5
anguler=pi/4

rhoSmall=0.5
rhoBig=3

#define the balls
sphereBig=sphere((0,0,2*rhoSmall+rhoBig),radius=rhoBig)
sphereSmall=sphere((0,0,rhoSmall),radius=rhoSmall)

#clump
clumpId=O.bodies.appendClumped([sphereBig,sphereSmall])

#define the area
area=yade.geom.facetBox((0,0,1),(10,10,1),wallMask=31)#a box opens on the top
O.bodies.append(area)

#change the velocity
O.bodies[clumpId[1][0]].state.vel=(0,velocity*cos(anguler),-1*velocity*sin(anguler))

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),damping=damp)
]

O.dt=.05*PWaveTimeStep()

##############################end################################################

Can you find out where the error of my code is? I want to tie more balls together in the future, but the experiment of two balls fails. Can someone answer that?

Yingnan

Question information

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

Hi,

I think you have two problems:

1. Your bodies (including the clump) are dynamic, ie they can not have in general (unless they do not sustain any force/interaction) a constant velocity, equal to the one you defined.

Then, the velocity you defined is only an initial velocity, and what happens afterwards depends on interaction possibilities (there are some, here), and kinetic energy might turn into interaction energy (velocity may vanish)

See https://yade-dem.org/doc/user.html#motion-constraints

(this is not clump-specific)

2. In the specific case of clump, it seems you need to (logically ?) deal with dynamic and velocity attributes at the clump body level.
Hence, adding
O.bodies[clumpId].dynamic = False

and replacing
O.bodies[clumpId[1][0]].state.vel
with
O.bodies[clumpId].state.vel

should do what you want

Note that I'm not really a clump user, so better check yourself.

PS: note that in general, looking at the 3D view to know whether bodies move or not is generally misleading because displacements upon the DEM cycles get usually unnoticed to the eye. Better check bodies state.vel (which confirms the GUI impression here)

Revision history for this message
YingnanXu (xuyingnan) said :
#2

Thank you so much, Duriez.

Thank you for answering so carefully, But I still have problems to this question. :(

->1:
    I went back to inspect to check the initial speed (not yet started the iteration) and found it was still zero. In order to avoid confusion, I did a comparative experiment. If it was not clump, I used this method to assign the initial speed and check the initial speed as my desired value.

->2:
    I tried what you said again. If you assign a function clumpId directly, it will make an error (parameter mismatch). If you assign a function clumpId [0], although it does not make an error, the detection speed is still zero.

->ps:
   Thank you very much for reminding me of this. I have always ignored this. Sometimes we don't necessarily see reality. :)

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

Hello,

> clumpId=O.bodies.appendClumped([sphereBig,sphereSmall])

O.bodies.appendClumped returns (id of clump, list of id of members). So it is usually used like this (it is more readable):
#
clumpId, memberIds = O.bodies.appendClumped(...)
#
this will also solve your problem 2

> I want ... give one of them initial speed

You can assign a velocity to a clump member. However, the value is overwritten from the values of the clump. This is why your approach does not work.
Alternatively, you can assign velocity and angular velocity to the clump.

> If you assign a function clumpId [0], although it does not make an error, the detection speed is still zero.

what is "detection speed"?

cheers
Jan

Revision history for this message
YingnanXu (xuyingnan) said :
#4

Thank you so much Jan :)

I used the wrong word, actually "detection speed" refers to the initial velocity observed from the "inspect button" after I press F12.

->#
->clumpId, memberIds = O.bodies.appendClumped(...)
->#

When I write in this way, and I use "O.bodies[clumpId].state.vel=(...)", the initial velocity I get is still zero.

Best regards

Yingnan

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

> the initial velocity I get is still zero.

if you refer to the velocity of clump member, yes, the value before O.step() is zero, because the value of velocity is updated according to the clump by NewtonIntegrator.

Jan

Revision history for this message
YingnanXu (xuyingnan) said :
#6

Thanks Jan Stránský, that solved my question.