← Back to team overview

yade-users team mailing list archive

[Question #664138]: Change interaction during two spheres during the simulation process

 

New question #664138 on Yade:
https://answers.launchpad.net/yade/+question/664138

Hi All,

I have a problem during discrete element modeling with YADE.  
I want to change the interaction of two spheres during the simulation process through the following functions. I'm using a cohesive, frictional contact model (Luding Model). After my two particles are in contact with a specific overlap I want them to  fall to the bottom of the box. 

Here is the code:

#!/usr/bin/env python
#encoding: ascii

# Testing of the Deformation Enginge with Luding Contact Law
# Modified Oedometric Test

from yade import qt, utils, plot, timing
from yade import pack

o = Omega()

# Definition of the physical Parameter
fr        = 0.3
rho       = 0.002														
Diameter  = 4.5e-2 														
r1        = Diameter
r2        = Diameter

k1        = 1000
kp        = 100*k1
kc        = k1 * 1
ks        = k1 * 0.1

DeltaPMax = Diameter/1.5												
Chi1 = 1.0																
tc = 0.0001 															
o.dt = 0.0001*tc 														
																		


particleMass = 4.0/3.0*math.pi*r1*r1*r1*rho

Vi1 = math.sqrt(k1/particleMass)*DeltaPMax*Chi1
PhiF1 = DeltaPMax*(kp-k1)*(r1+r2)/(kp*2*r1*r2)



#Add material
mat1 = O.materials.append(LudingMat(frictionAngle=fr, density=rho, k1=k1, kp=kp, ks=ks, kc=kc, PhiF=PhiF1, G0 = 0.0))

# Add spheres
id1 = O.bodies.append(sphere(center=[0,0,0],radius=r1,material=mat1,fixed=True))
id2 = O.bodies.append(sphere(center=[0,0,2*r1],radius=r2,material=mat1,fixed=False))

# Import box's geometry
O.bodies.append(geom.facetBox(center=(0,0,0), extents=(2.25e-1,2.25e-1,2.25e-1), wallMask=31, material=mat1))


#Add engine
O.engines = [
  ForceResetter(),
  InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
  InteractionLoop(
    [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom(), Ig2_Wall_Sphere_ScGeom()],
    [Ip2_LudingMat_LudingMat_LudingPhys()],
    [Law2_ScGeom_LudingPhys_Basic()]
  ),
  NewtonIntegrator(damping=0.1, gravity=[0, 0, -9.81]),
  PyRunner(command='ChangePosition()', iterPeriod=1000, dead=False,label='checker'),
]

#Function Change Position
def ChangePosition():
	pairs = [(i.id1,i.id2) for i in O.interactions]
        O.interactions.clear()
        for id1,id2 in pairs: utils.createInteraction(id1,id2)
	

# spheres get closer:
O.bodies[id2].state.vel=Vector3(0,0,-Vi1)


qt.View()



Thanks for every help!!!!


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.