from yade import pack # Data definition nRead=utils.readParamsFromTable( num_spheres=3000,# number of spheres compFricDegree = 10, # contact friction during the confining phase unknownOk=True, isoForce=100000 ) from yade.params import table num_spheres=table.num_spheres# number of spheres targetPorosity = 0.387 #the porosity we want for the packing compFricDegree = table.compFricDegree finalFricDegree = 35 # contact friction during the deviatoric loading rate=0.002 # loading rate (strain rate) damp=0.2 # damping coefficient stabilityThreshold=0.1 # 0.01 key='_triax_draine_e618_100_psd' # put you simulation's name here young=356e6 # contact stiffness mn,mx=Vector3(-0.1,-0.1,-0.1),Vector3(0.1,0.1,0.1) # corners of the initial packing thick = 0.01 # thickness of the plates ## create materials for spheres and plates O.materials.append(FrictMat(young=young,poisson=0.42,frictionAngle=radians(compFricDegree),density=3000,label='spheres')) O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=utils.aabbWalls([mn,mx],thickness=thick,oversizeFactor=1.5,material='walls') wallIds=O.bodies.append(walls) ## use a SpherePack object to generate a random loose particles packing sp=pack.SpherePack() psdSizes=[0.002,0.003,0.004,0.005,0.006,0.007,0.008,0.0095] # (sizes or radii of the grains vary from 2mm to 9.5mm) psdCumm=[0.01,0.09,0.25,0.50,0.69,0.90,0.95,1.00] # for the code do not use percentage sp.makeCloud(mn,mx,-1,0,num_spheres,False, 0.95,psdSizes,psdCumm,False,seed=1) #"seed" make the "random" generation always the same sp.toSimulation(material='spheres') # engine triax=TriaxialStressController( maxMultiplier=1.001, # spheres growing factor (fast growth) finalMaxMultiplier=1.01, # spheres growing factor (slow growth) thickness = thick, stressMask = 7, #the value of confining stress for the intitial (growth) phase goal1=table.isoForce, goal2=table.isoForce, goal3=table.isoForce, max_vel=0.05, internalCompaction=True, # If true the confining pressure is generated by growing particles # Key=key # passed to the engine so that the output file will have the correct name ) newton=NewtonIntegrator(damping=damp) 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()] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=25,timestepSafetyCoefficient=0.8), triax, TriaxialStateRecorder(iterPeriod=50,file='WallStresses'+key), newton ] # compaction while 1: O.run(1000, True) unb=unbalancedForce() meanS=(triax.stress(triax.wall_right_id)[0]+triax.stress(triax.wall_top_id)[1]+triax.stress(triax.wall_front_id)[2])/3 print 'unbalanced force:',unb,' mean stress: ',meanS, 'void ratio=', triax.porosity/(1-triax.porosity), 'porosity=', triax.porosity if unb