How calculate the repose angle

Asked by Seti

I just have written a simple script which just models the falling down of particles because of their weight.. The end of simulation, I need to calculate the repose angle of the accumulated grains ( the angle of triangle which is shaped because of falling grains due to gravity). but I do not have any idea in this issue, would you please instruct me?

Cheers

Seti

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Christian Jakob
Solved:
Last query:
Last reply:
Revision history for this message
Christian Jakob (jakob-ifgt) said :
#1

Hi,

I had the same problem some years ago. I used pythons scatter function for this purpose.
You need to give some input data at the beginning of the script and it should work (not tested).
A scatter-plot window should open and you can get the angle by clicking at two points in the window.
Here is the script:

#!/usr/bin/python
# -*- coding: utf-8 -*-

center_model = Vector3(0,0,0) #put the center of your model here

O.load(yourSaveFile) #put the name of your save file here

outputFilename = 'yourOutputName.out' #put your output filename here

height = []
rad_dist = []
for ii in range(0,len(O.bodies)):
 b = O.bodies[ii]
 if b and isinstance(b.shape,Sphere):
  pos = b.state.pos
  dist_vec = pos - center_model
  rad_dist.append(sqrt( (dist_vec[0])**2 + (dist_vec[1])**2 ))#get radial distance from center axis
  height.append(pos[2]) #get height and write into list

from pylab import *

scatter(rad_dist,height,marker='+')

data_for_angle = ginput(0,0) #get the coordinates by clicking two points, then click on the mouse wheel

zdiff = abs(data_for_angle[0][1] - data_for_angle[1][1]) #y entries of picked points (respectively spheres height)
rdiff = abs(data_for_angle[0][0] - data_for_angle[1][0]) #x entries of picked points (respectively spheres radial distance from center)

alpha = atan(zdiff/rdiff)
alpha = 180*alpha/math.pi #in [°]

'''
 z |-
 d | -
 i | -
 f | ( - <- tan(alpha) = zdiff / rdiff
 f ----------
   rdiff
'''

# print result and write output:
print 'angle of repose is ',alpha,' degree'

f = open(outputFilename,'a')
f.write('result for %s: %.2f degree\n' % (part,alpha))
f.close()
exit()

Revision history for this message
Seti (seti) said :
#2

Hi Christian,

Thank you for your reply, I have run your script. As you have mentioned a scatter-plot window opens however by clicking at points nothing happen.Would you please instruct me in this issue?

Here is my script:
#!/usr/bin/python
from yade import pack,utils#, qt
pred = pack.inAlignedBox((0,0,0),(20,200,20))
#create material
soil1 = CohFrictMat(young=1e10,poisson=0.2,frictionAngle=radians(0),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)
O.bodies.append(utils.wall(0,axis=1,sense=1))
O.materials.append(CohFrictMat(young=1e9,poisson=0.1, frictionAngle = radians(0) , label='wallmat'))
wallmat = O.materials[-1]

spheres=SpherePack()
spheres=pack.randomDensePack(pred,radius=1.1,material='soil',spheresInCell=1000,color=(1,0,0),returnSpherePack=True)
spheres.toSimulation()
#O.bodies.append(spheres)
#

#
O.engines=[
             ForceResetter(),#reset forces
             InsertionSortCollider([Bo1_Wall_Aabb(),Bo1_Sphere_Aabb()]),
             InteractionLoop(
                            [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Wall_Sphere_ScGeom()], # collision geometry
                            [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()], # collision "physics"
                            [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(),Law2_ScGeom_FrictPhys_CundallStrack()] # contact law -- apply forces
                                            ),
                      # apply gravity force to particles
                            # damping: numerical dissipation of energy
                            NewtonIntegrator(damping=0.5,gravity=(0,-9.81,0)),
                            #qt.SnapshotEngine(fileBase='3d-',iterPeriod=200,label='snapshot'),
   # this engine will be called after 20000 steps, only once
                            #PyRunner(command='finish()',iterPeriod=20000)
]

# set timestep to a fraction of the critical timestep
# the fraction is very small, so that the simulation is not too fast
# and the motion can be observed
O.dt=1*utils.PWaveTimeStep()
#makeVideo(snapshot.snapshots,'3d.mpeg',fps=10,bps=10000)
# save the simulation, so that it can be reloaded later, for experimentation
#O.saveTmp()
O.save('Modified.txt.bz2')
#O.save('confinedState'+key+'.yade.gz')
from yade import qt
qt.View()
#O.run()
#from yade import qt
#qt.View()
#O.run()
# this function is called when the simulation is finished
#def finish():
   # snapshot is label of qt.SnapshotEngine
   # the 'snapshots' attribute contains list of all saved files
   #makeVideo(snapshot.snapshots,'3d.mpeg',fps=10,bps=10000)
   #O.pause()

# set parameters of the renderer, to show network chains rather than particles
# these settings are accessible from the Controller window, on the second tab ("Display") as well
#rr=yade.qt.Renderer()
#rr.shape=False

Revision history for this message
Best Christian Jakob (jakob-ifgt) said :
#3

I think you need to click on the mouse wheel ... (as mentioned in the script)

Revision history for this message
Seti (seti) said :
#4

Thanks Christian Jakob , that solved my question. :)

Revision history for this message
Seti (seti) said :
#5

Thanks Christian Jakob, that solved my question.