how to add cohesion between box and spheres

Asked by Yuxuan Wen on 2020-07-29

Dear YADE users,

I am simulating the spheres falling down to a box plate under gravity. When the spheres touching the box plate, I want to add strong cohesive force between the spheres and box plate, so that spheres will not bounce but stay on the box plate. The sphere and box are FrictMat. I tried to add a positive normal force between spheres and box once they are in touch:
for i in O.interactions:
 if isinstance(O.bodies[i.id1].shape,Box) and isinstance(O.bodies[i.id2].shape,Sphere):
  i.phys.normalforce=1e9 #(some positive value)

The full code is shown as follows:
from yade import pack, plot, qt, export, os


# creat horizontal 4 periodic boundries by cell
O.cell.hSize=Matrix3(lx, 0, 0,
        0, ly, 0,
        0, 0, lz)

# Define materials
idBox=O.materials.append(FrictMat(young=1e5, density=2650, poisson=0.5, frictionAngle=radians(26.6), label='Box'))

# creat plate
lowBox=box(center=(0.5*lx,0.5*ly,0.25*lz), extents=(lx*2,ly*5,0.0001),wire=False, fixed=True, material="Box")#

# creat sphere particles
sp=pack.SpherePack() # create an empty cloud; SpherePack() contains only geometrical information
sp.makeCloud((0.0,0.0,0.3*lz+4*radium), (lx,ly,0.7*lz-4*radium), rMean=1.5*radium, rRelFuzz=0.0, num=100, periodic=True)
for s in sp:

# engines


# define functions
def servo(): # add cohesive forces
 for i in O.interactions:
  if isinstance(O.bodies[i.id1].shape,Box) and isinstance(O.bodies[i.id2].shape,Sphere):

The sphere will stay on the box plate instead of bouncing. But I am not sure if it is suitable to adjust the interaction forces directly. In the following stage, an external force F_e will be applied on the box.

1) Is this way correct to add cohesive force between spheres and box plate?

2) Will the added interaction force affect the behavior under F_e? I mean can we treat the interaction force as a external force or not?

Thank you so much!

Question information

English Edit question
Yade Edit question
No assignee Edit question
Solved by:
Jérôme Duriez
Last query:
Last reply:
Jérôme Duriez (jduriez) said : #1


I doubt "i.phys.nornalforce=1e9" like in your "full code" would do anything good because of the typo (in normalForce). This being said:

1) Doing so, you're not adding anything, you're modifying something which has already been computed by YADE.
Trying to predict the possible effects of this manual update, you may keep the following in mind:

* bodies movements/bouncing depend on resultant forces on bodies O.forces.f() [*], not directly on interaction forces. Because YADE is great, both quantities are related one to another as they should in the InteractionLoop (Law2 actually) code. But that does not seem to be the case in your code.

* if you really wish to compute and apply forces yourself, this should come before NewtonIntegrator. Otherwise, bodies displacements in a given time step will have already occurred before you trick anything. And your trick will be soon erased by the ForceReseter during the subsequent time step

2) Not really understood, sorry :-)

[*] thi

Yuxuan Wen (wenyuxuan) said : #2

Hello Jérôme,

1) Doing so, you're not adding anything, you're modifying something which has already been computed by YADE.

Thank you for replying, now I understand the simulation loop shown in the documentation and the mechanism to calculate body movement in YADE. It seems that i) the interaction force is calculated based on the bodies' position (hence the interaction); ii) then other forces (gravity, BCs) are added on the bodies; iii) then the movement of bodies is calculated by NewtonIntegrator.

2) Not really understood, sorry :-)

What I want to figure out is answered in your replying in 1), thank you very much!

May I ask you another question, that how do you think is appropriate to add cohesive force between spheres and the box plate to avoid bouncing? Change the material from FrictMat to CohFrictMat?

Kind Regards,

Best Jérôme Duriez (jduriez) said : #3

If you want cohesive (tensile-resisting) interactions, you need for sure to abandon FrictMat and go to CohFrictMat.

If you want to avoid bouncing, you may also consider inserting your spheres directly at their equilibrium position.

Yuxuan Wen (wenyuxuan) said : #4

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