← Back to team overview

yade-users team mailing list archive

[Question #699581]: How to inspect the body one by one in the cloud if I have 2 files YADE separately?

 

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

Dear all,

I have some confusions:
I would like to use the paraview to inspect the stress of the body (because if you see in the graph, that the stress is really big until more than 1 million kN/m^2), I wanna know what caused it to happen, but the problem is I made 2 files separately.
My question is:
  1. Is that the command I need to do is using VTKRecorder only?
  2. If yes, Where I need to put that and how? I made once (not in these files) only like I put VTKRecorder(fileName='tes',recorders=['all'],iterPeriod=100) on  the last row of O.engines. Is it correct only like that?
  3. On Which row I have to put the command?

###SCRIPT### FILE 1

##Sphere Cylinder pack
from yade import pack,plot,utils,export
import math
from pylab import rand #for sand color
O.trackEnergy=True

O.engines=[ForceResetter(),
 	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
 	InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()],
   [Ip2_FrictMat_FrictMat_FrictPhys()],
   [Law2_ScGeom_FrictPhys_CundallStrack()]),
   NewtonIntegrator(damping=.3,gravity=[0,0,-9.81])]

O.bodies.append(geom.facetBox((0,-1.7,0),(1.7,0,2),wallMask=4))
O.bodies.append(geom.facetBox((0,1.7,0),(1.7,0,2),wallMask=4))
O.bodies.append(geom.facetBox((-1.7,0,0),(0,1.7,2),wallMask=4))
O.bodies.append(geom.facetBox((1.7,0,0),(0,1.7,2),wallMask=4))

bottom=wall((0,0,-2),axis=2)
O.bodies.append(bottom)
sp=pack.SpherePack()
s=200
dmax=0.00050*s
dmin=0.00025*s
rMean=(dmax+dmin)/4
rRelFuzz=(dmax-dmin)/(dmax+dmin)
nums=10000
sp.makeCloud((-1.7,-1.7,-2),(1.7,1.7,1),rMean,rRelFuzz,num=nums)
#sp.makeCloud((-1.7,-1.7,1),(1.7,1.7,5),rMean,rRelFuzz,num=2*nums)

O.materials.append(FrictMat(young=600e6,poisson=.3,density=2700,frictionAngle=radians(17))) 

sp.toSimulation(color=(0.6+0.15*rand(),0.5+0.15*rand(),0.15+0.15*rand()))

##Define material of the grains
for i in range(9,len(O.bodies)):
	b=O.bodies[i]
	b.state.blockedDOFs='XYZ'
	b.state.vel=(0,0,0)

O.dt=PWaveTimeStep()

globals().update(locals())

O.saveTmp()


After all the bodies dropped under the gravity, in the Terminal, I typed In [1]: O.save('YADE/(directory and the name of file)')
Then I load it in this SCRIPT FILE 2:
	
#O.load('YADE/dennis_yade/drop/Sand_2_41794')
O.load('YADE/dennis_yade/drop/Sand_1_33509')

O.materials.append(FrictMat(young=600e6,poisson=0.3,density=2227,frictionAngle=radians(17),label='boulder'))
k=utils.sphere(center=(0,0,.3),radius=.45,color=[0,1,1],material='boulder')
O.bodies.append(k)
height=10
k.state.vel=(0,0,-(2*9.81*height)**.5)

from yade import pack,plot,utils,export

O.engines=O.engines+[PyRunner(command='stress_rad1()',iterPeriod=5)]

def stress_rad1():
	b1=O.bodies[-1]
	rad1=.25
	rad2=.5
	rad3=.75
	area1=pi*rad1**2 
	area2=pi*(rad2**2-rad1**2) 
	area3=pi*(rad3**2-rad2**2)
	ForceP=0
	StP=0
	ForceP1=0
	StP1=0
	ForceP2=0
	StP2=0
	for i in O.bodies[8].intrs():
		m=O.bodies[i.id2]
		dist=(m.state.pos[0]**2+m.state.pos[1]**2+(m.state.pos[2]+2)**2)**.5
		if dist<=rad1:     #1st area
				u=O.interactions[8,m.id]
				ForceP=ForceP+abs(u.phys.normalForce[2])
				StP=ForceP/area1	
		if dist>rad1 and dist<=rad2: #2nd area
				u1=O.interactions[8,m.id]
				ForceP1=ForceP1+abs(u1.phys.normalForce[2])
				StP1=ForceP1/area2
		if dist>rad2 and dist<=rad3:#3rd area
				u2=O.interactions[8,m.id]
				ForceP2=ForceP2+abs(u2.phys.normalForce[2])
				StP2=ForceP2/area3	
	Force=O.forces.f(b1.id)[2]					
	plot.addData(FzB=Force,z=b1.state.pos[2],Stress=StP,Stress1=StP1,Stress2=StP2,i=O.iter,t=O.time,velocity=b1.state.vel.norm())
		
globals().update(locals())
		
plot.plots={
	'i':('FzB',),'t':('Stress','Stress1','Stress2'),}

plot.plot(subPlots=True)


What should I do?

Thank you in advance!

Cheers!!

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