about TriaxialStressController

Asked by Alireza Sadeghi

Hello all,

I have a problem. I want to compress particles with an isotropic compaction (for example with 10 kpa compression in the x, y, and z direction) and after that put the stress control in x and y directions (for example 10 kpa) and put strain (for example -0.2) in the z direction. I don't know how should I do this simulation with TriaxialStressController. Could you please give me a hint?
A sample of my code is:
#===========================================
from yade import utils, plot
from yade import pack, qt
from datetime import datetime

O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, isCohesive= True, young=1.95e7,
density=1532.2, poisson=0.3, frictionAngle= 0.0, fragile=False, label='Coke'))

O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, isCohesive= False, young=4e9,
density=1523.6, poisson=0.3, frictionAngle= 0.0, fragile=False, label='wall'))

walls=aabbWalls([(0,0,0),(2e-1,2e-1,2e-1)],thickness=0.0003,oversizeFactor=1.0,material='wall')
wallIds=O.bodies.append(walls)

nums=['t']

mats=['Coke']

coke=(5e-3,1000)

nums=pack.SpherePack()

nums.makeCloud((0,0,0),(2e-1,2e-1,2e-1),rMean=coke[0],rRelFuzz=1e-4,num=coke[1])

O.bodies.append([utils.sphere(c,r,material=mats[0],color=(0,0,1)) for c,r in nums])

O.engines=[
    ForceResetter(),
    InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb()]),
    InteractionLoop([Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
    [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
    [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
    ),
    NewtonIntegrator(damping=0.4),
    PyRunner(command='calm()',iterPeriod=10,label='calmEngine')

]

triax=TriaxialStressController(

 maxMultiplier=1.000,
 finalMaxMultiplier=1.000,
 thickness = 0,
 stressMask = 7,
 internalCompaction=False,
)

O.engines=O.engines+[triax]

triax.goal1=-1.0e5
triax.goal2=-1.0e5
triax.goal3=-1.0e5
triax.wall_back_activated=True

O.dt=2e-6

calmEngine.dead=True

triax2=TriaxialStressController(

 maxMultiplier=1.000,
 finalMaxMultiplier=1.000,
 thickness = 0,
 stressMask = 3,
 internalCompaction=False,
)

O.engines=O.engines+[triax2]

triax2.goal1=-1.0e5
triax2.goal2=-1.0e5
triax2.goal3=-0.2
triax2.wall_back_activated=True
#================================

Thank you very much for your help in advance.

Best Regards

Alireza

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Alireza Sadeghi
Solved:
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

Did you give a look at the corresponding example triax-tutorial/script-session1.py [*] ?

To achieve your goal you will need to master TriaxialStressController.goal* and TriaxialStressController.stressMask. Maybe not an easy task, for stressMask, at least, see the comment l. 88 of [*]

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

Revision history for this message
Alireza Sadeghi (asadeghime) said :
#2

Hello Jérôme,

Thank you for your help. I saw the code but it couldn't solve my problem. I want to do a simulation of triaxial test similar to periodic triaxial test [1] but its boundary is not priodic. Thank you for your help.

Best Regards

Alireza

[1] https://yade-dev.gitlab.io/trunk/tutorial-examples.html#periodic-triaxial-test

Revision history for this message
Robert Caulk (rcaulk) said :
#3

Hello,

> I want to do a simulation of triaxial test similar to periodic triaxial test [1] but its boundary is not priodic.

As pointed out by Jerome, script-session1.py is an example of a non-periodic triaxial test. Not only that, but it also shows you exactly how to switch from isotropic stress to stress in x and y with strain in z. It seems it is in your best interest to follow along that script. For documentation's sake, I will re convey from script-session1.py to here:

stress 10 kpa on x y z (bitmask-> 1 1 1)

triax.stressMask = x*1 + y*2 + z*4 = 7
triax.goal1 = triax.goal2 = triax.goal3 = 10 kpa

stress x y 10 kpa, strain z 0.2 (bitmask -> 1 1 0):

triax.stressMask = 3
triax.goal1=triax.goal2 = 10 kpa
triax.goal3 = -0.2

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

Revision history for this message
Alireza Sadeghi (asadeghime) said :
#4

Dear Robert,

Thank you very much for your help. I used the sample, but the code didn't stop. I think the threshold for instability force was too small. I run the below code, and in the second section of it (deviatoric part) it doesn't stop when it reach to -0.2 strain in z direction. What can I do for it?

Thank you very much for your help.

Best Regards

Alireza

#===============================================

from yade import utils, plot
from yade import pack, qt
from datetime import datetime

qtr=qt.Renderer()
qtr.bgColor=(1,1,1)

stabilityThreshold=0.01

#================= define the materials =======================

O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, isCohesive= True, young=6.81e8, density=1377.5e2, poisson=0.3, frictionAngle= 0.31, fragile=False, label='Coke'))

