← Back to team overview

yade-users team mailing list archive

[Question #216009]: Simualtion for the Workprocess of a Shovel

 

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

Dear all,
I have tried a workprocess of a shovel. In first 5800 steps work the Simulation stable, but after 6000 steps comes it a worning 'Segmentation fault (core dumped)
wuxin@37l4247e29-32:~/Desktop/Desktop/examples/Schaufel/Schaufel_Ra_2$'
 and brocken the simultion.
It is the Code:
Part 1,
from yade import utils
from numpy import linspace
from numpy import arange
import gts
import itertools
from yade import geom,pack,qt,plot
## PhysicalParameters 
Density=2400
frictionAngle=radians(35)
frictionAngleSt=radians(35)
frictionAngleBo=radians(23.5)
tc = 0.001
en = 0.3
es = 0.3
rMean=.0096
rRelFuzz=.0016
rRelFuzz=0.3
VelocityX=0

spheremat=O.materials.append(FrictMat(density=2600,young=175e6,poisson=0.3,frictionAngle=frictionAngleBo))
steel=O.materials.append(FrictMat(young=210e9, poisson=.25,frictionAngle=frictionAngle,density=8000))
kwMeshes={'color':[1,1,0],'wire':False,'dynamic':False,'material':steel}

from yade import ymport


sp=pack.SpherePack()
sp.makeCloud((1,0,0),(2,.5,0.8),rMean=rMean,rRelFuzz=rRelFuzz)
sp.toSimulation(material=spheremat)


wallmat=O.materials.append(FrictMat(density=1000,young=175e6,poisson=0.4,frictionAngle=0.1))
O.bodies.append(utils.facetBox((1, 0.25, 0.25),(1,0.25,0.25),wallMask=30,material=steel))



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=0.4,gravity=(0,0,-9.81),),
PyRunner(command='Save()',iterPeriod=1,label='checker'),
qt.SnapshotEngine(iterPeriod=60000,fileBase='/home/wuxin/Desktop/Desktop/examples/Schaufel/Schaufel_Ra_2/s80-',label='snapshooter'),
]
O.dt=.3*utils.PWaveTimeStep()

def Save():
    if utils.unbalancedForce() >.11: return
    if max([b.state.pos[2]+b.shape.radius for b in O.bodies if isinstance(b.shape,Sphere)])>0.48: return
    checker.command='Save_Teil1()'

def Save_Teil1():
    O.save('/home/wuxin/Desktop/Desktop/examples/Schaufel/Schaufel_Ra_2/KIES.xml.bz2')
    O.saveTmp()
    O.pause()



qt.Controller()

qt.View()

O.run()

Part 2,

O.load('/home/wuxin/Desktop/Desktop/examples/Schaufel/Schaufel_Ra_2/KIES.xml.bz2') 

import math
from yade import utils
from numpy import linspace
from numpy import arange
import gts
import itertools
from yade import geom,pack,qt,plot
## PhysicalParameters 
Density=2650
frictionAngle=radians(35)
frictionAngleSt=radians(35)
frictionAngleBo=radians(23.5)
tc = 0.001
en = 0.3
es = 0.3
rMean=.0096
rRelFuzz=.0016
rRelFuzz=0.3
VelocityX=0


spheremat=O.materials.append(FrictMat(density=2650,young=175e6,poisson=0.3,frictionAngle=frictionAngleBo))
steel=O.materials.append(FrictMat(young=210e9, poisson=.25,frictionAngle=frictionAngle,density=8000))
kwMeshes={'color':[1,1,0],'wire':False,'dynamic':False,'material':steel}

from yade import ymport
ori = Quaternion(Vector3(1,0,0),math.pi/2.0)
fctIds=O.bodies.append(ymport.gmsh('loeffel-0.mesh',shift=Vector3(0.575,0.25,0.487),scale=0.05,orientation=ori, **kwMeshes))

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=0.4,gravity=(0,0,-9.81),),
PyRunner(command='addplotdata()',iterPeriod=10),
CombinedKinematicEngine(ids=fctIds,comb=[TranslationEngine(translationAxis=[1,0,0],velocity=0,label='Tran1'),TranslationEngine(translationAxis=[0,0,1],velocity=0,label='Tran2'),RotationEngine(rotationAxis=[0,-1,0],rotateAroundZero=True,angularVelocity=0,zeroPoint=(0,0,0))],label='Engin'),

PyRunner(command='Kinematik_Kontroll()',iterPeriod=1,label='checker'),
PyRunner(command='RTranslation()',iterPeriod=1,label='checker3'),
qt.SnapshotEngine(iterPeriod=6000,fileBase='/home/wuxin/Desktop/Desktop/examples/Schaufel/Schaufel_Ra_2/s80T2A-',label='snapshooter'),
]


def Kinematik_Kontroll():
    for n in fctIds:
        PX4=(O.bodies[n].state.pos[2]-O.bodies[n].state.refPos[2])
    if PX4>0.28:
       checker2.command='T3()'
       plot.saveDataTxt('Result.txt',vars=('PX','Fx'))
       O.pause()
    O.engines=O.engines+[PyRunner(command='T1()',iterPeriod=1)]    

def RTranslation():
    for j in fctIds:
        PX1=(O.bodies[j].state.pos[0]-O.bodies[j].state.refPos[0])
    if PX1>0.35:
       checker3.command='RT()'
    else:    
       return


def T1():
    T=O.iter
    Vx=O.dt*(float (T**(0.5)))*2000.0
    Engin.comb[0].velocity=Vx
    for l in fctIds:
        PX2=(O.bodies[l].state.pos[0]-O.bodies[l].state.refPos[0])
    if PX2<0.3:
       Vy=0
       return
    else:
       Vy=O.dt*(float (T**(0.5)))*1100.0
       Engin.comb[1].velocity=Vy
       return
    

def RT():
    Vr=O.dt*(float (T**(0.5)))*900.0
    Engin.comb[2].angularVelocity = Vr

def T3():
    Engin.comb[2].angularVelocity =0.0
    Engin.comb[0].velocity =-7.0


O.dt=.3*utils.PWaveTimeStep()

yade.plot.plots={'t':('FX',),'t':('PX,')}

def addplotdata():
  Fx1 = 0
  Fy1 = 0
  Fz1 = 0
  for i in fctIds:
    Fx1 += O.forces.f(i)[0]
    Fy1 += O.forces.f(i)[1]
    Fz1 += O.forces.f(i)[2]
  plot.addData(t=O.time,i=O.iter,Fx=math.sqrt(((Fx1)**2)+((Fy1)**2)+((Fz1)**2)),PX=(O.bodies[i].state.pos[0]-O.bodies[i].state.refPos[0]))

def stopSimulation():
  if Engin.comb[0].velocity<0:
     plot.saveDataTxt('Result_84.txt',vars=('PX','Fx'))
     O.pause()       
  else:    
     return

plot.liveInterval=2.0
plot.plots={'PX':('Fx',),}
plot.plot()

O.saveTmp()
qt.Controller()

qt.View()

O.run()
Thanks in advance

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.