problem in using of triaxialstresscontroller

Asked by xuq on 2019-07-19

Hi all,
I am trying to packing the spheres by triaxialstresscontrol.
But it makes some mistakes,
I don't know why.
Could anyone check it for me ,please?

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)

Question information

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

Hello,

>But it makes some mistakes,

Please review [1] and supply the necessary information to help us help you.

Cheers,

Robert

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

xuq (xuq) said : #2

Hello Robert,
I have correct the erroe before,and it has another error.
It said :
Running script ic2.py
FATAL /data/trunk/pkg/common/InsertionSortCollider.cpp:495 spatialOverlapPeri: Body #504 spans over half of the cell size 0.2 (axis=0, see flag allowBiggerThanPeriod)
FATAL /data/trunk/core/ThreadRunner.cpp:30 run: Exception occured:
/data/trunk/pkg/common/InsertionSortCollider.cpp: Body larger than half of the cell size encountered.
yade.plot: creating fake plot, since there are no y-data yet
WARNING:matplotlib.legend:No handles with labels found to put in legend.

Best Robert Caulk (rcaulk) said : #3

I am going to assume your goal is to use TriaxialStressController to compact a cloud of spheres to an isotropic state.

Follow [1].

[1]https://gitlab.com/yade-dev/trunk/blob/master/examples/triax-tutorial/script-session1.py

xuq (xuq) said : #4

Thanks,Robert.
This solved my problem.

xuq (xuq) said : #5

Thanks Robert Caulk, that solved my question.