making a facet move to a specific location

Asked by ana

I made a cone facet (location (0,0,7) that I want to move into a cylinder full of spheres. I want the cone tip to stop at location (0,0,-1) where I want to measure the normal force exerted on the cone by the spheres. I can't figure out what is wrong with my code as the cone flies through the spheres and doesn't stop at (0,0,-1). Can you please take a look at what i am doing wrong?

from yade import pack, plot, qt

cone = yade.geom.facetCone((0,0,7), radiusTop=0.5, radiusBottom=0, height=2, wire = False,color = (1,0,0),
                    orientation=Quaternion((1, 0, 0), 0), segmentsNumber=10, wallMask=7, angleRange=None, closeGap=False, radiusTopInner=-1, radiusBottomInner=-1)

O.bodies.append(cone)
cone_id = range(len(cone))

O.bodies.append(
yade.geom.facetCylinder(center=(0,0,0), radius=1.5, wire=True, color=(0,1,0),
height=4, orientation=Quaternion((1, 0, 0), 0),
segmentsNumber=10, wallMask=6, angleRange=None,
closeGap=False, radiusTopInner=-1.4, radiusBottomInner=-1.4)
)

sp = pack.SpherePack()
# generate randomly spheres with uniform radius distribution
sp.makeCloud((-1, -1, -2), (1, 1, 4), rMean=0.2, rRelFuzz=0)
# add the sphere pack to the simulation
sp.toSimulation()

O.engines = [
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(), Bo1_Facet_Aabb()]),
        InteractionLoop(
                # handle sphere+sphere and facet+sphere collisions
                [Ig2_Sphere_Sphere_ScGeom(), Ig2_Facet_Sphere_ScGeom()],
                # [Ip2_FrictMat_FrictMat_MindlinPhys()],
                # [Law2_ScGeom_MindlinPhys_Mindlin()],
                [Ip2_FrictMat_FrictMat_FrictPhys()],
                [Law2_ScGeom_FrictPhys_CundallStrack()]
        ),
        NewtonIntegrator(gravity=(0, 0, -9.81), damping=0.4),
        # increase velocity to observe if drillbit is moving
        TranslationEngine(translationAxis=(0, 0, -1),
                          velocity=10, ids=cone_id, label='translation',dead=True),
        PyRunner(command= 'move()',iterPeriod=1),
        # call the checkUnbalanced function (defined below) every 2 seconds
        #PyRunner(command='checkUnbalanced()', realPeriod=2),
        # call the addPlotData function every 200 steps
        #PyRunner(command='addPlotData()', iterPeriod=100),

]
def move():
    if O.iter>2040: # at the 500th iteration, start moving the drillbit
        translation.dead= False

O.dt = .8 * PWaveTimeStep()

qt.View()
O.saveTmp()

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.