O.materials.append(CohFrictMat(normalCohesion= 1e20, shearCohesion= 1e20, isCohesive= False, young=4e9,
density=1523.6, poisson=0.3, frictionAngle= 0.0, fragile=False, label='wall'))

#=================== define walls ==============================

walls=aabbWalls([(0,0,0),(2e-1,2e-1,2e-1)],thickness=0.0003,oversizeFactor=1.0,material='wall')
wallIds=O.bodies.append(walls)

#=================== define packing ============================

nums=['t']

mats=['Coke']

coke=(5e-3,1000)

nums=pack.SpherePack()

nums.makeCloud((0,0,0),(2e-1,2e-1,2e-1),rMean=coke[0],rRelFuzz=1e-4,num=coke[1])

O.bodies.append([utils.sphere(c,r,material=mats[0],color=(0,0,1)) for c,r in nums])

#=================== define Engine =============================

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb()]),
 InteractionLoop([Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
 [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys()],
 [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]
 ),
 NewtonIntegrator(damping=0.4,gravity=[0,0,0])
]
O.dt=2e-6

#================= APPLYING CONFINING PRESSURE ================

triax=TriaxialStressController(

 maxMultiplier=1.000,
 finalMaxMultiplier=1.000,
 thickness = 0,
 stressMask = 7,
 internalCompaction=False,
)

O.engines=O.engines+[triax]

triax.goal1=-1.0e5
triax.goal2=-1.0e5
triax.goal3=-1.0e5
triax.wall_back_activated=True

while 1:
  O.run(1000, True)
  unb=unbalancedForce()
  print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
  if unb<stabilityThreshold and abs(-100000-triax.meanStress)/100000<0.01:
    break

#===================== DEVIATORIC LOADING =======================
triax.stressMask = 3
triax.goal1=-1e5
triax.goal2=-1e5
triax.goal3=-0.2

O.saveTmp()

Revision history for this message
Robert Caulk (rcaulk) said :
#5

> in the second section of it (deviatoric part) it doesn't stop when it reach to -0.2 strain in z direction. What can I do for it?

As highlighted by the documentation [1], triax.stressMask assigns a strain rate. Therefore, I don't expect Yade to stop straining with that strain rate until intervened. How to intervene really depends on your problem and what you want to solve. In all cases you will want to periodically check your strain values and take action (e.g. change stress conditions, pause the simulation, save the packing etc) after some criteria is met. This is most commonly achieved using a tool called a "PyRunner", which is already exemplified in the triaxial example script [1] and is also very well documented in [3] and [4] :-)

[1]https://yade-dev.gitlab.io/trunk/yade.wrapper.html#yade.wrapper.TriaxialStressController.stressMask
[2]https://gitlab.com/yade-dev/trunk/blob/master/examples/triax-tutorial/script-session1.py
[3]https://yade-dev.gitlab.io/trunk/tutorial-data-mining.html#pyrunner
[4]https://yade-dev.gitlab.io/trunk/yade.wrapper.html#yade.wrapper.PyRunner

Revision history for this message
Alireza Sadeghi (asadeghime) said :
#6

Dear Robert,

Thank you very much for your help. It solved my problem.

Best Regards

Alireza