The code of O.engines[5]=PyRunner(iterPeriod=20,command='history()') seems to don't work.
Hi, everybody.
I am learning an example of the triaxial test[1]. I have a question about it. When I run the following codes, the code of O.engines[
Here are the codes:
# -*- coding: utf-8 -*-
from yade import pack
#######
### DEFINING VARIABLES AND MATERIALS ###
#######
# The following 5 lines will be used later for batch execution
nRead=readParam
num_spheres=1000,# number of spheres
compFricDegree = 30, # contact friction during the confining phase
key='_
unknownOk=True
)
from yade.params import table
num_spheres=
key=table.key
targetPorosity = 0.43 #the porosity we want for the packing
compFricDegree = table.compFricD
finalFricDegree = 30 # contact friction during the deviatoric loading
rate=-0.02 # loading rate (strain rate)
damp=0.2 # damping coefficient
stabilityThresh
young=5e6 # contact stiffness
mn,mx=Vector3(
## create materials for spheres and plates
O.materials.
O.materials.
## create walls around the packing
walls=aabbWalls
wallIds=
## use a SpherePack object to generate a random loose particles packing
sp=pack.
clumps=False #turn this true for the same example with clumps
if clumps:
## approximate mean rad of the futur dense packing for latter use
volume = (mx[0]-
mean_rad = pow(0.09*
## define a unique clump type (we could have many, see clumpCloud documentation)
c1=pack.
## generate positions and input them in the simulation
sp.makeClumpCl
sp.toSimulatio
O.bodies.
else:
sp.makeCloud(
O.bodies.
triax=
maxMultiplier=
finalMaxMultip
thickness = 0,
stressMask = 7,
internalCompac
)
newton=
O.engines=[
ForceResetter(),
InsertionSortC
InteractionLoop(
[Ig2_
[Ip2_
[Law2_
),
## We will use the global stiffness of each body to determine an optimal timestep (see https:/
GlobalStiffnes
triax,
TriaxialStateR
newton
]
#######
### APPLYING CONFINING PRESSURE ###
#######
#the value of (isotropic) confining stress defines the target stress to be applied in all three directions
triax.goal1=
while 1:
O.run(1000, True)
unb=unbalance
print 'unbalanced force:',unb,' mean stress: ',triax.meanStress
if unb<stabilityTh
break
O.save(
print "### Isotropic state saved ###"
# DIY
print(triax.
print(triax.
#######
### REACHING A SPECIFIED POROSITY PRECISELY ###
#######
import sys #this is only for the flush() below
while triax.porosity>
compFricDegree = 0.95*compFricDegree
setContactFric
print "Friction: ",compFricDegree," porosity:
# print "\r Friction: ",compFricDegree," porosity:
sys.stdout.flush()
O.run(50,1)
O.save(
print "### Compacted state saved ###"
# DIY
print(triax.
print(triax.
#######
### DEVIATORIC LOADING ###
#######
##We move to deviatoric loading, let us turn internal compaction off to keep particles sizes constant
triax.internalC
## Change contact friction (remember that decreasing it would generate instantaneous instabilities)
setContactFrict
##set stress control on x and z, we will impose strain rate on y
triax.stressMask = 5
##now goal2 is the target strain rate
triax.goal2=rate
## we define the lateral stresses during the test, here the same 10kPa as for the initial confinement.
triax.goal1=-10000
triax.goal3=-10000
##we can change damping here. What is the effect in your opinion?
newton.damping=0.1
##Save temporary state in live memory. This state will be reloaded from the interface with the "reload" button.
O.saveTmp()
from yade import plot
### a function saving variables
def history():
plot.addData(
ev=-
s11=
s22=
s33=
DeviatorStre
i=O.iter)
O.engines[
Thanks!
[1] https:/
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- Yade Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Rong Zhao for more information if necessary.