← Back to team overview

yade-users team mailing list archive

[Question #678799]: O.load but still in the first code

 

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

Hi,

In my first script,only if maxUnbalanced<3e-3 ,the process will enter the next function and save the  .gz file.But when i run the second script,the unbalancedForce is largger than 3e-3.Then until unbalancedForce is smaller than 3e-3 will start the compression.

1.Why the unbalancedForce become largger?

2.I've rewritten the triaxFinished function. Why still in the first compress until the unbalancedForce is small enough?

Thanks 

James
###############
first script:

# encoding: utf-8
from yade import pack, qt, plot

sigmaIso=-25000

O.periodic=True

frictionAngle1=0.0286
frictionAngle11=14.03624347

sphere=O.materials.append(FrictMat(young=64e9,poisson=0.12,density=2650,frictionAngle=radians(frictionAngle1),label='sphere'))

multiple=.001
length=3
psdSizes=[.18*multiple,.2*multiple,.21*multiple,.25*multiple,.27*multiple,.30*multiple,.31*multiple,.34*multiple,.38*multiple]
psdCumm=[0.11,0.27,0.45,0.73,0.88,0.95,0.98,0.99,1]

sp=pack.SpherePack()
sp.makeCloud((0,0,0),(length*multiple,length*multiple,length*multiple),psdSizes=psdSizes,psdCumm=psdCumm,distributeMass=True,periodic=True)
n=sp.toSimulation()

O.engines=[
	ForceResetter(),
	InsertionSortCollider([Bo1_Sphere_Aabb()]),
	InteractionLoop(
 		 [Ig2_Sphere_Sphere_ScGeom()],
  		[Ip2_FrictMat_FrictMat_FrictPhys()],
  		[Law2_ScGeom_FrictPhys_CundallStrack()]
 	),
 	PeriTriaxController(label='triax',
  		goal=(sigmaIso,sigmaIso,sigmaIso),stressMask=7,
  		dynCell=True,maxStrainRate=(1000,1000,1000),
  		maxUnbalanced=3e-3,relStressTol=1e-3,
  		doneHook='changeMaterial()'
 	),
 	NewtonIntegrator(damping=.1),
	PyRunner(command='num()',initRun=1,nDo=1),
]
O.dt=1*PWaveTimeStep()

def num():
   	print(O.bodies[-1].id)

def changeMaterial():
 	O.cell.trsf=Matrix3.Identity
 	for i in n:
        	 O.bodies[i].material.frictionAngle=radians(frictionAngle11)
	triax.doneHook='triaxFinished()'

def triaxFinished():
	O.cell.trsf=Matrix3.Identity
    	print 'Finished'
    	O.pause()

qt.Controller()
O.run()
O.wait()
O.save('four.yade.gz')
O.saveTmp()

#################
scecond script:
#!/usr/bin/python
from yade import pack, qt, plot

O.load('four.yade.gz')
O.run()
O.dt=1e-13

O.engines += [PyRunner(command='addPlotData2()',iterPeriod=1000)];

def triaxFinished():
 O.cell.trsf=Matrix3.Identity
 triax.goal=(0,0,-4000000)
 triax.stressMask=4
 triax.maxStrainRate=(0,0,30)
 triax.maxUnbalanced=1e-8
 triax.doneHook='functionToRunWhenFinished()'

def functionToRunWhenFinished():
    print 'Finished'
    O.pause()

def addPlotData2():
 	plot.addData(unbalanced=unbalancedForce(),i=O.iter,
  		sxx=-triax.stress[0],syy=-triax.stress[1],szz=-triax.stress[2],
  		exx=-triax.strain[0],eyy=-triax.strain[1],ezz=-triax.strain[2],
  		q=-triax.stress[2]+0.5*(triax.stress[0]+triax.stress[1]),
  		p=-(triax.stress[0]+triax.stress[1]+triax.stress[2])/3,
		k=(triax.stress[0]*0.5+triax.stress[1]*0.5)/triax.stress[2] 
 	)
	print('sxx=',-triax.stress[0],'syy=',-triax.stress[1],'szz=',-triax.stress[2])
	print(porosity())

plot.plots={'i':('unbalanced',),'i ':('sxx','syy','szz'),' i':('exx','eyy','ezz'),' p ':('q'),}
plot.plot()



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