def setUp(self): O.reset(); young=1.0e3 poisson=5 density=2.60e3 frictionAngle=radians(30) O.materials.append(CohFrictMat(young=young,poisson=poisson,density=density,frictionAngle=frictionAngle,normalCohesion=1e13,shearCohesion=1e13,momentRotationLaw=True)) O.dt=1e-3 O.engines=[ ForceResetter(), InsertionSortCollider([ Bo1_ChainedCylinder_Aabb(), Bo1_Sphere_Aabb()]), InteractionLoop( [Ig2_ChainedCylinder_ChainedCylinder_ScGeom6D(),Ig2_Sphere_ChainedCylinder_CylScGeom()], [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True)], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]), ## Apply gravity ## Motion equation NewtonIntegrator(damping=0.15,gravity=[0,-9.81,0]) ] #Generate a spiral Ne=10 for i in range(0, Ne): omeg=95.0/float(Ne); hy=0.05; hz=0.07; px=float(i)*(omeg/60.0); py=sin(float(i)*omeg)*hy; pz=cos(float(i)*omeg)*hz; px2=float(i+1.)*(omeg/60.0); py2=sin(float(i+1.)*omeg)*hy; pz2=cos(float(i+1.)*omeg)*hz; utils.chainedCylinder(begin=Vector3(pz,py,px), radius=0.005,end=Vector3(pz2,py2,px2),color=Vector3(0.6,0.5,0.5)) O.bodies[Ne-1].state.blockedDOFs='xyzXYZ'
def setUp(self): O.reset() young = 1.0e3 poisson = 5 density = 2.60e3 frictionAngle = radians(30) O.materials.append( CohFrictMat(young=young, poisson=poisson, density=density, frictionAngle=frictionAngle, normalCohesion=1e13, shearCohesion=1e13, momentRotationLaw=True)) O.dt = 1e-3 O.engines = [ ForceResetter(), InsertionSortCollider( [Bo1_ChainedCylinder_Aabb(), Bo1_Sphere_Aabb()]), InteractionLoop([ Ig2_ChainedCylinder_ChainedCylinder_ScGeom6D(), Ig2_Sphere_ChainedCylinder_CylScGeom() ], [ Ip2_CohFrictMat_CohFrictMat_CohFrictPhys( setCohesionNow=True, setCohesionOnNewContacts=True) ], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]), ## Apply gravity ## Motion equation NewtonIntegrator(damping=0.15, gravity=[0, -9.81, 0]) ] #Generate a spiral Ne = 10 for i in range(0, Ne): omeg = 95.0 / float(Ne) hy = 0.05 hz = 0.07 px = float(i) * (omeg / 60.0) py = sin(float(i) * omeg) * hy pz = cos(float(i) * omeg) * hz px2 = float(i + 1.) * (omeg / 60.0) py2 = sin(float(i + 1.) * omeg) * hy pz2 = cos(float(i + 1.) * omeg) * hz utils.chainedCylinder(begin=Vector3(pz, py, px), radius=0.005, end=Vector3(pz2, py2, px2), color=Vector3(0.6, 0.5, 0.5)) O.bodies[Ne - 1].state.blockedDOFs = 'xyzXYZ'
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True)], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(label='law')] ), ## Motion equation NewtonIntegrator(damping=0.15,gravity=[0,-9.81,0]), PyRunner(iterPeriod=500,command='history()'), #PyRunner(iterPeriod=5000,command='if O.iter<21000 : yade.qt.center()') ] #Generate a spiral Ne=200 for i in range(0, Ne): omega=60.0/float(Ne); hy=0.10; hz=0.15; px=float(i)*(omega/60.0); py=sin(float(i)*omega)*hy; pz=cos(float(i)*omega)*hz; px2=float(i+1.)*(omega/60.0); py2=sin(float(i+1.)*omega)*hy; pz2=cos(float(i+1.)*omega)*hz; utils.chainedCylinder(begin=Vector3(pz,py,px), radius=0.005,end=Vector3(pz2,py2,px2),color=Vector3(0.6,0.5,0.5)) def outp(id=1): for i in O.interactions: if i.id1 == 1: print i.phys.shearForce print i.phys.normalForce return i O.bodies[Ne-1].state.blockedDOFs='xyzXYZ' yade.qt.View(); #plot some results from math import * from yade import plot
poisson=0.3, density=4e3, frictionAngle=radians(30), normalCohesion=1e5, shearCohesion=1e5, momentRotationLaw=False, label='spheremat')) rCyl = 0.006 cylindersBodies = [] for i in arange(0, 0.3, 0.3 / 15.): cylindersBodies.append( utils.chainedCylinder(begin=Vector3(i, 0, 0), radius=rCyl, end=Vector3(i + 0.3 / 15., 0, 0), fixed=False, wire=False, material='cylindermat')) ChainedState.currentChain = ChainedState.currentChain + 1 O.bodies[0].state.blockedDOFs = 'xyzXYZ' O.bodies[-1].state.blockedDOFs = 'xyzXYZ' O.bodies.append( utils.sphere([0.15, 0, 2. * rCyl], rCyl, wire=False, fixed=False, material='spheremat')) def main():
import math qt.View() O.dt=5e-07 young=2e4 O.materials.append(CohFrictMat(young=8e5,poisson=0.3,density=4e3,frictionAngle=radians(30),normalCohesion=1e5,shearCohesion=1e5,momentRotationLaw=True,label='cylindermat')) O.materials.append(CohFrictMat(young=8e5,poisson=0.3,density=4e3,frictionAngle=radians(30),normalCohesion=1e5,shearCohesion=1e5,momentRotationLaw=False,label='spheremat')) rCyl=0.006 cylindersBodies=[] for i in arange(0,0.3,0.3/15.): cylindersBodies.append(utils.chainedCylinder(begin=Vector3(i,0,0),radius=rCyl,end=Vector3(i+0.3/15.,0,0),fixed=False,wire=False,material='cylindermat')) ChainedState.currentChain=ChainedState.currentChain+1 O.bodies[0].state.blockedDOFs='xyzXYZ' O.bodies[-1].state.blockedDOFs='xyzXYZ' O.bodies.append(utils.sphere([0.15,0,2.*rCyl],rCyl,wire=False,fixed=False,material='spheremat')) def main(): global Fn,Ft IdSphere=len(O.bodies)-1 if O.iter>50000 : O.bodies[IdSphere].dynamic=False O.bodies[IdSphere].state.vel[2]=0.1 O.engines=[
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=False,label='ipf'),Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(label='law'),Law2_ScGeom_FrictPhys_CundallStrack(),Law2_CylScGeom_FrictPhys_CundallStrack()] ), ## Motion equation NewtonIntegrator(damping=0.05,label='newton',gravity=[1,-9.81,0]), ] #Assemble cylinders in sinusoidal shapes O.materials.append(CohFrictMat(young=young,poisson=poisson,density=3.0*density,frictionAngle=frictionAngle3,normalCohesion=1e40,shearCohesion=1e40,momentRotationLaw=True,label='cylindermat')) Ne=30 dy=0.03 dx=0.2 dz=0.2 Nc=1 #nb. of additional chains for j in range(-Nc, Nc+1): dyj = abs(float(j))*dy dxj = abs(float(j))*dx dzj = float(j)*dz for i in range(0, Ne): omega=20/float(Ne); hy=0.0; hz=0.05; hx=1.5; px=float(i)*hx/float(Ne)-0.8+dxj; py=sin(float(i)*omega)*hy+dyj; pz=cos(float(i)*omega)*hz+dzj; px2=float(i+1.)*hx/float(Ne)-0.8+dxj; py2=sin(float(i+1.)*omega)*hy+dyj; pz2=cos(float(i+1.)*omega)*hz+dzj; utils.chainedCylinder(begin=Vector3(pz,py,px), radius=0.02,end=Vector3(pz2,py2,px2),color=Vector3(0.6,0.5,0.5),material='cylindermat') if (i == Ne-1): #close the chain with a node of size 0 print "closing chain" b=utils.chainedCylinder(begin=Vector3(pz2,py2,px2), radius=0.02,end=Vector3(pz2,py2,px2),color=Vector3(0.6,0.5,0.5),material='cylindermat') b.state.blockedDOFs='xyzXYZ' ChainedState.currentChain=ChainedState.currentChain+1 O.saveTmp()
dyj = abs(float(j)) * dy dxj = abs(float(j)) * dx dzj = float(j) * dz for i in range(0, Ne): omega = 20 / float(Ne) hy = 0.0 hz = 0.05 hx = 1.5 px = float(i) * hx / float(Ne) - 0.8 + dxj py = sin(float(i) * omega) * hy + dyj pz = cos(float(i) * omega) * hz + dzj px2 = float(i + 1.) * hx / float(Ne) - 0.8 + dxj py2 = sin(float(i + 1.) * omega) * hy + dyj pz2 = cos(float(i + 1.) * omega) * hz + dzj utils.chainedCylinder(begin=Vector3(pz, py, px), radius=0.02, end=Vector3(pz2, py2, px2), color=Vector3(0.6, 0.5, 0.5), material='cylindermat') if (i == Ne - 1): #close the chain with a node of size 0 print "closing chain" b = utils.chainedCylinder(begin=Vector3(pz2, py2, px2), radius=0.02, end=Vector3(pz2, py2, px2), color=Vector3(0.6, 0.5, 0.5), material='cylindermat') b.state.blockedDOFs = 'xyzXYZ' ChainedState.currentChain = ChainedState.currentChain + 1 O.saveTmp()