makecloud in Cylinder

Asked by jamespaul

Hi,

 I want to generate particles in a cylinder.My method is

#################
Cylinder=O.bodies.append(geom.facetCylinder(center=(0.0,0.0,0.0),radius=0.18,height=1,wallMask=7,color=(1,0,0)))
sp=SpherePack()
sp.makeCloud(minCorner=(-0.2,-0.2,-0.1),maxCorner=(0.2,0.2,0.2),rMean=.0045,periodic=False)
sp.toSimulation()
#################

Then the particles settle down.But I think its not perfect.

Is there any way I can fill this cylinder directly when I generate particles.

Thanks,

James

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
jamespaul
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

Your script does not seem to include anything that would generate directly the particles within the cylinder. You may have a look at https://yade-dem.org/doc/user.html#sphere-packings (the Constructive Solid Geometry (CSG) section in particular)

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

Thanks Jérôme Duriez,

Maybe I didn't make myself clear.

Maybe there is a way to fill the geometry with spheres instead of generate sphere in a cubic.

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

Hello,

makeCloud always generates cubic packing. You can now then use e.g. filterSpherePack:
###
sp = pack.SpherePack()
sp.makeCloud((0,0,0),(2,2,2),rMean=.1,num=400)
cyl = pack.inCylinder((1,1,0),(1,1,2),1)
sp = pack.filterSpherePack(cyl,sp,True)
sp.toSimulation()
###

or use different method (e.g. pack.randomDensePack, self-made method, ...). It depends on your needs and requirements.

cheers
Jan

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

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

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

Thanks Jan,

1.I used inCylinder.But after I read the document,I found it couldn't add a orientation in inCylinder to match my cylinder.

2.My target is to fill half of the drum after the particles have settled.So I need generate enough particles.I studied BoxFactory,but I think it is not a good method.My idea is:I keep producing particles in a virtual region until reach a certain number.I found maybe
[1] can achieve this function but overridden SpheresFactory::pickRandomPosition() is too difficult to me.Could you give me some idea?

[1]https://yade-dem.org/doc/yade.wrapper.html?highlight=spheresfactory#yade.wrapper.SpheresFactory

James

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

> I used inCylinder.But after I read the document,I found it couldn't add a orientation in inCylinder to match my cylinder.

please be more specific what "the document" is.
By centerBottom and centerTop arguments, you can set any orientation to the cylinder [1]..

> My target is to fill half of the drum after the particles have settled

You can consider using a different methods, e.g.:

- pack.randomDensePack (seeJerome's answer #1 and the note about CSG)
###
cyl = pack.inCylinder((0,0,0),(2,0,0),1)
box = pack.inAlignedBox((0,-1,0),(2,1,1))
pred = cyl - box # final predicate
sphs = pack.randomDensePack(pred,radius=0.05,spheresInCell=300)
O.bodies.append(sphs)
###

- gravity deposition in "half-cylinder" and then using that packing
###
cyl = geom.facetCylinder((0,0,0),1,2,Quaternion((0,1,0),.5*pi),24)
cyl = [f for f in cyl if f.state.pos[2] < 0] # "half-cylinder"
O.bodies.append(cyl)
sp = pack.SpherePack()
sp.makeCloud((-1,-1,0),(1,1,3),rMean=0.1,num=300) # set 'num' to meet your requirements
sp.toSimulation()
newton.gravity = (0,0,-10)
# O.run()
###

the codes are some minimal examples to point you what other methods may be used..

cheers
Jan

[1] https://yade-dem.org/doc/yade.pack.html#yade._packPredicates.inCylinder

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

You really helped me a lot. Thanks Jan.Thank you so much.

James

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

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

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

Hi Jan,

I still have some questions about randomDensePack:

>If I use

  sphs = pack.randomDensePack(pred,radius=0.05,spheresInCell=300)

  I calculated the number of spheres and about 1200.It is different from spheresInCell=300.

>So I went to the document to see the meaning of spheresInCell.

In the document[1]:spheresInCell – if given, the packing will be periodic, with given number of spheres in the periodic cell.Is the process of particle formation periodic boundary, or is it periodic boundary when it runs?And why 1200>given number of spheres?

>I adjusted the spheresInCell=200.And went wrong.

Unable to shring cell due to maximum body size (although required by stress condition). Increase particle rigidity, increase total sample dimensions, or decrease goal stress.

[1]https://yade-dem.org/doc/yade.pack.html?highlight=randomdensepack#yade.pack.randomDensePack

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

spheresInCell means that first a small packing is created by periodic compression (which is usually "very fast") and then this "small cube" is copied and cropped wherever needed for actual packing.
I usually use value between 500 and 2000
Jan

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

Thanks Jan