How to change the strainRate value of TriaxialCompressionEngine during the simulation period?

Asked by Xifan Li

The problem I have got: [1]

In the last two days of trial and error and thinking, I have discovered that the strain rate in TriaxialCompressionEngine can be changed when the stress loading axis becomes negative,

[2] so what I want to know is whether I can have a situation in the simulation where the strain rate can become negative when the stress in a certain axis reaches a certain value.

[3] However, I have found that once the simulation is started, it seems that the preset code in the engine cannot be changed later in the code (i.e. the strainRate set in the engine is constant at the beginning), so I would like to know if there is a way to make the strainRate change during a process?

[4] I have also noticed that there is a code that can be used for making an engine temporarily deactivated and only resurrect it at a later point-------dead(=false). So I want to know how to apply this code to my simulation code.

[5] I have put the code 'dead = True' to my simulation code, yes the simulation did not run at all. But regarding to the demonstration of the code: ' can be used for making an engine temporarily deactivated and only resurrect it at a later point.' How can I activate this engine 'at a later point'? And How to define the 'later point'?


Question information

English Edit question
Yade Edit question
No assignee Edit question
Solved by:
Xifan Li
Last query:
Last reply:
Revision history for this message
Bret Ritchie (ritchie141) said :

Most studies on strain rate effects on shearing behavior of saturated clay have employed quasi-static triaxial compression tests under strain-controlled conditions, potentially with either pore water pressure measurements, or impulse loading compression tests which were under stress-controlled conditions.

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


I would like to help you, but will you please separate your questions so that we can answer them individually? One question per thread, thank you so much for taking the time to read [2] to understand how we are working to make this knowledge base sustainable and reusable for future users.

As we point out in [1]:

"Warning This engine is deprecated, please switch to TriaxialStressController if you expect long term support."

So I would suggest you switch to TriaxialStressController.




Revision history for this message
Xifan Li (shelvan) said :

Thank you Robert, I have changed the engine I use from TriaxialCompressionEngine to TriaxialStressController,

My code is below.

This code can run normally, but it still cannot make the cyclic loading realizable.

[1] So I would like to know how to change the parameters in the TriaxialStressController engine while the simulation is running? (Like change the triax.goal1 and tiax.goal2 and the stressMask?


from yade import pack
# The following 5 lines will be used later for batch execution
 num_spheres=1000,# number of spheres
 compFricDegree = 30, # contact friction during the confining phase
 key='_triax_base_', # put you simulation's name here
from yade.params import table

num_spheres=table.num_spheres# number of spheres
targetPorosity = 0.43 #the porosity we want for the packing
compFricDegree = table.compFricDegree # initial contact friction during the confining phase (will be decreased during the REFD compaction process)
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=-0.02 # loading rate (strain rate)
damp=0.2 # damping coefficient
stabilityThreshold=0.01 # we test unbalancedForce against this value in different loops (see below)
young=5e6 # contact stiffness
mn,mx=Vector3(0,0,0),Vector3(10,10,.1) # corners of the initial packing

## create materials for spheres and plates

## create walls around the packing

## use a SpherePack object to generate a random loose particles packing



 maxMultiplier=1.+2e4/young, # spheres growing factor (fast growth)
 finalMaxMultiplier=1.+2e3/young, # spheres growing factor (slow growth)
 thickness = 0,


 stressMask = 1,




 TriaxialStateRecorder(iterPeriod=100, file='WallStresses.txt'),
 PyRunner(command='triaxload()',iterPeriod=1, label='triaxload'),

 #PyRunner(command='triaxload()',realPeriod=2, label='triaxload')

triax.stressMask = 1

def triaxload():
 if abs(O.triax.stress(triax.wall_top_id)[1])> 150000:
  O.triax.stressMask = 1

def triaxunload():
 if abs(triax.stress(triax.wall_top_id)[1])< 5e4:
  triax.stressMask = 1

from yade import plot

def history():


plot.plots={'e11': ('s11',),'e22': ('s22',)}


Revision history for this message
Jérôme Duriez (jduriez) said :

Please do not repeat yourself in two different questions (here and

Revision history for this message
Xifan Li (shelvan) said :