Welcome to ask.woodem.org. You may post when you login through your GitHub account.

Control exact size of capsules

0 votes
asked Nov 16, 2017 by Student74 (220 points)
I'm using the PsdCapsuleGenerator to generate capsules to fill a column, and I am able to use the shaftRadiusRatio function to control the distribution of shaft to radius ratios, but I would like to be able to control the exact sizes (so length and radius in metres) for the particles. I actually want to fill a column with particles of the same size, so I put the shaftRadiusRatio vector on (3,3) to obtain monodispersed particle sizes. Now I want to know the exact sizes of the capsules and I would like to be able to put values for the radius and shaft length in metres myself. Is there a possibility to do this?

1 Answer

0 votes
answered Nov 16, 2017 by eudoxos (49,070 points)

Hi, do you want all capsules to be the same? Then simply prescribe the PSD function stepwise, something like psdPts=[(5e-3,0),(5e-3,1)] should work, and by hand calculate the shaftRadiusRatio, e.g. (2,2) will make all capsules with cylinder radius 5mm and (2*5mm shaft + 2*5mm on either side) = 20mm long end-to-end. Let me know if this answers your question. All the best, Vaclav.

commented Nov 17, 2017 by Student74 (220 points)

Dear Vaclav,

Thank you for your answer! Yes I want them to be the same, which I already managed to do. However I couldn't find an option inside the generator to specify the dimensions, but the way to do it in this case is via the ShaftRadiusRatio? Then how do you know that the radius is 5mm, is that because of the first number in the psdPts?
Also, is it possible to somehow check these dimensions, so writing out the dimensions of the generated particles after the simulation?

It would make sense for me to somehow be able to specify the whole particle somewhere (so shape, material, density, dimensions) and then generate numbers of those particles to fill the column. However these specifications are somehow included in the PsdCapsuleGenerator I think, but how does this work exactly?

For easy reference, I will show you the code I am currently running below. I was also looking at an option to let all particles settle before ending the simulation, because before it just stopped somewhere in the middle while still generating new particles. I put maxNum on 1000 for this purpose, but I would rather like to tell the code something like: wait some time after generating the particles to let them all settle and after that end the simulation. Would this be easily possible?

Thanks in advance for answering all my questions! See the code below:

import woo.core, woo.dem, woo.utils, math, woo.paraviewscript
from minieigen import *
# add bottom and cylinder walls
generator=woo.dem.PsdCapsuleGenerator(psdPts=[(.2,0),(.2,1)], shaftRadiusRatio=(3,3))
woo.core.PyRunner('ubf=woo.utils.unbalancedForce(S)\nprint(ubf)\nif ubf<.05 and S.step>1000: done(S)',400),

def done(S):
with open('capsules.txt','w') as out:
for p in S.dem.par:
if not isinstance(p.shape,woo.dem.Capsule): continue
out.write('%g %g %g %g %g %g\n'%(a[0],a[1],a[2],b[0],b[1],b[2]))
vtk(S) # trigger manually writing Paraview data files
# write paraview script and run it