← Back to team overview

yade-users team mailing list archive

Re: [Question #686318]: random dense pack with clumps

 

Question #686318 on Yade changed:
https://answers.launchpad.net/yade/+question/686318

    Status: Needs information => Open

Grace Mejico gave more information on the question:
from yade import pack, qt, plot
from numpy import arange
import numpy as np
import random

#INPUT
r=0.07 
H=1 #height
B=.45 #base
b=.25 #base
L=4 #lenght
#EN SERVICIO
EmpujeTop=2400#Pa 
EmpujeBottom=9100#Pa 
damp=0.7
aceloutofplane=0
ii=0

# DEFINICION DEL MATERIAL ******************************************************
mat1 = JCFpmMat()
mat1.cohesion =0 #Pa32.37e3
mat1.density = 2821 #kg/m3
mat1.frictionAngle = radians(58.74) #rad
mat1.poisson = 0.18
mat1.young = 37.04e9 #Pa

# JOINT ******************************************************
mat1.jointCohesion = 262000 #Pa
mat1.jointFrictionAngle = radians(40)
mat1.jointNormalStiffness= 1.75e8 #Pa/m
mat1.jointShearStiffness=0.7e8 #Pa/m
O.materials.append(mat1)

# GEOMETRY VOLUME ********************************************************************
a=(B-b)*.5
Vol1=pack.inParallelepiped(o=(0,0,0), a=(L,0,0), b=(0,B,0), c=(0,0,H))
Vol2=pack.inParallelepiped(o=(L,B+a,0), a=(0,B+a,0), b=(0,a+b,H), c=(L,a+b,H))
Vol3=pack.inParallelepiped(o=(L,-a,0), a=(0,-a,0), b=(0,a,H), c=(L,a,H))
Vol4=Vol1-Vol2-Vol3-Vol3
Esferas=pack.randomDensePack(Vol4,radius=r,rRelFuzz=0)
O.bodies.append(Esferas)

#RREPLACE CLUMPS********************************************************
relRadList1 = [.04,.03]
relPosList1 = [[0.035,0,0],[.083,0,0]]

templates= []
templates.append(clumpTemplate(relRadii=relRadList1,relPositions=relPosList1))
O.bodies.replaceByClumps(templates,[1])


# APLICACION DE FUERZAS ********************************************************
listSphereA=[]
for x1 in O.bodies:
	if isinstance(x1.shape,Sphere) and x1.state.pos[1]<3*r and x1.state.pos[2]<=H and x1.state.pos[2]>3*H/4.000:
		listSphereA.append(x1.id)

ha=1*H/8.000
m=EmpujeBottom-EmpujeTop
Ea=m*ha+EmpujeTop

Fa=Ea*(H/4.000)*L/len(listSphereA)

def aplicarFuerzaA():
	for i in listSphereA:
		O.forces.setPermF(i,(0,Fa,0))


# CONDICIONES DE BORDE *********************************************************

Borde1=utils.wall(0.43,axis=0, sense=0)
Borde2=utils.wall(L-0.43,axis=0, sense=0)
Borde3=utils.wall(0, axis=1, sense=0)
Borde4=utils.wall(0.05, axis=2, sense=0)

O.bodies.append(Borde1)
O.bodies.append(Borde2)
O.bodies.append(Borde3)
O.bodies.append(Borde4)


# BLOCKING ROTATION******************************************************
listSphereTodo=[]
for m in O.bodies:
	if isinstance(m.shape,Sphere) and m.state.pos[2]<2*H:
		listSphereBase.append(m.id)

for i in listSphereTodo:
	O.bodies[i].state.blockedDOFs='XYZ'

# ENGINE ***********************************************************************
O.engines=[
		ForceResetter(),
		InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Wall_Aabb()]),
		InteractionLoop(
			[Ig2_Sphere_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
			[Ip2_JCFpmMat_JCFpmMat_JCFpmPhys()],
			[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()]
		),
		NewtonIntegrator(gravity=(0,aceloutofplane,-9.81),damping=damp),
		PyRunner(firstIterRun=10000,command='aplicarFuerzaA()'),
			VTKRecorder(iterPeriod=100,recorders=['spheres','jcfpm','facets','colors'],fileName='/tmp/p1-')
]

# DETALLES FINALES *************************************************************
O.dt=0.5*PWaveTimeStep() # establece el delta de tiempo como una fraccion del tiempo critico
plot.plot(subPlots=True) # llama a los sub plots
plot.live=True # ploteo en tiempo real
qt.Controller() # abre la ventana del controlador
V=qt.View() # abre la ventada de la vista
R=yade.qt.Renderer() # llama a la renderizacion
R.bgColor=(1.,1.,1.) # definel color blan
V.screenSize = (900,900) # tamano de pantalla

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.