New question #631227 on Yade: https://answers.launchpad.net/yade/+question/631227
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 -- You received this question notification because your team yade-users is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp