Particle Cylinder

Asked by Ed Carlos Alves Rocha

I'm new to Yade. I have two particles to insert into a domain. One of them is cylindrical, how to construct for the cylindrical particles in the yade?

Another Questio is How do I create a cloud os cylinders?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Ed Carlos Alves Rocha
Solved:
Last query:
Last reply:

This question was reopened

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

Hello,

> I'm new to Yade

welcome :-)

Unfortunately, there is not (yet) cylindrical particle (meaning "sharp" cylinder) implemented. Instead of one cylindrical particle, you can use a set of clumped spheres approximating a cylinder.

If you choose this option, see e.g. [1] how to make clouds.

cheers
Jan

[1] https://answers.launchpad.net/yade/+question/403901

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#2

Hi,

yade has also cylinders with rounded edges. Not sure what exactly you are after but have a look here:

https://github.com/yade/trunk/tree/master/examples/cylinders

HTH
Klaus

Revision history for this message
Ed Carlos Alves Rocha (ed.rocha) said :
#3

I did the Cylinder example, however, I do not know give the imput of collision detection for this example. Can you take a look and see what impact collision between the cylinders and the wall?

Thank you very much for your attention.

from yade.gridpfacet import *

#### Parameter ####
L=1. # length of the cylinder element
r=0.1 # radius of the cylinder element
phi=30. # friction angle
E=1e6 # Young's modulus

idCana=O.materials.append(FrictMat(young=3.4e6,poisson=.3,frictionAngle=.6, density=4.5e2,label="cana"))
idSteel=O.materials.append(FrictMat(young=210e9,poisson=.25,frictionAngle=.8,density=7.85e3,label="steel"))

O.bodies.append(geom.facetBox((0,0,0),(3,3,3),wallMask=31,material="steel" ))

#### Engines ####
O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_GridConnection_Aabb(),Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(), Bo1_Wall_Aabb()]),
 InteractionLoop([
  Ig2_GridNode_GridNode_GridNodeGeom6D(),
  Ig2_GridConnection_GridConnection_GridCoGridCoGeom(),
  Ig2_Sphere_Sphere_ScGeom(),
  Ig2_Facet_Sphere_ScGeom(),
Ig2_Wall_Sphere_ScGeom()
 ],
 [
        Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True),
  Ip2_FrictMat_FrictMat_FrictPhys()],
 [
        Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),
  Law2_ScGeom_FrictPhys_CundallStrack(),
  Law2_ScGridCoGeom_FrictPhys_CundallStrack(),
  Law2_GridCoGridCoGeom_FrictPhys_CundallStrack()
     ]),
 NewtonIntegrator(gravity=(-0.,0,-10),damping=0.5,label='newton'),
]

#### Creat materials ####
O.materials.append( CohFrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),normalCohesion=1e10,shearCohesion=1e10,momentRotationLaw=True,label='cMat' ) ) # material to create the gridConnections
O.materials.append( FrictMat( young=E,poisson=0.3,density=1000,frictionAngle=radians(phi),label='fMat' ) ) # material for general interactions

#### Create cylinders ####
nodesIds=[]
cylIds=[]
cylinder((0,0,0),(L,0,0),radius=r,nodesIds=nodesIds,cylIds=cylIds,
     fixed=False,color=[1,0,0],intMaterial='cMat',extMaterial='fMat')
cylinder((L/4,2*L/3,L),(L/4,-L/3,L),radius=r,nodesIds=nodesIds,cylIds=cylIds,
     fixed=False,color=[0,1,0],intMaterial='cMat',extMaterial='fMat')
cylinder((0,2*L/3,L),(0,-L/3,L),radius=r,nodesIds=nodesIds,cylIds=cylIds,
     fixed=False,color=[0,1,0],intMaterial='cMat',extMaterial='fMat')
