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

jamespaul posted a new comment:
Thanks Bruno,

I made a small mistake and corrected my code.

# encoding: utf-8

sigmaIso=-25000

from yade import pack, qt, plot

O.periodic=True

spheres=O.materials.append(FrictMat(young=64e8,poisson=0.12,density=2650,frictionAngle=0.0005))
s=O.materials.append(FrictMat(young=64e8,poisson=0.12,density=2650,frictionAngle=0.24))

'''sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=.1,rRelFuzz=.3,periodic=True)
n=sp.toSimulation(material=spheres)'''

psdSizes=[0.15,.18,.2,.21,.25,.27,.30,.31,.34,.38]
psdCumm=[0.025,0.11,0.27,0.45,0.73,0.88,0.95,0.98,0.99,1]

sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1.5,1.5,1.5),psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,periodic=True)
n=sp.toSimulation(material=spheres)

O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom()],
                [Ip2_FrictMat_FrictMat_FrictPhys()],
                [Law2_ScGeom_FrictPhys_CundallStrack()]
        ),
        PeriTriaxController(label='triax',
                goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7,
                dynCell=True,maxStrainRate=(10,10,10),
                maxUnbalanced=.1,relStressTol=1e-3,
                doneHook='compactionFinished()'
        ),
        NewtonIntegrator(damping=.1),
        PyRunner(command='addPlotData()',iterPeriod=1000),
]
O.dt=.5*PWaveTimeStep()

def addPlotData():
        
plot.addData(sxx=triax.stress[0],syy=triax.stress[1],szz=triax.stress[2],
        exx=triax.strain[0],eyy=triax.strain[1],ezz=triax.strain[2],
        q=triax.stress[2]-0.5*(triax.stress[0]+triax.stress[1]),
        p=(triax.stress[0]+triax.stress[1]+triax.stress[2])/3,
        )
        print('szz=',triax.stress[2],'ezz=',triax.strain[2])
        #plot.saveDataTxt('qp1.txt',vars=('q','p','szz','ezz'))

def compactionFinished():
        print('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
        O.cell.trsf=Matrix3.Identity
        for i in n:
                O.bodies[i].material = O.materials[s]
        triax.goal=(sigmaIso,sigmaIso,-1000000)
        triax.stressMask=7
        triax.maxStrainRate=(0,0,.000001)
        triax.doneHook='triaxFinished()'
        triax.maxUnbalanced=0.000001

def triaxFinished():
        print 'Finished'
        O.pause()

-- 
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     : [email protected]
Unsubscribe : https://launchpad.net/~yade-users
More help   : https://help.launchpad.net/ListHelp

Reply via email to