New question #482040 on Yade: https://answers.launchpad.net/yade/+question/482040
Hi I am trying to understand basic behaviour of unsaturated soils. For my simulations i am using triaxial stress controller. But for my analysis i am first generating a packing with zero suction at a desired porosity and then i am using the saved packing and introducing a suction value for my further studies. I just want to know whether my approach is right or not. Here are my scripts: ######################## #script 1 ######################## # generate loose packing from yade import pack, qt, plot #some parameters: young_modulus=5e6 friction = 0.6 angle = atan(friction) targetPorosity=0.42 local_damping = 0.01 stabilityThreshold=0.01 viscous_normal = 0.021 viscous_shear = 0.8*viscous_normal mn = Vector3(0,0,0) mx = Vector3(.05,.05,.05) #key ='_triax_base_', #creating a material (FrictMat): O.materials.append(FrictMat(young=young_modulus,poisson=0.5,frictionAngle=angle,density=2600,label='spheres')) #SphereMat=O.materials[id_SphereMat] O.materials.append(FrictMat(young=young_modulus,poisson=0.5,frictionAngle=0,density=0,label='walls')) #generate boundary: walls=aabbWalls([mn,mx],thickness=0,material='walls') wallIds=O.bodies.append(walls) #generate particles: sp=pack.SpherePack() sp.makeCloud(mn,mx,rMean=.0012, seed=1) O.bodies.append([sphere(c,r,material='spheres') for c,r in sp]) triax=TriaxialStressController(thickness = 0, stressMask = 7, internalCompaction=False, # If true the confining pressure is generated by growing particles #goal1=-100, #goal2=-100, #goal3=-100, max_vel=0.001, ) #define engines: O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_CapillaryPhys()], #for linear model only [Law2_ScGeom_FrictPhys_CundallStrack(neverErase=True)] #for linear model only ), Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=0),#for linear model only GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax, TriaxialStateRecorder(iterPeriod=100,file='Target_porosity.txt'), NewtonIntegrator(damping=local_damping), #PyRunner(command='addPlotData()',iterPeriod=100) ] #apply isotropic compression triax.goal1=triax.goal2=triax.goal3=-10 while 1: O.run(1000, True) ##the global unbalanced force on dynamic bodies, thus excluding boundaries, which are not at equilibrium unb=unbalancedForce() print 'unbalanced force:',unb,' mean stress: ',triax.meanStress if unb<stabilityThreshold and abs(-10-triax.meanStress)/10<0.01: break print 'out' import sys #this is only for the flush() below while triax.porosity>targetPorosity: ## we decrease friction value and apply it to all the bodies and contacts friction = 0.95*friction setContactFriction(friction) print "\r Friction: ",friction," porosity:",triax.porosity, sys.stdout.flush() ## while we run steps, triax will tend to grow particles as the packing ## keeps shrinking as a consequence of decreasing friction. Consequently ## porosity will decrease O.run(500,1) setContactFriction(0.5) print '\r Friction_angle:', friction O.save('compactedState_packing.yade.gz') O.pause() ################## #Script 2 ################## from yade import plot import numpy O.load('compactedState_packing.yade.gz') triax_iso=TriaxialStressController(thickness = 0, stressMask = 7, internalCompaction=False, # If true the confining pressure is generated by growing particles max_vel=0.00001, ) #define engines: O.engines=[ ForceResetter(), InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()]), InteractionLoop( [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()], [Ip2_FrictMat_FrictMat_CapillaryPhys()], #for linear model only [Law2_ScGeom_FrictPhys_CundallStrack(neverErase=True)] #for linear model only ), Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=10),#for linear model only GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8), triax_iso, TriaxialStateRecorder(iterPeriod=100,file='Isotropic_10_200.txt'), NewtonIntegrator(damping=0.01), PyRunner(command='addPlotData()',iterPeriod=400) ] #apply isotropic compression triax_iso.goal1=triax_iso.goal2=triax_iso.goal3=-200 def addPlotData(): plot.addData( i=O.iter, s11=-triax_iso.stress(triax_iso.wall_right_id)[0],s22=-triax_iso.stress(triax_iso.wall_top_id)[1],s33=-triax_iso.stress(triax_iso.wall_front_id)[2], e11=-triax_iso.strain[0],e22=-triax_iso.strain[1],e33=-triax_iso.strain[2], poro=utils.porosity(), stress=-triax_iso.meanStress, ) #set time step and run simulation: O.dt=0.5*PWaveTimeStep() plot.plots={'i ':('s11','s22','s33'),' i':('e11','e22','e33'), 'stress':('poro')} #show the plot plot.plot() #save the plot #plot.saveDataTxt('Porosity_1.txt',vars=('i','s11','s22','s33','e11','e22','e33','poro','stress')) from yade import qt qt.View() print('Press PLAY button') Thanks Amiya -- You received this question notification because your team yade-users is an answer contact for Yade. _______________________________________________ Mailing list: https://launchpad.net/~yade-users Post to : yade-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~yade-users More help : https://help.launchpad.net/ListHelp