Periodic boundary of a cylinder

Asked by jamespaul

Hi,

I want to study a rotating drum.In order to shorten the simulation time,I want to shorten the length of the drum by making the ends of the drum periodic boundaries.But I found there is no periodic option in facetCylinder.

Thanks

James

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hi James

> But I found there is no periodic option in facetCylinder.

just make the cylinder open and make it "long enough".
Also consider using boxes instead of facets.

A MWE. Notice, that the sphere fly away after a few bounces (read [1])
###
from yade import geom
r = 3 # cyl radius
h = 2 # cyl "height"
e = 3 # cyl height multiplicator to capture "overflown" spheres
#
cyl = geom.facetCylinder((r,r,.5*h),r,e*h,segmentsNumber=24,wallMask=4,wire=False)
O.bodies.append(cyl)
O.periodic = True
O.cell.setBox(10,10,h)
#
rs = 0.5
s = sphere((1.1*rs,r,0),rs)
s.state.vel = 1e-2*Vector3(1,1,.5)
O.bodies.append(s)
#
O.engines[1].allowBiggerThanPeriod = True # or set it to collider in O.engines definition
# (!) Read [1] carefully
# or divide the cylinder also along axis not to have large bodies
###

cheers
Jan

[1] #https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.InsertionSortCollider.allowBiggerThanPeriod

Revision history for this message
jamespaul (jamespauljames) said :
#2

Thanks Jan,

I added your code into mine.It could generate the cylinder and sphere successfully at beginning.But after running,I reported an error.

In [1]: FATAL /build/yade-AmJP7C/yade-2018.02b/pkg/common/InsertionSortCollider.cpp:495 spatialOverlapPeri: Body #24 spans over half of the cell size 2 (axis=2, see flag allowBiggerThanPeriod)
FATAL /build/yade-AmJP7C/yade-2018.02b/core/ThreadRunner.cpp:30 run: Exception occured:
/build/yade-AmJP7C/yade-2018.02b/pkg/common/InsertionSortCollider.cpp: Body larger than half of the cell size encountered.

Here is my script:
##################################################

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from yade import pack,qt,geom

sphere1=O.materials.append(FrictMat(young=6e5,poisson=0.3,density=2460,frictionAngle=float(atan(0.3)),label='sphere1'))

r = 3 # cyl radius
h = 2 # cyl "height"
e = 1 # cyl height multiplicator to capture "overflown" spheres

cyl = geom.facetCylinder((r,r,.5*h),r,e*h,segmentsNumber=24,wallMask=4,wire=False)
O.bodies.append(cyl)
O.periodic = True
O.cell.setBox(6,6,h)

rs = 0.05
s = sphere((1.1*rs,r,0),rs)
s.state.vel = 1e-2*Vector3(1,1,.5)
O.bodies.append(s)

O.engines[1].allowBiggerThanPeriod = True # or set it to collider in O.engines definition

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
    InteractionLoop(
        [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
       [Ip2_FrictMat_FrictMat_FrictPhys()],
        [Law2_ScGeom_FrictPhys_CundallStrack()]

    ),
    NewtonIntegrator(gravity=(0,0,-9.81),damping=0.1),
    PyRunner(command='motion()',virtPeriod=.4,nDo=2),
]

O.dt=.01*PWaveTimeStep()
qt.Controller()
O.saveTmp()

def motion():
 O.engines += [RotationEngine(ids=Cylinder,rotationAxis=[1,0,0],rotateAroundZero=True,angularVelocity=1.77)];

Revision history for this message
Best Jan Stránský (honzik) said :
#3

> O.engines[1].allowBiggerThanPeriod = True # or set it to collider in O.engines definition
> # (!) Read [1] carefully

InsertionSortCollider(..., allowBiggerThanPeriod=True)

cheers
Jan

Revision history for this message
jamespaul (jamespauljames) said :
#4

Thanks Jan Stránský, that solved my question.