yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #06834
Re: Periodic simulations (continued)
An example script will help maybe. See attached a modified version of
periodic triax.
Defining the initial (inclined) shape and resetting strains at a point
is one line each (l.9 and l.37).
There is not one line of c++ based on refSize in this simulation (l.9 is
defining refSize, then it's never used; l.37 is invalidating it, harmless).
Cheers.
Bruno
# coding: utf-8
# 2009 © Václav Šmilauer <eudoxos@xxxxxxxx>
"Test and demonstrate use of PeriTriaxController."
from yade import *
from yade import pack,log,qt
log.setLevel('PeriTriaxController',log.TRACE)
O.periodic=True
O.cell.hSize=Matrix3(0.1,0.1,0, 0,0.2,0, 0,0,0.1)
sp=pack.SpherePack()
num=sp.makeCloud(Vector3().Zero,(0.1,0.2,0.1),-1,.2,500,periodic=True,porosity=0.82)
O.bodies.append([utils.sphere(s[0],s[1]) for s in sp])
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_FrictPhys()],
[Law2_ScGeom_FrictPhys_CundallStrack()]
),
PeriTriaxController(dynCell=True,mass=0.2,maxUnbalanced=0.01,relStressTol=0.02,goal=(-1e4,-1e4,0),stressMask=3,globUpdate=5,maxStrainRate=(1.,1.,1.),doneHook='triaxDone()',reversedForces=True,label='triax'),
NewtonIntegrator(damping=.2),
PyRunner(iterPeriod=200,command='print "strain",triax.strain')
]
O.dt=utils.PWaveTimeStep()
qt.View()
phase=0
def triaxDone():
global phase
if phase==0:
print 'Here we are: stress',triax.stress,'strain',triax.strain
print 'Now εz will go from 0 to .2 while Ïx and Ïy will be kept the same.'
triax.goal=(-1e4,-1e4,-0.4)
O.cell.resetTrsf()
phase+=1
elif phase==1:
print 'Here we are: stress',triax.stress,'strain',triax.strain,'stiffness',triax.stiff
print 'Done, pausing now.'
O.pause()
References