← Back to team overview

yade-users team mailing list archive

Re: [Question #236167]: How to determine volume of the spheres in psd after deposition

 

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

    Status: Open => Answered

jduriez proposed the following answer:
Hello,

Your question is a small python-yade exercise.
So,
1) to compute the total volume of spheres, do, in yade prompt :
V=0 # variable that should be equal to the desired volume, after following operations. Now initialized to 0

for b in O.bodies: # loop over all bodies of your simulation
     if isinstance(b.shape,Sphere): # check if the body considered is indeed a sphere
          V=V+4.0/3.0*pi*pow(b.shape.radius,3.0) # increment the variable "V" with the volume of this sphere
#blank line suppressing the indentation to execute the loop

Then, let output "V", and enjoy !

2) for the porosity, you will need the volume of your model, maybe you
could deduce it from your script (I do not know), or use aabbExtrema()
yade function. See the doc, or an example in
examples/jointedCohesiveFrictionalPM/gravityLoading.py

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.