How to make clumps from spheres
I want to make two-ball clumps from spheres. Would appreciate some help. Thanks.
#rMean is particles size
utils.readParam
from yade.params.table import *
from yade import export,pack, plot
#cylinder
O.materials.
O.bodies.
O.bodies.
#spheres
O.materials.
sp=pack.
sp.makeCloud(
sp.toSimulation
O.engines=[
ForceResetter(),
InsertionSor
InteractionLoop(
[
[
[
),
GravityEngin
NewtonIntegr
# the label creates an automatic variable referring to this engine
# we use it below to change its attributes from the functions called
PyRunner(
]
O.dt=.5*
def checkUnbalanced():
# at the very start, unbalanced force can be low as there is only few contacts, but it does not mean the packing is stable
if O.iter<10000: return
# the rest will be run only if unbalanced is < .1 (stabilized packing)
if utils.unbalance
# add plate at the position on the top of the packing
# the maximum finds the z-coordinate of the top of the topmost particle
#O.bodies.
#m=max(
b = len(O.bodies)
#print "number of bodies",b
#penetrometer
O.materials.
O.bodies.
O.bodies.
O.bodies.
#b = len(O.bodies)
#print "number of bodies2",b
#O.pause()
global plate1,
plate1=
plate2=
plate3=
plate4=
plate5=
plate6=
plate7=
plate8=
plate9=
plate10=
plate11=
plate12=
plate13=
plate14=
plate15=
plate16=
plate17=
plate18=
plate19=
plate20=
plate21=
plate22=
plate23=
plate24=
# Wall objects are "fixed" by default, i.e. not subject to forces
# prescribing a velocity will therefore make it move at constant velocity (downwards)
plate1.
plate2.
plate3.
plate4.
plate5.
plate6.
plate7.
plate8.
plate9.
plate10.
plate11.
plate12.
plate13.
plate14.
plate15.
plate16.
plate17.
plate18.
plate19.
plate20.
plate21.
plate22.
plate23.
plate24.
# start plotting the data now, it was not interesting before
O.engines=
#next time, do not call this function anymore, but the next one (unloadPlate) instead
#checker.
checker.
#def unloadPlate():
## if the force on plate exceeds maximum load, start unloading
#a1 = O.forces.
#a2 = O.forces.
#a3 = O.forces.
#a4 = O.forces.
#a5 = O.forces.
#a6 = O.forces.
#if abs(a1+
#
#
#
#
#
#
# next time, do not call this function anymore, but the next one (stopUnloading) instead
#
def stopUnloading():
b1 = O.forces.
b2 = O.forces.
b3 = O.forces.
b4 = O.forces.
b5 = O.forces.
b6 = O.forces.
b7 = O.forces.
b8 = O.forces.
b9 = O.forces.
b10 = O.forces.
b11 = O.forces.
b12 = O.forces.
b13 = O.forces.
b14 = O.forces.
b15 = O.forces.
b16 = O.forces.
b17 = O.forces.
b18 = O.forces.
b19 = O.forces.
b20 = O.forces.
b21 = O.forces.
b22 = O.forces.
b23 = O.forces.
b24 = O.forces.
#if abs(b1+
#if abs(b1+
# O.tags can be used to retrieve unique identifiers of the simulation
# if running in batch, subsequent simulation would overwrite each other's output files otherwise
# d (or description) is simulation description (composed of parameter values)
# while the id is composed of time and process number
#
#O.pause()
#stopping the cone tip from penetrate the bottom of the cylinder
#z_check=
#z_check=
#z_check=
#z_check=
#z_check=
#z_check=
#if z_check=0.2
#O.pause()
def addPlotData():
#if not isinstance(
#
Fz1=
Fz2=
Fz3=
Fz4=
Fz5=
Fz6=
Fz7=
Fz8=
Fz9=
Fz10=
Fz11=
Fz12=
Fz13=
Fz14=
Fz15=
Fz16=
Fz17=
Fz18=
Fz19=
Fz20=
Fz21=
Fz22=
Fz23=
Fz24=
Ftot=
#plot.
s=plate16.
plot.
if plate16.
plot.
O.pause()
# besides unbalanced force evolution, also plot the displacement-force diagram
plot.plots=
plot.plot()
yade.qt.View()
#O.run()
# when running with yade-batch, the script must not finish until the simulation is done fully
# this command will wait for that (has no influence in the non-batch mode)
utils.waitIfBatch()
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Philip Ho for more information if necessary.