← Back to team overview

yade-users team mailing list archive

Re: [Question #704065]: particle size distribution

 

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

Karol Brzezinski proposed the following answer:
Hi,

First of all, please remember to create MVE to support your question, to save some time for people who are trying to help you [1].
Secondly, note that particle size in psdSizes should be provided as diameters - not radii (hence you need to double the values).

There are multiple ways to solve your problem.
1) If you know the exact number of particles you can simply run makeCloud() twice, before appending particles to simulation;

from yade import pack

sp = pack.SpherePack()

sp.makeCloud((0,0,0),(0.05,0.05,0.05), rMean = 0.002, num = 80)
sp.makeCloud((0,0,0),(0.05,0.05,0.05), rMean = 0.001, num = 20)

sp.toSimulation()

2) The makeCloud() method is rather dedicated to continuous size
distributions. But you can pass a "stepwise" distribution:

from yade import pack

psdSizes = [0.002,0.002,0.004,0.004]# you have to pass here diameter, not radius
psdCumm = [0,0.2,0.2,1.0]

sp = pack.SpherePack()

sp.makeCloud((0,0,0),(0.05,0.05,0.05), psdCumm = psdCumm, psdSizes =
psdSizes, distributeMass = False)

sp.toSimulation()

# Note, that this "trick" doesn't work very well with distributeMass =
True. In the example above, the NUMBER of smaller particles is 20% of
the total number of particles.

3) I had to "manually" compute the proper content to obtain the
prescribed mass distribution. Modification of the above example is as
follows:

from yade import pack

massContentOfSmallerParticles = 0.2
smallRadius = 0.001
bigRadius = 0.002

volumeProportion = (bigRadius/smallRadius)**3
tmpNumberOfSmallerParticles = massContentOfSmallerParticles*volumeProportion
tmpNumberOfBiggerParticles = 1-massContentOfSmallerParticles
tmpTotalNumber = tmpNumberOfSmallerParticles+tmpNumberOfBiggerParticles

newContentOfSmallerParticles = tmpNumberOfSmallerParticles /
tmpTotalNumber


psdSizes = [smallRadius*2,smallRadius*2,bigRadius*2,bigRadius*2]# you have to pass here diameter not radius
psdCumm = [0,newContentOfSmallerParticles,newContentOfSmallerParticles,1.0]

sp = pack.SpherePack()

sp.makeCloud((0,0,0),(0.1,0.1,0.1), psdCumm = psdCumm, psdSizes =
psdSizes, distributeMass = False)

sp.toSimulation()

#### just checking the distribution
smallerParticlesMass = 0
biggerParticlesMass = 0
otherParticlesMass = 0

for b in O.bodies:
    r = b.shape.radius
    m = b.state.mass
    if r == smallRadius:
        smallerParticlesMass += m
    elif r == bigRadius:
        biggerParticlesMass += m
    else:
        otherParticlesMass += m

totalMass = smallerParticlesMass + biggerParticlesMass +
otherParticlesMass

print("Content of particles with radius r = {:.3f} equals {:.1f}%
[m/m].".format(smallRadius,100*smallerParticlesMass/totalMass))


Cheers,
Karol

[1] https://www.yade-dem.org/wiki/Howtoask

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