← Back to team overview

yade-users team mailing list archive

Re: [Question #696060]: How to make some stress plates consist of 3 circles (that have radius gradually (0.5, 1, 2)?

 

Question #696060 on Yade changed:
https://answers.launchpad.net/yade/+question/696060

    Status: Needs information => Open

Defri gave more information on the question:
1. The following link are the images about what I want to achieve
https://cutt.ly/GzVIYuA  (I am trying to get stress plate due to
calculate the stress increment from boulder)

2. what is "circle of stress plate"?
what does "having radius dimension gradually" mean?
what is "contact force"?

I attach the link that is the images to describe what I need to achieve

3.  what is "the facet"?
I attach the link that is the images to describe what I need to achieve

4. I got "IndexError: Body id out of range."

Yes, it is because the boulder which is O.bodies[3011] has not appeared yet, when the boulder has appeared, then IndexError becomes stopped.
I have tried to change it, and I hope you could help me to check, do you think it is normal now to run it? 

5.  -PyRunner
-realperiod
-global boulder
-O.run
-set checker.command='stress_rad1()' directly in checkUnbalanced

I have solved all by following your directions

THANK YOU

this is my existing code now:

##Sphere Cylinder pack
from yade import pack,plot,utils,export
import math
from pylab import rand #for sand color

O.bodies.append(geom.facetBox((0,0,0),(5,2,1.5),wallMask=31))
sp=pack.SpherePack()
sp.makeCloud((-5,-2,-1.5),(5,2,1.5),rMean=.14,rRelFuzz=.1,num=3000)
sp.toSimulation(color=(0.6+0.15*rand(),0.5+0.15*rand(),0.15+0.15*rand()))

##Define material of the grains
b=O.bodies[0]
b.state.blockedDOFs='xyzXYZ'
b.state.vel=(0,0,0)
O.materials.append(FrictMat(young=1e7,poisson=.3,density=2700,frictionAngle=18))

##Make a floor
O.bodies.append(wall((0,0,-1.5),axis=2))

##Engines and Constitutive Law
O.engines=[ForceResetter(),
 	InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]), #move for sphere, facet, wall
 	InteractionLoop([Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom()], #interaction between them
   [Ip2_FrictMat_FrictMat_FrictPhys()], # ip2 list (just one list!)
   [Law2_ScGeom_FrictPhys_CundallStrack()]), # law2 list
   NewtonIntegrator(damping=.3,gravity=[0,0,-9.81]),
   PyRunner(command='checkUnbalanced()',iterPeriod=100,label='checker'),
   PyRunner(command='stress_rad1()')
   #VTKRecorder(fileName='tes',recorders=['all'],iterPeriod=100),
   ]

O.dt=.9*PWaveTimeStep()

def checkUnbalanced():
	if O.iter<1000:return # at the very start, unbalanced force can be low as there is only few contacts, but it does not mean the packing 										is stable
	O.materials.append(FrictMat(young=1e8,poisson=0.2,density=2700,frictionAngle=25))
	O.bodies.append(utils.sphere(center=(0,0,5),radius=2,color=[0,1,1]))
	O.bodies[0].state.mass=2000
	checker.command='unloadBoulder()'
	checker.command='stress_rad1()'

def unloadBoulder():
	abs(O.forces.f(boulder.id)[0])

def stress_rad1():
	rad1=O.bodies[3011].shape.radius
	b1=O.bodies[3011]
	area1=pi*rad1**2
	area2=pi*((rad1+.8)**2-rad1**2)
	area3=pi*((rad1+1.2)**2-(rad1+.8)**2)
	ForceP=0
	StP=0
	ForceP1=0
	StP1=0
	ForceP2=0
	StP2=0
	for i in range (10,3009):
		m=O.bodies[i]
		if(m.state.pos[1]>=-2) and (m.state.pos[1]<=2):
			if (m.state.pos[0]>=-1) and (m.state.pos[0]<=1) and (m.state.pos[2]<-.5):
				if (m.state.pos[0]**2+m.state.pos[1]**2)**.5<=rad1:     #1st area
						ForceP=abs(O.forces.f(m.id)[2])
						StP=ForceP/area1
				if ((m.state.pos[0]**2+m.state.pos[1]**2)**.5<=rad1+.8) and ((m.state.pos[0]**2+m.state.pos[1]**2)**.5>rad1):  #2nd area
						ForceP1=abs(O.forces.f(m.id)[2])
						StP1=ForceP1/area2
				if ((m.state.pos[0]**2+m.state.pos[1]**2)**.5<=rad1+1.2) and ((m.state.pos[0]**2+m.state.pos[1]**2)**.5>rad1+.8):  #3rd area
						ForceP2=abs(O.forces.f(m.id)[2])
						StP2=ForceP2/area3
												
	if O.iter>1000:
		plot.addData(z=b1.state.pos[2],Stress=StP,Stress1=StP1,Stress2=StP2,i=O.iter,t=O.time)
		
globals().update(locals())

plot.plots={'i':('z'),'t':('Stress','Stress1','Stress2')}

plot.plot(subPlots=True)
		

O.saveTmp()


I hope you could understand what I really want to achieve
Thank you in advance
Cheers!

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