cylinder((L/2,L/2,L),(L/2,-L/2,L),radius=r,nodesIds=nodesIds,cylIds=cylIds,
     fixed=False,color=[0,1,1],intMaterial='cMat',extMaterial='fMat')
cylinder((3*L/4,L/3,L),(3*L/4,-2*L/3,L),radius=r,nodesIds=nodesIds,cylIds=cylIds,
     fixed=False,color=[0,0,1],intMaterial='cMat',extMaterial='fMat')
cylinder((L,L/3,L),(L,-2*L/3,L),radius=r,nodesIds=nodesIds,cylIds=cylIds,
     fixed=False,color=[0,0,1],intMaterial='cMat',extMaterial='fMat')

#### For viewing ####
from yade import qt
qt.View()
Gl1_Sphere.stripes=True

#### Set a time step ####
O.dt=1e-06

#### Allows to reload the simulation ####
O.saveTmp()

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#4

Use PFacets instead of Facets, see [1] for example.

HTH
Klaus

[1] https://github.com/yade/trunk/blob/master/examples/cylinders/mikado.py

Revision history for this message
Ed Carlos Alves Rocha (ed.rocha) said :
#5

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

Revision history for this message
Ed Carlos Alves Rocha (ed.rocha) said :
#6

I have another problem. I would like to construct a flow of coupled sphere particles.. In Yade has the example of the spheres factory. However, what is the mechanics of the yade where I can build an injection of particles of coupled spheres?

shotsId,steelId=O.materials.append([
 FrictMat(young=50e9,density=6000,poisson=.2,label='shots'),
 FrictMat(young=210e9,density=7800, poisson=.3,label='steel'),
])
## same as
#
# shotsId,steelId=O.materials.index('shots'),O.materials.index('steel')
#

O.bodies.append(geom.facetBox(center=(0,0,0),extents=(30e-3,30e-3,0),wallMask=32,wire=False,material='steel',color=(0,1,.3)))

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()],verletDist=.05*.29e-3),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_MindlinPhys(
   # define restitution coefficients between different pairs of material ids, see the functor's documentation for details
   #en=MatchMaker(fallback='zero',matches=((steelId,shotsId,.4),(shotsId,shotsId,1)))
   en=MatchMaker(matches=((steelId,shotsId,.4),(shotsId,shotsId,1)))
  )],
  [Law2_ScGeom_MindlinPhys_Mindlin(label='contactLaw')]
 ),
 NewtonIntegrator(damping=0),
 ## CircularFactory: disk if length=0 or cylinder if length>0
 #CircularFactory(maxParticles=10000,radius=8e-3,length=16e-3,center=(0,-15e-3,15e-3),rMin=0.28e-3,rMax=0.29e-3,vMin=100,vMax=100,vAngle=0,massFlowRate=100./60,normal=(0,1.5,-1),label='factory',materialId=shotsId),
 ## BoxFactory: a line, plane or cuboid
 BoxFactory(maxParticles=10000,extents=(8e-3,8e-3,8e-3),center=(0,-15e-3,15e-3),rMin=0.28e-3,rMax=0.29e-3,vMin=100,vMax=100,vAngle=0,massFlowRate=100./60,normal=(0,1.5,-1),label='factory',materialId=shotsId),
 DomainLimiter(lo=(-30e-3,-30e-3,0),hi=(30e-3,30e-3,60e-3),iterPeriod=200),
 #VTKRecorder(recorders=['spheres','facets','velocity'],fileName='/tmp/nozzle-',iterPeriod=500),

 # run this every once in a while, to finalize the simulation at some point
 PyRunner(iterPeriod=10000,command='if factory.numParticles>=factory.maxParticles: O.stopAtIter=O.iter+8000; timing.stats()')
]
# the timestep must be smaller because of high linear velocities of particles
# we cannot use PWaveTimeStep directly, since there are no spheres generated yet
O.dt=SpherePWaveTimeStep(factory.rMin,O.materials[factory.materialId].density,O.materials[factory.materialId].young)
O.saveTmp()
#O.timingEnabled=True
from yade import timing
try:
 from yade import qt
 # setup 3d view
 v=qt.View()
 v.upVector=(0,0,1); v.viewDir=(-1,0,-.3); v.center(median=False)
