yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #18676
Re: [Question #677362]: Extract a cylinder from a cloud of spheres
Question #677362 on Yade changed:
https://answers.launchpad.net/yade/+question/677362
Othman Alshareedah posted a new comment:
Hi Robert,
Thanks for your answers. I tried randomDensePack for a cylinder but it
only give a porosity of about .65 while I need porosity~.2-.3.
Also, I tried using filterSpherePack as below, but nothing appeared in
my simulation viewer. Also I don't know if I'm filtering the original
cloud or the compacted one. My goal is to crop a cylinder, delete the
rest of the speheres and export the data to a txt file. Can you please
help with that. Below is my code.
Thank you
Othman
############################ Material properties #############################
sigmaIso=-1e3
frictangel=.52
targetp=0.74 #this is the targeted porosity
pervconc=O.materials.append(FrictMat(young = 5e10, poisson = 0.15,frictionAngle = radians(frictangel), density=1920))
############################ generate loose packing
#############################
from yade import pack, qt, plot, export
sp=pack.SpherePack()
sp.makeCloud((0,0,0),(.4,.4,.6),rMean=.015,rRelFuzz=.015,periodic=True)
sp.toSimulation()
yade.qt.View()
############################ Triaxial compaction #############################
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
PeriTriaxController(label='triax',
goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7,
dynCell=True,maxStrainRate=(100,100,100),
maxUnbalanced=.1,relStressTol=1e-3,
doneHook='compactionFinished()'
),
NewtonIntegrator(damping=.2),
PyRunner(command='P()',iterPeriod=5000)
]
O.dt=.5*PWaveTimeStep()
## stop conditions
def P():
global frictangel
if utils.porosity()>targetp:
frictangel = frictangel
frictangel = .95* frictangel #decreasing friction angle
setContactFriction(radians(frictangel))
print ('porosity = ', utils.porosity(), 'friction angle', frictangel)
if utils.porosity()<targetp:
O.pause()
print 'Finished'
def compactionFinished():
# set the current cell configuration to be the reference one
O.cell.trsf=Matrix3.Identity
# change control type: keep constant confinement in x,y, 20% compression in z
triax.goal=(sigmaIso,sigmaIso,-.2)
triax.stressMask=3
# allow faster deformation along x,y to better maintain stresses
triax.maxStrainRate=(1.,1.,.1)
# next time, call triaxFinished instead of compactionFinished
triax.doneHook='triaxFinished()'
# do not wait for stabilization before calling triaxFinished
triax.maxUnbalanced=10
def triaxFinished():
print 'Finished'
O.pause()
############################ Extracting a cylinder
#############################
ss=pack.filterSpherePack(pack.inCylinder((.05,.05,.05),(.15,.15,.2),.02), sp, returnSpherePack=True)
ss.toSimulation()
--
You received this question notification because your team yade-users is
an answer contact for Yade.