# coding: utf-8 # loose specimen from yade import pack import os #from utils import * nRead=utils.readParamsFromTable( num_spheres=10000,# number of spheres compFricDegree = 32, # contact friction during the confining phase the final porosity unknownOk=True, isoForce=20000, conStress=100000 ) from yade.params import table num_spheres=table.num_spheres mn,mx=Vector3(-0.1,-0.1,-0.1),Vector3(0.1,0.1,0.1) thick = 0.1 compFricDegree = table.compFricDegree finalFricDegree=35 #targetPorosity=0.382 rate=0.05 damp=0.06 stabilityThreshold=0.001 # leave it too low can have a super stable state, but will eat onion for waiting so long #stopStep=160000 # pas de calcul on choisit pour faire calculer travail du second-ordre key='_probing_envelope_' # just used for adding name to the output, kind of boring ## create material #0, which will be used as default O.materials.append(FrictMat(young=356e6,poisson=0.42,frictionAngle=radians(compFricDegree),density=3000,label='spheres')) O.materials.append(FrictMat(young=356e6,poisson=0.5,frictionAngle=0,density=0,label='walls')) ## create walls around the packing walls=utils.aabbWalls([mn,mx],thickness=thick,oversizeFactor=5,material='walls') wallIds=O.bodies.append(walls) sp=pack.SpherePack() #sp.makeCloud(mn,mx,-1,0,num_spheres,False, 0.95,psdSizes,psdCumm,False,seed=1) sp.makeCloud(mn,mx,0.001,0.65,num_spheres,False,0.8,seed=1) #sp.makeCloud(mn,mx,-1,0,-1,False, 0.95,psdSizes,psdCumm,False,seed=1) sp.toSimulation(material='spheres') volume = (mx[0]-mn[0])*(mx[1]-mn[1])*(mx[2]-mn[2]) mean_rad = pow(0.09*volume/num_spheres,0.3333) #clumps=False #if clumps: # c1=pack.SpherePack([((-0.2*mean_rad,0,0),0.5*mean_rad),((0.2*mean_rad,0,0),0.5*mean_rad)]) # sp.makeClumpCloud((-0.24,0.24,-0.24),(0.24,0.24,0.24),[c1],periodic=False) # O.bodies.append([utils.sphere(center,rad,material='spheres') for center,rad in sp]) # standalone,clumps=sp.getClumps() # for clump in clumps: # O.bodies.clump(clump) # for i in clump[1:]: O.bodies[i].shape.color=O.bodies[clump[0]].shape.color # #sp.toSimulation() #else: # O.bodies.append([utils.sphere(center,rad,material='spheres') for center,rad in sp]) O.dt=.5*utils.PWaveTimeStep() # initial timestep, to not explode right away O.usesTimeStepper=True triax=TriaxialStressController( maxMultiplier=1.001, finalMaxMultiplier=1.0001, thickness = thick, radiusControlInterval=10, stressMask = 7, max_vel=0.01, ) newton=NewtonIntegrator(damping=damp) O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()],verletDist=-mean_rad*0.06), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_FrictPhys()], [Law2_ScGeom_FrictPhys_CundallStrack(label='law')] ), GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8, defaultDt=4*utils.PWaveTimeStep()), triax, TriaxialStateRecorder(iterPeriod=50,file='WallStresses'+key,addIterNum=False,initRun=False), # 20 is too small, will make big file size newton ] #O.save('initial'+key+'.xml') #Display spheres with 2 colors for seeing rotations better Gl1_Sphere.stripes=1 #if nRead==0: yade.qt.Controller(), yade.qt.View() print 'Number of elements: ', len(O.bodies) print 'Box Volume: ', triax.boxVolume print 'Box Volume calculated: ', volume # Applying confining force ######################################### # Phase 1: ISOTROPIC GENERATOR OF 20kPa # ######################################### while 1: triax.internalCompaction=True # Growing the particles is what we use in this step setContactFriction=radians(compFricDegree) triax.stressmask=7 triax.goal1=table.isoForce triax.goal2=table.isoForce triax.goal3=table.isoForce O.run(1000,True) #the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium unb=unbalancedForce() #average stress #note: triax.stress(k) returns a stress vector, so we need to keep only the normal component 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 # print 'void ratio=',triax.porosity/(1-triax.porosity), 'porosity=', triax.porosity print 'mean stress engine', triax.meanStress, 'kineticE=', utils.kineticEnergy() print '-----State_01: Isotropic compression 20kPa--(^_^)---' if unb=0.3 : #triax.sigma2 break O.save('final.xml')