← Back to team overview

yade-users team mailing list archive

Re: [Question #706748]: Calculation in Marshall Mix Design

 

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

    Status: Open => Needs information

Jan Stránský requested more information:
Hello,

Please provide a MWE [1].
I.e. for porosity calculation, you do not need to run whole gravity deposition and compaction.

Create a cylinder, a top wall and a few spheres inside.
As an advantage, you can calculate all the results simply by hand and compare to the script results.

> whether I set something wrong or my formula is inccorect?

What is meant by "bulk" and "air"? Spheres are "bulk" or "air"?

For volume and number, you should probably exclude spheres that jumped out of the container.
Or prevent jumping entirely.

>        # calculate the volume of the packing
>        volume_packing = 0
>        num_spheres = 0
>        for b in O.bodies:
>            if isinstance(b.shape, yade.wrapper.Sphere):
>                volume_packing += 4/3 * math.pi * b.shape.radius**3
>                num_spheres += 1

Just a note (not important, result is the same): a more "pythonic" (and perhaps more readable and maintainable way) would be:
###
num_spheres = len([b for b in O.bodies if isinstance(b.shape,Sphere)])
volume_packing = sum(4/3 * math.pi * b.shape.radius**3 for b in O.bodies if isinstance(b.shape, Sphere))
###

Cheers
Jan

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

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