woo

Setting and Retrieving Clump Orientation

Asked by Simon Gibbon

I want to generate a cloud of 2 different clumps, the first will be plates that I would like to be able to fix the orientation of and the second set of clumps will have random orientations.

How do I fix the orientation of a set of clumps?

I have tried setting the ori parameter in SphereClumpGeom, but I still get randomly orientated clumps.

generators=[
 PsdClumpGenerator(psdPts=[(.15,0),(.25,1.)],discrete=False,mass=True,
  clumps=[
                  SphereClumpGeom(centers=plate_centres,
                                           radii=plate_radii,
                                           ori=Quaternion((1,0,0),pi/2),
                                           scaleProb=[(0,1.)]),
                  SphereClumpGeom(centers=[(.05,0,0) ,(0,.05,0) ,(0,0,.05)],
                                           radii=(.05,.05,.05),scaleProb=[(0,.5)]),
  ],
 ),
]

How do I retrieve the orientation of clumps from my particles?

Thanks, Simon

Question information

Language:
English Edit question
Status:
Answered
For:
woo Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Václav Šmilauer (eudoxos) said :
#1

Hi,

I will have to think how to extend the current interface so that this is possible -- particles from generators are always oriented randomly. One option would be to traverse nodes (S.dem.nodes), filter out only those who are associated with your clumps, and set orientation of those -- easy if you can distinguish them by the number of attached particles. Could you post the whole script (or a minimal working example) so that I could try that? From the top of my head, something like this would do:

for n in S.dem.nodes:
   if not n.dem.clump or len(n.dem.nodes)<=3: continue # skip nodes which are not clumped, or the clump has less than 4 nodes
   n.dem.ori=Quaternion.Identity

the problem is obviously that the clumps might be overlapping, which is probably not what you want.

I think adding some orientation flag (random/constant) would be useful, right? All the rest would just work automatically. What do you think?

Cheers, Václav

Revision history for this message
Simon Gibbon (simon-gibbon) said :
#2

Václav,

Complete code below, currently not very complex, just filling a box and then settling particles under gravity, next step is to compress particles from above gently without effect of gravity.

Orientation flag would be really nice, as increasing aspect ratio tends to mean that particles orientate in a flow direction, and I could prove this by doing the flow with Woo I guess, but even when I work out how to it, still rather computationally intensive.

I should able to

Thanks, Simon

import woo
from woo.dem import *
from woo.fem import *
from woo.core import *
from random import random as rnd
from woo import pack

import woo.log, woo.utils
from minieigen import *
from math import *

plate_centres = []
plate_radii = []
for i in range(0, 8):
   for j in range(0, 8):
       plate_centres.append((0,i * .05, j * .05))
       plate_radii.append(.05)

generators=[
 PsdClumpGenerator(psdPts=[(.15,0),(.25,1.)],discrete=False,mass=True,
  clumps=[
                  SphereClumpGeom(centers=plate_centres,
                                           radii=plate_radii,
                                           ori=Quaternion((1,0,0),pi/2),
                                           scaleProb=[(0,1.)]),
                  SphereClumpGeom(centers=[(.05,0,0) ,(0,.05,0) ,(0,0,.05)],
                                           radii=(.05,.05,.05),scaleProb=[(0,.5)]),
  ],
 ),
]

mat=woo.utils.defaultMaterial()

S=woo.master.scene=Scene(
      engines=woo.utils.defaultEngines(damping=.4,dynDtPeriod=10)+
      [IntraForce([In2_Wall_ElastMat()])]+
      [BoxInlet(box=((0,0,0),(4,4,4)),stepPeriod=100,maxMass=1e4,nDo=1,maxNum=-1,
                massRate=0,maxAttempts=50000,attemptPar=50,atMaxAttempts=BoxInlet.maxAttWarn,
                generator=generators[i],materials=[mat]) for i in range(len(generators))],
 fields=[DemField(
  gravity=(0,0,-10),
            loneMask=0,
 )],
)

S.dem.par.add([
 Wall.make(0,sense=1,axis=2,mat=mat),
 Wall.make(0,sense=1,axis=1,mat=mat),
 Wall.make(4,sense=-1,axis=1,mat=mat),
 Wall.make(0,sense=1,axis=0,mat=mat),
 Wall.make(4,sense=-1,axis=0,mat=mat)
])

S.saveTmp()
S.one()

Revision history for this message
Václav Šmilauer (eudoxos) said :
#3

Alright, so I added PsdClumpGenerator.oris and PsdClumpGenerator.oriFuzz (https://woodem.eu/doc/woo.dem.html#woo.dem.PsdClumpGenerator.oris) so that you can influence orientation of different clumps. I am not very satisfied with that, it works, but is conceptually not clean, but I don't have time right now to generalize this to all inlets, so let's stay with this. You need r3745-git-e039795 for that to work.

You add these two parameters to PsdClumpGenerator, to make the first clump (the flakes) oriented (with some fuzz) and leave the other one completely random:

PsdClumpGenerator(psdPts=...,clumps=[...], oris=[Quaternion((0,1,0),pi/2)], oriFuzz=[.3])

I also added a new function Wall.makeBox, so you can replace the end by this (it will properly set sense and axis for all the walls you want):

S.dem.par.add(Wall.makeBox(box=AlignedBox3((0,0,0),(4,4,4)),which=(1,1,1,1,1,0),mat=mat))

It would be much more efficient (regarding the computation afterwards -- 2 particles instead of 49) to model those flakes by facets (clump of two triangles, giving rounded square), but that is something there is no generator for (yet).

If you use package from the PPA, you may have to wait a few hours before the package lands.

Let me know if it works for you.

Cheers!

Václav

Can you help with this problem?

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

To post a message you must log in.