yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #09053
[Bug 923929] Re: OMP force container fails to reset forces on clump members
Ok, the fix was in fact not sufficient, as shown by François Kneib with the script below.
An improved fix is in rev. fc20180e55ae1bb774fdce
To see the bug, run the script below after commenting
https://github.com/yade/trunk/blob/fc20180e55ae1bb774fdce750300660af7bad76a/pkg/dem/NewtonIntegrator.cpp#L101
#!/usr/local/bin/yade-trunk -x
# -*- coding: utf-8 -*-
# encoding: utf-8
from yade import pack,ymport,export,geom,bodiesHandling, plot
import math
from yade import qt
import numpy as np
O.periodic=False
damp=0.1
compFricDegree=30.
finalFricDegree=30.
length=1.2
height=1.8
width=1.2
thickness=0.00001
radius=1.3*0.07
EY=1e6 #Young modulus
stressGoal=30
stressTolerance=0.01
vol=length*height*width
#O.cell.hSize=Matrix3( length, 0, 0,
# 0, 3.*height, 0,
# 0, 0, width)
O.materials.append(CohFrictMat(isCohesive=True,density=1e3,young=EY,poisson=0.3,momentRotationLaw=1,frictionAngle=radians(finalFricDegree),normalCohesion=10e10,shearCohesion=10e10,label='boxMat'))
O.materials.append(CohFrictMat(isCohesive=True,density=1e3,young=EY,poisson=0.5,momentRotationLaw=1,frictionAngle=radians(compFricDegree),normalCohesion=10e7,shearCohesion=10e7,label='sphereMat'))
upBox = utils.box( center=(0,2*height+thickness/2.0,0),
extents=(length*100.0,thickness/2.0,width*100.0),
fixed=1,
wire=False,
material='boxMat')
lowBox = utils.box( center=(0,height-thickness/2.0,0),
extents=(length*100.0,thickness/2.0,width*100.0),
fixed=1,
wire=False,
material='boxMat')
O.bodies.append([upBox,lowBox])
sp=pack.SpherePack()
c1=pack.SpherePack([((0,0,0),radius),((radius,0,0),radius)])
sp.makeClumpCloud((0.,height+thickness/2.,0.),(length,2.*height-thickness/2.,width),[c1],periodic=False)
bds=sp.toSimulation(material='sphereMat')
O.usesTimeStepper=False
O.dt=1e-4
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Box_Aabb(),Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()],allowBiggerThanPeriod=True),
InteractionLoop([Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='ip2')],[Law2_ScGeom6D_CohFrictPhys_CohesionMoment()]),
# GlobalStiffnessTimeStepper(active=1,timeStepUpdateInterval=100,timestepSafetyCoefficient=0.7,defaultDt=utils.PWaveTimeStep()),
NewtonIntegrator(damping=damp,gravity=[0.,-10.,0.],exactAsphericalRot=0),
]
def plotStress():
stress = getStress(vol)
plot.addData(
iter=O.iter,
stress00=(stress[0,0]),
stress01=(stress[0,1]),
stress02=(stress[0,2]),
stress10=(stress[1,0]),
stress11=abs(stress[1,1]),
stress12=(stress[1,2]),
stress20=(stress[2,0]),
stress21=(stress[2,1]),
stress22=abs(stress[2,2]),
f_total0=-O.forces.f(0)[0]/(O.cell.hSize[0,0]*O.cell.hSize[2,2]),
f_total1=-O.forces.f(0)[1]/(O.cell.hSize[0,0]*O.cell.hSize[2,2]),
f_total2=-O.forces.f(0)[2]/(O.cell.hSize[0,0]*O.cell.hSize[2,2]),
gamma=O.bodies[0].state.pos[0]/O.bodies[0].state.pos[1],
volume=vol,
#UBF=utils.unbalancedForce(),
y=O.bodies[0].state.pos[1]-O.bodies[1].state.pos[1])
#O.engines = O.engines+[PyRunner(command='plotStress()',iterPeriod=100)]
plot.plots={'iter':('stress11','stress22',None,'volume')}
#plot.plot()
phase=0
def main():
global phase
if phase==0:
if(abs(getStress(vol)[1,1])<stressGoal-stressTolerance):growParticles(1.01,1,1)
elif(abs(getStress(vol)[1,1])>stressGoal+stressTolerance):growParticles(0.99,1,1)
elif(unbalancedForce()<1e-3):phase+=1
if phase==1:
phase+=1
O.pause()
#O.engines = O.engines+[PyRunner(command='main()',iterPeriod=100)]
#O.run(10000,1)
O.saveTmp()
--
You received this bug notification because you are a member of Yade
developers, which is subscribed to Yade.
https://bugs.launchpad.net/bugs/923929
Title:
OMP force container fails to reset forces on clump members
Status in Yet Another Dynamic Engine:
Incomplete
Bug description:
When clumps are used and no gravity engine is present, force containers are not reseting the forces on clump members. Junk values are accumulated over time and the clump itself soon disappears.
A workaround is to addForce(0,0,0) once at startup on all bodies, this is done in Newton::action() currently.
This is most probably (still to check) because containers sizes are checked vs. body Id only in addForce, which is never applied on clump members before they are in contact with something. Not clear is why the same problem does not appear also on standalone bodies.
The crashing example was obtained from a series of personal scripts from Klaus Thoeni, not disclosed here.
To manage notifications about this bug go to:
https://bugs.launchpad.net/yade/+bug/923929/+subscriptions
References