Clumping

Asked by Seti on 2015-08-18

Hi all,

Now, I am trying to study what is the effect of clumping on repose angle( the angle of accumulated spheres after falling done because of gravity) . for this purpose I need to do parametric study which shows the effect of clumping ratio on repose angle ( e.g. 25%, 50%,..... clumping of total spheres)

I have done very simple modification on my basic script, I know how clump all ( 100%) of the spheres.
however my questions are:

1- How should I modify the script in order to change of clumping ratio.
2- When I run the script , I face with this error " name 'checkUnbalanced' is not defined"

Thanks for your advices in advance.
Seti

here is the script:

# create a few clump configurations by hand
from yade import pack
c1=pack.SpherePack([((0,0,0),.5),((.5,0,0),.5),((0,.5,0),.5)])
#c2=pack.SpherePack([((0,0,0),.5),((.7,0,0),.3),((.9,0,0),.2)])

#create material
soil1 = CohFrictMat(young=1e10,poisson=0.2,frictionAngle=radians(15),density=2500.0,normalCohesion=1e6, shearCohesion=80e6,label='soil')
#color=(1,0,0) ----red color
#soil1 = FrictMat(young=1e6,poisson=0.4,frictionAngle=radians(30),density=2500.0,label='soil')
O.materials.append(soil1)

sp=pack.SpherePack()
print 'Generated # of clumps:',sp.makeClumpCloud((0,0,0),(20,20,200),[c1],periodic=True)

sp.toSimulation()
O.bodies.append(utils.wall(0,axis=2,sense=1))
O.materials.append(CohFrictMat(young=1e9,poisson=0.1, frictionAngle = radians(15) , label='wallmat'))
wallmat = O.materials[-1]
#O.bodies.append(utils.wall(position=0,axis=2))

O.engines=[
 #SubdomainBalancer(),
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Wall_Sphere_ScGeom()],
  [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
  [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),Law2_ScGeom_FrictPhys_CundallStrack()]
 ),
 NewtonIntegrator(damping=.4,gravity=(0,0,-9.8)),
 PyRunner(command='checkUnbalanced()',realPeriod=2,label='checker'),
]
O.dt=.7*utils.PWaveTimeStep()
O.saveTmp()
O.step()

def checkUnbalanced():
   if unbalancedForce()<1e-5:
      print('Reached target , stopping')
      O.pause()
#plot.saveDataTxt('modi.data.bz2')
      # plot.saveGnuplot('bbb') is also possible

# collect history of data which will be plotted
def addPlotData():
   # each item is given a names, by which it can be the unsed in plot.plots
   # the **O.energy converts dictionary-like O.energy to plot.addData arguments
   plot.addData(i=O.iter,unbalanced=unbalancedForce(),**O.energy)
O.save('Clump.txt.bz2')

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
2015-08-18
Last reply:
2015-08-18
Christian Jakob (jakob-ifgt) said : #1

Hi,

Just a short answer regarding 1- and 2-:

1- Please have a look at [1]. There is also an example, see [2].

2- I did not test your script. Maybe an indention problem? I hope someone else can help ...

Regards,

Christian

[1] https://yade-dem.org/doc/yade.wrapper.html?highlight=replaceby#yade.wrapper.BodyContainer.replaceByClumps
[2] https://github.com/yade/trunk/blob/master/examples/clumps/replaceByClumps-example.py

Jan Stránský (honzik) said : #2

Hi,

> 2- When I run the script , I face with this error " name 'checkUnbalanced'
> is not defined"
>

Python interpreter goes through the script file line by line and also
execute the lines one after another. When it is finished with line 15 it
goes and interpret line 16.. In your case, when you call O.step() for the
first time, the interpreter (as the error says) does not have any idea what
checkUnbalanced is (because the definition has not been done yet).

Just put O.step() at the end of the file and it should work :-)

cheers
Jan

Can you help with this problem?

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

To post a message you must log in.