Asked by Chien-Cheng Hung on 2021-01-14

Dear all,

I am trying to create a packing with log-normal particle size distribution.
I use yade.utils.psd  and  to check if the size distribution of the packing is consistent with the values I give.
It turns out that method  says yes, but method  says no. I am quite sure that the method  is the right way to calculate the particle size distribution. So I was wondering what exact parameter that yade.utils.psd  returns, especially the one called "binsProc"  which is named "bp" in the MWE.
Thanks!

###

import numpy as np
import pylab
import matplotlib.pyplot as plt

mean = 2.2
stddev = 1.2

psdSizes = np.linspace(62.5, 500, 50)
pdf=[(1/x)*math.exp(-((np.log(x-mean))**2/(stddev*2)**2)) for x in psdSizes]
cdf=np.cumsum(pdf,axis=0)
psdCumm = cdf/max(cdf)
psdCumm = 0
psdCumm[-1] = 1
sp.makeCloud((0,0,0),(5000,5000,5000),psdSizes=psdSizes,psdCumm=psdCumm, seed=1)
sp.toSimulation()

def getDiameterArray():
diameter=[]
for b in O.bodies:
if isinstance(b.shape,Sphere):
return diameter

diameter = getDiameterArray()
values, base = np.histogram(diameter, bins=50)
cumulative = np.array(np.cumsum(values),dtype=float)
perc = cumulative/max(cumulative)

pylab.plot(psdSizes,psdCumm,color="b")
pylab.plot(base[:-1],perc,color="r")
pylab.plot(br,bp,color="g")
pylab.xlabel("particle size")
pylab.ylabel("Cumulative particle density")
pylab.show()

###

Cheers,
Chien-Cheng

## Question information

Language:
English Edit question
Status:
Open
For: