Porosity of a packing with overlapped particles

Asked by Huihuang Xia

Hi,

I defined a function to calculate the porosity of a packing with lots of overlapped particles, because the build-in function "utils.porosity()" always got a negative one. This question (https://answers.launchpad.net/yade/+question/404363) gave me some useful hints.

My own function has a serious error, that is my function always got a same porosity whatever the growFactor is. Here is my code segment:

from yade import utils
from yade import pack
from yade import qt

mat1 = O.materials.append(FrictMat(young=5.0e7,poisson=0.25,density=2640.0,frictionAngle=radians(18)))
pred = pack.inAlignedBox((0,0,0),(0.01,0.01,0.01))
dim = pred.dim()
packing = regularHexa(pred, radius=0.0005,gap=0,material=mat1)
O.bodies.append(packing)

# grow particles in order to get lower porosity
growFactor = 1.5
utils.growParticles(growFactor)

def overlappedPorosity(totVol,density):
 totVol = dim[0]*dim[1]*dim[2]
 mass = sum([b.state.mass for b in O.bodies])*pow(growFactor,-3)
 return (totVol - mass/density)/totVol
print 'The porosity of this packing is:',overlappedPorosity(dim[0]*dim[1]*dim[2],O.materials[0].density)

# 3D view and controller
try:
  qt.Controller()
  qt.View()
except:
  pass

In my function, ''mass = sum([b.state.mass for b in O.bodies])*pow(growFactor,-3)'', because after the packing was generated, the radius of each particle in packing was magnified by growFactor using growParticles.

Any useful advice will be highly appreciated.
Thanks in advance,

Huihuang Xia

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Klaus Thoeni
Solved:
Last query:
Last reply:
Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#1

Hi,

you should use utils.voxelPorosity [1] instead of utils.porosity(), this works fine for overlapping particles.

HTH
Klaus

[1] https://yade-dem.org/doc/yade.utils.html?highlight=voxelporosity#yade._utils.voxelPorosity

Revision history for this message
Huihuang Xia (huihuangxia) said :
#2

Thanks Klaus,

I have tried your method, this approach works really good. Here is another question, Can I use this method to calculate the porosity of an irregular packing? Choosing a sub-volume from a irregular packing can give a result as precise as the whole volume?

FW your reply,
regards,

Huihuang

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

Depending on how your packing is arranged, a sub-volume might give satisfactory results. You could try many sub-volumes to verify.

Klaus

Revision history for this message
Huihuang Xia (huihuangxia) said :
#4

Hi Klaus,

Thanks for your patience.
I have selected two diverse cubic sub-volumes in my irregular packing, but they got a porosity of 1.0

Huihuang Xia

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

Well, are you sure you selected the right volume? Make sure you use the methods the right way and set the right parameters. Without seeing your script I can't give any further advice.

Klaus

Revision history for this message
Huihuang Xia (huihuangxia) said :
#6

Thanks Klaus Thoeni, that solved my question.