← Back to team overview

yade-users team mailing list archive

Re: [Question #682116]: TriaxialStressController to pack particles

 

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

xuq posted a new comment:
Thank you ,Robert
Then I test this code ,but it has another error.
It said :Body larger than half of the cell size encountered.
This is my code:

from yade import pack,plot,qt,export,ymport,utils
import numpy as np
IsoSigma = -100.
O.periodic=False
#O.cell.hSize=Matrix3(0.02,0,0,0,0.02,0,0,0,0.02)
O.materials.append(FrictMat(young=1e7,poisson=0.8,frictionAngle=radians(26),density=2650,label='iregular'))
O.materials.append(FrictMat(young=1e7,poisson=0.8,frictionAngle=radians(0),density=0,label='walls'))

# create particles
sp1=pack.SpherePack()
sp1.makeCloud(maxCorner=(0.2, 0.2, 0.2), psdSizes=[0.00017, 0.000191, 0.0002285, 0.00026, 0.000292, 0.000325, 0.00035], psdCumm=[0.0, 0.1, 0.3, 0.5, 0.6, 0.9, 1], periodic=True,num=500,seed=1)
sp1.toSimulation(color=(1,0,0),material='iregular')

walls=aabbWalls([(0,0,0),(0.2,0.2,0.2)],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

O.dt=0.1*PWaveTimeStep()

triax=TriaxialStressController(
                                 maxMultiplier=1.+2e4/1e7,
                                 finalMaxMultiplier=1.+2e3/1e7,
                                 thickness=0,     
                                 stressMask=7,
                                 internalCompaction=False,
)

triax.wall_bottom_activated=True
triax.wall_top_activated=True
triax.wall_left_activated=True
triax.wall_right_activated=True
triax.wall_back_activated=True
triax.wall_front_activated=True

triax.goal1=triax.goal2=triax.goal3=IsoSigma
#triax.max_vel1=triax.max_vel2=triax.max_vel3=0.003
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()]),
#	PyRunner(command='fabric()',iterPeriod=10000),
        GlobalStiffnessTimeStepper(),
	NewtonIntegrator(damping=0.70),
        triax,
        PyRunner(iterPeriod=100,command='plotAddData1()'),
]

def plotAddData1():
        stree=untils.getStress()
	plot.addData(
		iter=O.iter,iter_=O.iter,
                sxx=stress[0][0],syy=stress[1][1],szz=stress[2][2],
                exx=O.cell.trsf[0][0],eyy=O.cell.trsf[1][1],ezz=O.cell.trsf[2][2],
                poros=porosity(),
		unbalanced=utils.unbalancedForce(),
		t=O.time,
		gWork=O.energy['gravWork'],
		Ekin=utils.kineticEnergy(),
      		Etot=O.energy.total(),**O.energy
         )
        plot.saveDataTxt('macroFile1',vars=('t','exx','eyy','ezz','sxx','syy','szz','poros'))
	plot.saveDataTxt('energyFile1',vars=('t','Etot','unbalanced','gWork','Ekin'))

O.trackEnergy=True

# plotting 
plot.live=True
plot.plots={'iter':('sxx','syy','szz'),'iter_':('exx','eyy','ezz'), ' iter':('unbalanced'), 
            ' iter ':(O.energy.keys,None,'Etot')
}


def Finished():
	O.save('isotropicState.xml')
	print 'Finished'
	print porosity()
	O.pause()
yade.qt.Controller(), yade.qt.View()  
O.run()
plot.plot(subPlots=True)

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