← Back to team overview

yade-users team mailing list archive

Re: [Question #707311]: How to add rotation on the Boxfactory?

 

Question #707311 on Yade changed:
https://answers.launchpad.net/yade/+question/707311

Mu Wh posted a new comment:
Hi :
    On July 20, 2023, I proposed a method that can indirectly achieve rotating powder fall. However, the engine and factory did not operate as set up. Could you give me some advice? The code is shown below.

 CODE:
from __future__ import print_function
from yade import pack,  geom
import time
steelID= O.materials.append(FrictMat(density=7800,young=2.2e9,poisson=.3,frictionAngle=math.atan(.62),label="316lsteel"))
CylinderID=O.bodies.append(geom.facetCylinder((0,0,10), radius=10, height=20, orientation=Quaternion((1, 0, 0), 0), wire=True,segmentsNumber=60, dynamic=False, wallMask=6, angleRange=None, closeGap=False, radiusBottomInner=-1,material='316lsteel'))
BoxID=O.bodies.append(geom.facetBox(( 1.5, 0, 1.5), (1.5, 9.5, 1.5), wallMask=15, wire=False,highlight=False,noBound=False,material='316lsteel'))

O.engines=[
       ForceResetter(),
       InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Cylinder_Aabb()]),
       InteractionLoop(
               [Ig2_Facet_Sphere_ScGeom(),Ig2_Sphere_Sphere_ScGeom()],
               [Ip2_FrictMat_FrictMat_MindlinPhys(en=0.636, es=0.636,frictAngle=math.atan(.62))],
               [Law2_ScGeom_MindlinPhys_Mindlin()]
        ),
         
         BoxFactory(
                maxParticles=2000,
                extents=(2.5, 2.5, 2),
                center=(3, 3, 10),
                rMin=0.28,
                rMax=0.29,
                vMin=10,
                vMax=10,
                vAngle=0,
                massFlowRate=100000.,
                normal=(0, 0, -1),
                label='factory',
               materialId=steelID,
               dead=True
              
       
        ),
       

        HelixEngine(ids=BoxID,rotationAxis=(0,0,1),angularVelocity=0.1,linearVelocity=1,label='helix',dead=True), # factory rotation and translation
        PyRunner(command='timeselect',iterPeriod=1),
        NewtonIntegrator(gravity=(0,0,-9.81))
]   

def timeselect():

    if O.iter <= 200000:
      
       helix.dead=True
       factory.dead=False 
       print('\n start to deposite powderds! \n')
              
    else:
    
         factory.dead=True
         helix.dead=False
         print('\n start to spread powderds! \n')
       
O.dt=.5e-4*utils.PWaveTimeStep()
O.saveTmp()
O.run()

Cheers,
Weihao Mu

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