← Back to team overview

yade-users team mailing list archive

Re: [Question #659526]: Triaxial test on dry granular material

 

Question #659526 on Yade changed:
https://answers.launchpad.net/yade/+question/659526

Swapnil posted a new comment:
Yes, the one I am trying is as follows: Perhaps I might be deviating but it looks syntactically alright :)
#triaxial test on dry sand

from yade import pack,plot,qt
import math

num_spheres=10000   # number of spheres
young=5e10
compFricDegree = 30 # initial contact friction during the confining phase
finalFricDegree = 30 # contact friction during the deviatoric loading
mn,mx=Vector3(0,0,0),Vector3(0.1,0.1,0.1) # corners of the initial packing

O.materials.append(FrictMat(young=young,poisson=0.3,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))
walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()
sp.makeCloud(mn,mx,-1,0.5,num_spheres,False,0.55,seed=1) #"seed" make the "random" generation always the same
sp.toSimulation(material='spheres')


newton=NewtonIntegrator(damping=0.3)
O.dt=0.1*PWaveTimeStep()

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Wall_Aabb()]),
 InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom(), Ig2_Wall_Sphere_ScGeom()],
  [Ip2_FrictMat_FrictMat_FrictPhys()],
  [Law2_ScGeom_FrictPhys_CundallStrack(),]
 ),
 TriaxialStressController(label='triax',
 maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
 finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
 thickness = 0,
 stressMask =7,
 max_vel = 0.005,
 internalCompaction=True, # If true the confining pressure is generated by growing particles
),GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=50,timestepSafetyCoefficient=0.8),PyRunner(iterPeriod=100,command='addPlotData()'),
 newton
]

#O.dt=0.005*PWaveTimeStep()
#strain_rate=-0.05
triax.goal1=triax.goal2=triax.goal3=-5000

#Deviatoric loading
##We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
triax.internalCompaction=False

## Change contact friction (remember that decreasing it would generate instantaneous instabilities)
setContactFriction(radians(finalFricDegree))

##set stress control on y and z, we will impose strain rate on x
triax.stressMask = 6
##now goal2 is the target strain rate
triax.goal1=-0.001
## we define the lateral stresses during the test, here the same 10kPa as for the initial confinement.
triax.goal2=-10000
triax.goal3=-10000
##Save temporary state in live memory. This state will be reloaded from the interface with the "reload" button.
O.saveTmp()


def addPlotData():
  plot.addData(i=O.iter,Sz=-triax.stress(triax.wall_right_id)[0], Dz=-triax.strain[0],Tx=math.sqrt(O.time))
  
plot.plots= {'Dz':('Sz'),'Tx':('Dz')}
plot.plot()


Yeah, I am also trying to run the example script but getting this error:

Traceback (most recent call last):
  File "/usr/bin/yade", line 182, in runScript
    execfile(script,globals())
  File "newtriaxtest.py", line 184
    O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7]
                                                                                                         ^
IndentationError: unindent does not match any outer indentation level

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.