How to get a volume of a clump using makeClumpCloud?

Asked by Justin

I would like to collect the volume of each clump. If I were to use the example code below, what would I need to call to get the volume of that clump?

Example Code:
clp1 = SpherePack([((sphereRadius,0,0), sphereRadius), ((0,sphereRadius,0), sphereRadius), ((0,0,sphereRadius), sphereRadius), \
       ((sphereRadius,sphereRadius,0), sphereRadius), ((sphereRadius,0,sphereRadius), sphereRadius), ((0,sphereRadius,sphereRadius), sphereRadius)]) # The clump we want a cloud of
sp = SpherePack()
sp.makeClumpCloud((-0.010,-0.090,-0.010),(0.010,0.49,0.010), [clp1], num=1, seed=42)
sp.toSimulation(color=(0.51,0.52,0.4),material='rubber')

Thanks,
Justin

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

I think adding

vol = O.bodies[-1].state.mass / O.materials['rubber].density # hard to test by myself with this sort of non-working minimal script ;-)

will give you in "vol" the volume of that clump, as considered by YADE in your workflow.

Since your clump looks to involve overlapping members, note though this volume value is wrong. Having a correct value would require to include "discretization" considerations [*] and maybe another kind of YADE workflow

[*] see https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.BodyContainer.clump

Revision history for this message
Justin (justin-l-rittenhouse) said :
#2

Thanks for the reply, and my bad on the MWE. I assumed there was a .GetVolume command or something I was over looking. I'll use real MWE on future posts. :)

I didn't realize Yade did not auto adjust the mass and volume for overlapping clumps. With these artificially inflated values (e.g., mass and volume), I fear the DEM model could be losing the real physics behind the real physical system (i.e., lab experiments). Or, however, since density is preserved, inflated values for mass and volume should have little impact on maintaining the real physics behind the real physical system?

What are your thoughts on that?

Thanks,
Justin

Revision history for this message
Jan Stránský (honzik) said :
#3

Hello,

> I'll use real MWE on future posts. :)

why not already this post?

> what would I need to call to get the volume of that clump?

It depends on the definition of "volume of that clump".
Just sum of component volume?
For overlapping components, their union?
"Convex hull " of the components?
... ?

So first you need to do is your definition of clump volume.

> I didn't realize Yade did not auto adjust the mass and volume for overlapping clumps.

it "auto adjust" mass.

Volume is tricky and difficult (see above, mere definition is ambiguous), left for the user if needed (i.e. it is not computed at all).

> With these artificially inflated values (e.g., mass and volume), I fear the DEM model could be losing the real physics behind the real physical system (i.e., lab experiments).

Yade computes what it is given.
If you give Yade "inflated values", then it simply computes with those values.

> Or, however, since density is preserved, inflated values for mass and volume should have little impact on maintaining the real physics behind the real physical system?

The impact might be from none to significant, depending on actual situation.
See below for a solution if you are afraid / the impact is actually significant.

====

Clump creation does some computation automatically.
However, you can manually set mass and/or inertia of the final clump independently of the original components and their properties.
You can also "pre-adjust" mass of individual components such that the resulting auto-computed mass and inertia are what you expect.
(E.g. you know the final mass should be XY, you set mass of components such that their sum is XY)

Cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask Justin for more information if necessary.

To post a message you must log in.