three spheres with roling

Asked by Pawel

I have very simple test 3 spheres and one in middle is moving - question what is wrong and there are no rolling?

# basic simulation showing sphere falling ball gravity,
# bouncing against another sphere representing the support
os.environ['OMP_NUM_THREADS']='8'
import math
import random
# DATA COMPONENTS

promien_k = (3/(4*math.pi))**(1./3)

young_k = 1e9
poisson_k = 0.25
density_k = 1
vObnizenia = -0.5*promien_k
frictAngle = atan(0.6)

#O.materials.append(FrictMat(young=young_k, poisson=poisson_k, density=density_k, frictionAngle=atan(0.3), label='kula'))

O.materials.append(CohFrictMat(young=young_k, poisson=poisson_k, density=density_k, frictionAngle=frictAngle,normalCohesion=0, shearCohesion=0, momentRotationLaw=False, label='kula'))

O.bodies.append([
  utils.sphere(center=(0,0,0),radius=promien_k,fixed=True,material='kula')
  ],)
O.bodies.append([
  utils.sphere(center=(0.5*promien_k,0,1.95*promien_k),radius=promien_k,fixed=False,material='kula')
  ],)

O.bodies.append([
  utils.sphere(center=(-0.*promien_k,0,3.90*promien_k),radius=promien_k,fixed=False,material='kula')
  ],)

O.bodies[1].state.blockedDOFs='zx'
O.bodies[2].state.blockedDOFs='zx'

O.dt=utils.PWaveTimeStep()

#########################################
nazwaPliku = "wyniki/kule"
nazwaPlikuIter = "wyniki/Kule_iter_30z"
############### Parametry zapisu c++ ########
print("DT do zapisu")
step = O.dt
PiterSave = 10 #ile zapisow w pliku
PtimeSr = 3*step
PtimeStart = 0. #start zapisu
PdeltaTime = 0.005 #1000*step #skok miedzy zapisami

TimeStartAll=1000000
DeltaTimeAll=10000
################################
################################
# FUNCTIONAL COMPONENTS

# simulation loop -- see presentation for the explanation
O.engines=[
 VppSaveInteractions(fileName=nazwaPlikuIter, iterSave= PiterSave, timeSr = PtimeSr, timeStart = PtimeStart, deltaTime= PdeltaTime,timeStartAll = TimeStartAll,deltaTimeAll = DeltaTimeAll ),
   ForceResetter(),
   PyRunner(command='O.forces.addMove(1,(vObnizenia*O.dt,0,0))',iterPeriod=1),
   InsertionSortCollider([Bo1_Sphere_Aabb(aabbEnlargeFactor=1),Bo1_Wall_Aabb(),Bo1_Facet_Aabb()]),
   InteractionLoop(
  [Ig2_Sphere_Sphere_ScGeom6D(interactionDetectionFactor=1.3),
  Ig2_Wall_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom6D()],
  [Ip2_FrictMat_FrictMat_FrictPhys(),
  Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True),
  ],
  [Law2_ScGeom_FrictPhys_CundallStrack(),
  ]
 ),
   # apply gravity force to particles
   GravityEngine(gravity=(0,0,-9.81)),
   # damping: numerical dissipation of energy
   NewtonIntegrator(damping=0.2)
]

# set timestep to a fraction of the critical timestep
# the fraction is very small, so that the simulation is not too fast
# and the motion can be observed

# save the simulation, so that it can be reloaded later, for experimentation
O.saveTmp()
Gl1_Sphere.stripes=True
Gl1_Sphere.quality=1
yade.qt.Controller(), yade.qt.View();

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Pawel
Solved:
Last query:
Last reply:
Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#1

 File "temp.py", line 55, in <module>
    VppSaveInteractions(fileName=nazwaPlikuIter, iterSave= PiterSave, timeSr = PtimeSr, timeStart = PtimeStart, deltaTime= PdeltaTime,timeStartAll = TimeStartAll,deltaTimeAll = DeltaTimeAll ),
NameError: name 'VppSaveInteractions' is not defined

Revision history for this message
Pawel (pawel-p) said :
#2

Hi Bruno
Please simply comment this line - it is my C++ function.

The problem is that when the middle sphere is moving the upper should roll - but it is not doing it.

Best
Pawel

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#3

I think it is a bug in O.forces.addMove.
Could you please clean your example and paste it again as a bug report?
title like "O.forces.addMove breaks contact integration".

Solution forget addMove and impose velocity directly.

Bruno

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

O.bodies[1].state.blockedDOFs="xyzXYZ"
O.bodies[1].state.vel=(-0.1,0,0)

Then the top sphere rotates.

Bruno

Revision history for this message
Pawel (pawel-p) said :
#5

Hi Bruno
Thank you for the answer.

I don't use the newest Yade - but it seems that the bug is still there.

Best
Pawel

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#6

> the bug is still there

No surprise. addMove() is deprecated I would say.
B