yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #15881
Re: [Question #658629]: Oedometric consolidation test
Question #658629 on Yade changed:
https://answers.launchpad.net/yade/+question/658629
Swapnil posted a new comment:
Hi Jan. Sorry for being late. I was not at the system for all these
days.
Here is the current code:
from yade import pack,plot
import math,time
from math import sin,cos
def cylSurf(center,radius,height,nSegments=12,thick=0,**kw):
"""creates cylinder made of boxes. Axis is parallel with z+"""
center = Vector3(center)
angles = [i*2*pi/nSegments for i in range(nSegments)]
pts = [center + Vector3(radius*cos(a),radius*sin(a),.5*height) for a in angles]
ret = []
for i,pt in enumerate(pts):
l = pi*radius/nSegments
es = (.5*thick,l,.5*height)
ori = Quaternion((0,0,1),i*2*pi/nSegments)
ret.append(box(pt,es,ori,**kw))
return ret
surf = cylSurf((1,2,3),4,5,nSegments=12,thick=.1,wire=True)
O.bodies.append(surf)
for b in surf: b.state.blockedDOFs='xyzXYZ'
pred=pack.inCylinder((1,2,3),(1,2,8),4)
sp=pack.randomDensePack(pred,radius=0.25,spheresInCell=350)
O.bodies.append(sp)
yade.qt.Controller()
lower_plateID=O.bodies.append(box((1,2,3),(4,4,0.0002)))
O.bodies[lower_plateID].state.blockedDOFs = 'xyzXYZ'
upper_plateID=O.bodies.append(box((1,2,8),(4,4,0.0002)))
O.forces.addF(upper_plateID,(0,0,-0.02),permanent=True)
O.engines=[ForceResetter(),InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]),InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],[Law2_ScGeom_FrictPhys_CundallStrack()]),PyRunner(iterPeriod=100,command="addPlotData()"),NewtonIntegrator(gravity=[0,0,-9.81],damping=0.1)]
O.dt= 0.3*PWaveTimeStep()
def addPlotData():
Dz=upper_plate.state.displ()[2]
t= O.time
plot.addData(Tx=math.sqrt(t), Dz=Dz)
plot.plots= { 'Tx':('Dz')}
plot.plot()
--
You received this question notification because your team yade-users is
an answer contact for Yade.