except ImportError: pass
O.run()

Revision history for this message
Ed Carlos Alves Rocha (ed.rocha) said :
#7

Thanks Klaus Thoeni, that solved my question.

Revision history for this message
Ed Carlos Alves Rocha (ed.rocha) said :
#8

I have another problem. I would like to construct a flow of coupled sphere particles.. In Yade has the example of the spheres factory. However, what is the mechanics of the yade where I can build an injection of particles of coupled spheres?
shotsId,steelId=O.materials.append([
 FrictMat(young=50e9,density=6000,poisson=.2,label='shots'),
 FrictMat(young=210e9,density=7800, poisson=.3,label='steel'),
])
## same as
#
# shotsId,steelId=O.materials.index('shots'),O.materials.index('steel')
#

O.bodies.append(geom.facetBox(center=(0,0,0),extents=(30e-3,30e-3,0),wallMask=32,wire=False,material='steel',color=(0,1,.3)))

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()],verletDist=.05*.29e-3),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_MindlinPhys(
   # define restitution coefficients between different pairs of material ids, see the functor's documentation for details
   #en=MatchMaker(fallback='zero',matches=((steelId,shotsId,.4),(shotsId,shotsId,1)))
   en=MatchMaker(matches=((steelId,shotsId,.4),(shotsId,shotsId,1)))
  )],
  [Law2_ScGeom_MindlinPhys_Mindlin(label='contactLaw')]
 ),
 NewtonIntegrator(damping=0),
 ## CircularFactory: disk if length=0 or cylinder if length>0
 #CircularFactory(maxParticles=10000,radius=8e-3,length=16e-3,center=(0,-15e-3,15e-3),rMin=0.28e-3,rMax=0.29e-3,vMin=100,vMax=100,vAngle=0,massFlowRate=100./60,normal=(0,1.5,-1),label='factory',materialId=shotsId),
 ## BoxFactory: a line, plane or cuboid
 BoxFactory(maxParticles=10000,extents=(8e-3,8e-3,8e-3),center=(0,-15e-3,15e-3),rMin=0.28e-3,rMax=0.29e-3,vMin=100,vMax=100,vAngle=0,massFlowRate=100./60,normal=(0,1.5,-1),label='factory',materialId=shotsId),
 DomainLimiter(lo=(-30e-3,-30e-3,0),hi=(30e-3,30e-3,60e-3),iterPeriod=200),
 #VTKRecorder(recorders=['spheres','facets','velocity'],fileName='/tmp/nozzle-',iterPeriod=500),

 # run this every once in a while, to finalize the simulation at some point
 PyRunner(iterPeriod=10000,command='if factory.numParticles>=factory.maxParticles: O.stopAtIter=O.iter+8000; timing.stats()')
]
# the timestep must be smaller because of high linear velocities of particles
# we cannot use PWaveTimeStep directly, since there are no spheres generated yet
O.dt=SpherePWaveTimeStep(factory.rMin,O.materials[factory.materialId].density,O.materials[factory.materialId].young)
O.saveTmp()
#O.timingEnabled=True
from yade import timing
try:
 from yade import qt
 # setup 3d view
 v=qt.View()
 v.upVector=(0,0,1); v.viewDir=(-1,0,-.3); v.center(median=False)
except ImportError: pass
O.run()

Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#9

Please open a new question as it is not related to your first question! Also, be more specific what you mean by coupled (clump?).

Klaus

Revision history for this message
Ed Carlos Alves Rocha (ed.rocha) said :
#10

Thank you Klauss. I'm going to oppen new question.
Yes a Clump. I am going to open a new question, ie, a sphere factory or injector, for example, a flow of 4 sphere clump.