TriaxialStressController to pack particles

Asked by xuq on 2019-07-17

HI,all
I am trying to use TiaxialStressController to simulate packing of particles,
but it said : No such attribute: finalMaxMutiplier.
I don't know what's wrong.

This is my code:
from yade import pack,plot,qt,export,ymport,utils
import numpy as np
IsoSigma = -100.
O.periodic=True
#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.02, 0.02, 0.02), 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.02,0.02,0.02)],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

O.dt=0.1*PWaveTimeStep()

triax=TriaxialStressController(
                                 maxMutiplier=1.+2e4/1e7,
                                 finalMaxMutiplier=1.+2e3/1e7,
                                 thickness=0,
                                 stressMask=7,
                                 internalCompaction=True,
)

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','voidratio'))
 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)

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
2019-07-19
Last query:
2019-07-19
Last reply:
2019-07-19
Robert Caulk (rcaulk) said : #1

>No such attribute: finalMaxMutiplier

The error says it all. Use finalMaxMultiplier, since that is an attribute[1]

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.TriaxialStressController.finalMaxMultiplier

xuq (xuq) said : #2

Hi Robert,
So how can I modify this error?
I still don't understand why this error occurred....
thank you

Best Robert Caulk (rcaulk) said : #3

The error occurred because you spelled the attribute incorrectly.

xuq (xuq) said : #4

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)

Robert Caulk (rcaulk) said : #5

Original question solved.

Robert Caulk (rcaulk) said : #6

Please review [1], especially point 5. Thank you.

[1]https://www.yade-dem.org/wiki/Howtoask

xuq (xuq) said : #7

Thanks Robert Caulk, that solved my question.