RotationEngine on a clump

Asked by Jan De Pue

Dear all,
I have been struggling recently to apply the RotationEngine on a clump of spheres.
My goal is basically to let the clump roll over the floor, as a wheel would do. The forward movement comes from the traction between the wheel and the floor, so the TranslationEngine is not used.

My questions are:
- what am I doing wrong? I tried several things: apply the rotation engine on the individual spheres or on the clump ID, rotate around the center of mass, ...
- Is the same thing possible with a clump of facets?

Here's an example:
I'm using Yade 2018.02b-50-e0894fb~xenial
(I want to work with cohesive materials, hence the cohesive physics. I guess this doesn't matter)

## MWE
from yade import plot, utils, pack, geom, ymport, polyhedra_utils, timing

## MATERIALS
CohFrictMat02=CohFrictMat(label='CohMat1',id=2,
     density=2.6e3,young=1e6,poisson=1e0,frictionAngle=numpy.pi/2*0.8,
                          isCohesive=False)

## DEFINE BODIES
# Fixed Reference
sp=pack.regularOrtho(pack.inAlignedBox([-0.4,-0.4,-0.11],[0.4,2.0,0.1]),
                     radius=0.1,
                     gap=0.0,
                     material = CohFrictMat02,
                     fixed = True)
O.bodies.append(sp)

# Clump to be rotated
sp=pack.regularHexa(pack.inAlignedBox([-0.3,-0.3,0.2],[0.3,0.3,0.8]),
                    radius=0.1,
                    gap=0.0,
                    material = CohFrictMat02,
                    wire = True,
                    fixed = False,
                    )

RotatingClumpID_L = O.bodies.appendClumped(sp) ## APPEND CLUMPED
RotatingClumpID = RotatingClumpID_L[0]
RotatingSpheresID = RotatingClumpID_L[1]
# RotatingSpheresID = O.bodies.append(sp) ## APPEND NOT CLUMPED (for testing)

## dT
dt=O.dt=polyhedra_utils.PWaveTimeStep() #

## MODEL
Gravity = -9.8
# Gravity = 0.0

## Engines
O.timingEnabled=True
EnlargeDetectionRadius = 1.1

RotEngine = RotationEngine(angularVelocity = -10.0,
                           rotationAxis = (1,0,0),
                           ids = [RotatingClumpID,],
                           # ids = RotatingSpheresID,
                           # ids = [RotatingClumpID,]+RotatingSpheresID,
                           # ids = [RotatingSpheresID[0],],
                           rotateAroundZero=1,
                           zeroPoint=O.bodies[RotatingClumpID].state.pos,
                           # rotateAroundZero=0,
                           label = 'RotationTootToot',)

O.engines=[
    ForceResetter(),
    InsertionSortCollider([
        Bo1_Sphere_Aabb(aabbEnlargeFactor = EnlargeDetectionRadius),
        ]),
    InteractionLoop(
        [
        Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor = EnlargeDetectionRadius),
        ],
        [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
        [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(always_use_moment_law = False,
                                                   creep_viscosity = 1,
                                                   shear_creep = False,
                                                   twist_creep = False,
                                                   )],
    ),
    NewtonIntegrator(gravity=(0,0,Gravity),damping=0.8), # Gravity
    RotEngine,
    PyRunner(iterPeriod=1,command="RotEngine.zeroPoint=O.bodies[RotatingClumpID].state.pos"),
    ]

Thanks
Jan

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#1

Hi,
I would suggest simply:
clump.state.blockedDOFs='XYZ'
clump.state.angVel=imposedSpin

However it will only work if you force Newton to use the spherical (instead of "aspherical") time integrator:
Newton.exactAsphericalRot=False (I may fix this in a moment...)
I hope it helps.
Bruno

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#2

Update:
After [1] it is no longer necessary to specify Newton.exactAsphericalRot=False, it will be set automatically as soon as a rotational DOF is blocked.

clump.state.blockedDOFs='Z'
clump.state.angVel=(0,0,1)

Bruno

[1] https://github.com/yade/trunk/commit/c261ac3047e6d1c371a

Revision history for this message
Jan De Pue (jan-depue-x) said :
#3

Hi Bruno,
thanks for the swift reply.
This solutions solves my problem!
Regards
Jan

Revision history for this message
Jan De Pue (jan-depue-x) said :
#4

Thanks Bruno Chareyre, that solved my question.