number of contact for particles with the same size

Asked by reza

Hi guys
I have a binary mixture with two sizes (for example 4 mm and 1 mm). I want to know the number of contacts between spheres with size of 4mm by themselves. So, does anybody have an idea how to do that?

Thanks.

Reza.

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
Best Jérôme Duriez (jduriez) said :
#1

Hello,

I guess there indeed is no built-in function that would do that, but it is quite easy to do the job oneself:

nCont = 0
for i in O.interactions:
    b1 = O.bodies[i.id1]
    b2 = O.bodies[i.id2]
    if b1.shape.radius == 4mm and b2.shape.radius == 4mm: # obviously "mm" is not to be typed here, use the correct numerical value for your model. You may also need to add another test to disregard non-spherical particles, if any.
          nCont+=1

Revision history for this message
reza (mrp325) said :
#2

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