# Clumping

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"

Seti

here is the script:

# create a few clump configurations by hand
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
#color=(1,0,0) ----red color
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
# 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
O.save('Clump.txt.bz2')

## Question information

Language:
English Edit question
Status:
For:
Assignee:
No assignee Edit question
Last query:
2015-08-18
2015-08-18
 Christian Jakob (jakob-ifgt) said on 2015-08-18: #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

 Jan Stránský (honzik) said on 2015-08-18: #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