← Back to team overview

yade-users team mailing list archive

Re: [Question #663620]: Too high unbalanced forces in Yade (even just aplying only gravity)

 

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

    Status: Answered => Open

Criss Zanelli is still having a problem:
Thanks for answering, Bruno.

 My script by now is really simple. I only create the geometry (the wall
and the floor), then in the engine only acts the gravity. Please if you
can run my script in order to check the the magnitud of the unbal force
(ploted) I would really appreciate it.


#Script

from yade import qt
from numpy import arange
import numpy as np
import random
from yade import polyhedra_utils
from yade import plot

aceleration=0 #m/s2
damping=0.80
#O.dt=1e-9

m = PolyhedraMat()
m.density = 2500  #kg/m3
m.kn = 1e7 #Pa
m.ks = 1e7 #Pa
m.young = 6.02e11  #Pa
m.frictionAngle = 0.610 #rad35
O.materials.append(m)

mfloor = PolyhedraMat()
mfloor.density = 1e10 #kg/m3
mfloor.kn = 1e15 #Pa
mfloor.ks = 1e15 #Pa
mfloor.young = 6.02e11  #Pa
mfloor.frictionAngle = 0.873 #rad50
O.materials.append(mfloor)

# dimenssions of the pirca  ****************************************************
Length=6 #m
Heigth=1.0 #m
Width=0.35

# dimensions of the rock blocks ****************************************************
ancho = Width #m
largo = 0.3 #m
alto = .25  #m

N=int(Heigth/alto)  
M=int(Length/largo) 
print 'Numero de filas', N
print 'Altura de pirca', Heigth,'m'
print 'Aceleracion total', aceleration,'m/s2'

# composition of the wall************************************************************
vertices1 = [[0,0,0],[ancho,0,0],[ancho,largo,0],[ancho,largo,alto],[0,largo,0],[0,largo,alto],[0,0,alto],[ancho,0,alto]]
for i in range(0,M):	      
	for j in range(0,N):   
		b = polyhedra_utils.polyhedra(m,v=vertices1)
                b.state.pos = (0,(i+1)*largo,(j+1)*alto)
                O.bodies.append(b)   
           
# restrinction of the degree of freedom lateral ****************************************

vertices2 =
[[0,0,0],[ancho,0,0],[ancho,0.1,0],[ancho,0.1,Heigth],[0,0.1,0],[0,0.1,Heigth],[0,0,Heigth],[ancho,0,Heigth]]

rigth = polyhedra_utils.polyhedra(m,v=vertices2, color=(.6,.4,.3))
rigth.state.pos = (0,0.1,Heigth/2+alto/2)
O.bodies.append(rigth)

left = polyhedra_utils.polyhedra(m,v=vertices2,color=(.6,.4,.3))
left.state.pos = (0,Length+.2,Heigth/2+alto/2)
O.bodies.append(left)

# floor  ***********************************************************

vertices3 = [[-1,-1,0],[-1,7,0],[4,-1,0],[4,7,0],[-1,-1,-0.1],[-1,7,-0.1],[4,-1,-0.1],[4,7,-0.1]]
floor = polyhedra_utils.polyhedra(mfloor,v=vertices3, color=(.6,.4,.3))
floor.state.pos = (1.5,3,0.075)
O.bodies.append(floor)

O.bodies[80].state.blockedDOFs='xyz'
O.bodies[81].state.blockedDOFs='xyz'
O.bodies[82].state.blockedDOFs='xyz'

#FORCE ***********************************************
#def addF():
# for a in range (0,M):
#    O.forces.addF(N*a, (523.43,0,0), permanent=True)
#    O.forces.addF(N*a+1, (373.88,0,0), permanent=True)
#    O.forces.addF(N*a+2, (224.33,0,0), permanent=True)
#    O.forces.addF(N*a+3, (74.78,0,0), permanent=True)

# ENGINE
********************************************************************************

def checkUnbalanced():
   if unbalancedForce()<.01:  # to ensure stability
     O.pause()
     plot.saveDataTxt('bbb.txt.bz2')

if O.iter>0: 
   print O.bodies[36].state.pos[0], O.bodies[37].state.pos[0], O.bodies[38].state.pos[0],O.bodies[39].state.pos[0]
 
def addPlotData():
#plot the displacement of each block of the column located in the midle of the wall
    plot.addData(iteracion_distrib1=O.iter,Unbalanced=unbalancedForce())


plot.plots={'iteracion_distrib1':('Unbalanced')}

O.engines=[
   ForceResetter(),
   InsertionSortCollider([Bo1_Polyhedra_Aabb()],label='collider'),
   InteractionLoop(
      [Ig2_Polyhedra_Polyhedra_PolyhedraGeom(),Ig2_Facet_Polyhedra_PolyhedraGeom()],
      [Ip2_PolyhedraMat_PolyhedraMat_PolyhedraPhys()], # collision "physics"
      [Law2_PolyhedraGeom_PolyhedraPhys_Volumetric()]  # contact law -- apply forces
   ),
   NewtonIntegrator(damping=damping,gravity=(aceleration,0,-9.81)),  # constant aceleration in x 
   PyRunner(command='checkUnbalanced()',iterPeriod=50,label='checker'),
   PyRunner(command='addPlotData()',iterPeriod=50),
#   PyRunner(command='addF()',iterPeriod=100),
   ]

collider.verletDist=.1
plot.live=True
plot.plot(subPlots=True)

#print ('D_36 %d  D_37 %d  D_38 %d D_39 d%'%(O.bodies[36].state.pos[0],
O.bodies[37].state.pos[0],
#O.bodies[38].state.pos[0],O.bodies[39].state.pos[0]))


qt.Controller()
qt.View()
R=yade.qt.Renderer()
R.bgColor=(1.,1.,1.)

# end *******************************************

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