← Back to team overview

yade-users team mailing list archive

[Question #700793]: About the "WallStresses_triax_base_" file in script-session1.py

 

New question #700793 on Yade:
https://answers.launchpad.net/yade/+question/700793

Hello everyone,

I am a new YADE user. I am using Yade 2020.01a. I ran the code script-session1.py from the triax-tutorial obtained in [1].

At the end of the simulation, the text file called "WallStresses_triax_base_" is obtained. This file saves the data for every 100 iterations. The file has 3 "groups" of data with the following characteristics:

1. From row 2 to 192, Iteration from 0 to 19000. Its characteristic is that it has no deformations. I understand that it is the data of the "APPLYING CONFINING PRESSURE" process.

2. From row 193 to 420, Iteration 0 to 22700. Its characteristic is that it has the greatest number of Iterations and the volumetric deformation goes from negative to positive. I understand that it is the data of the "REACHING A SPECIFIED POROSITY PRECISELY" process.

3. From row 421 to 804, Iteration 0 to 21100. They have the characteristic that the volumetric deformation is always negative and the data is very similar (equal?) to the data in the graph in matplotlib obtained at the end of the script simulation -session1.py
 
I would like to know if the above mentioned by me for the "WallStresses_triax_base_" file is correct so that I can better understand the code. Thank you very much for the help.

[1] https://gitlab.com/yade-dev/trunk/-/tree/master/examples/triax-tutorial


Here is the code used:

from yade import pack

###   DEFINING VARIABLES AND MATERIALS   ###

nRead=readParamsFromTable(
	num_spheres=1000,
	compFricDegree = 30, 
	key='_triax_base_',
	unknownOk=True
)
from yade.params import table

num_spheres=table.num_spheres
key=table.key
targetPorosity = 0.43
compFricDegree = table.compFricDegree
finalFricDegree = 30
rate=-0.02
damp=0.2
stabilityThreshold=0.01
young=5e6
mn,mx=Vector3(0,0,0),Vector3(1,1,1)

O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=radians(compFricDegree),density=2600,label='spheres'))
O.materials.append(FrictMat(young=young,poisson=0.5,frictionAngle=0,density=0,label='walls'))

walls=aabbWalls([mn,mx],thickness=0,material='walls')
wallIds=O.bodies.append(walls)

sp=pack.SpherePack()


clumps=False
if clumps:
 volume = (mx[0]-mn[0])*(mx[1]-mn[1])*(mx[2]-mn[2])
 mean_rad = pow(0.09*volume/num_spheres,0.3333)
 c1=pack.SpherePack([((-0.2*mean_rad,0,0),0.5*mean_rad),((0.2*mean_rad,0,0),0.5*mean_rad)])
 sp.makeClumpCloud(mn,mx,[c1],periodic=False)
 sp.toSimulation(material='spheres')
 O.bodies.updateClumpProperties()
else:
 sp.makeCloud(mn,mx,-1,0.3333,num_spheres,False, 0.95,seed=1)
 O.bodies.append([sphere(center,rad,material='spheres') for center,rad in sp])

###   DEFINING ENGINES   ###

triax=TriaxialStressController(
	maxMultiplier=1.+2e4/young,
	finalMaxMultiplier=1.+2e3/young,
	thickness = 0,
	stressMask = 7,
	internalCompaction=True,
)

newton=NewtonIntegrator(damping=damp)

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()]
	),
	GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.8),
	triax,
	TriaxialStateRecorder(iterPeriod=100,file='WallStresses'+table.key),
	newton
]

Gl1_Sphere.stripes=0
if nRead==0: yade.qt.Controller(), yade.qt.View()

###   APPLYING CONFINING PRESSURE   ###

triax.goal1=triax.goal2=triax.goal3=-10000

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

O.save('confinedState'+key+'.yade.gz')
print ("###      Isotropic state saved      ###")

###   REACHING A SPECIFIED POROSITY PRECISELY   ###

import sys
while triax.porosity>targetPorosity:
	compFricDegree = 0.95*compFricDegree
	setContactFriction(radians(compFricDegree))
	print ("\r Friction: ",compFricDegree," porosity:",triax.porosity,)
	sys.stdout.flush()
	O.run(500,1)

O.save('compactedState'+key+'.yade.gz')
print ("###    Compacted state saved      ###")

###   DEVIATORIC LOADING   ###

triax.internalCompaction=False

setContactFriction(radians(finalFricDegree))

triax.stressMask = 5

triax.goal2=rate
triax.goal1=-10000
triax.goal3=-10000

newton.damping=0.1

O.saveTmp()

###    Example of how to record and plot data     ###

from yade import plot

def history():
	plot.addData(e11=-triax.strain[0], e22=-triax.strain[1], e33=-triax.strain[2],
			ev=-triax.strain[0]-triax.strain[1]-triax.strain[2],
			s11=-triax.stress(triax.wall_right_id)[0],
			s22=-triax.stress(triax.wall_top_id)[1],
			s33=-triax.stress(triax.wall_front_id)[2],
			i=O.iter)

if 1:
  O.engines=O.engines[0:5]+[PyRunner(iterPeriod=20,command='history()',label='recorder')]+O.engines[5:7]
  O.engines.insert(4,PyRunner(iterPeriod=20,command='history()',label='recorder'))
else:
  O.engines[4]=PyRunner(iterPeriod=20,command='history()',label='recorder')

O.run(100,True)

plot.plots={'i':('e11','e22','e33',None,'s11','s22','s33')}
plot.plots={'e22':('s11','s22','s33',None,'ev')}

plot.plot()

#####  PLAY THE SIMULATION HERE WITH "PLAY" BUTTON OR WITH THE COMMAND O.run(N)  #####

plot.saveDataTxt('results'+key)


-- 
You received this question notification because your team yade-users is
an answer contact for Yade.