# three spheres with roling

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
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([
],)
O.bodies.append([
],)

O.bodies.append([
],)

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(),
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

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Pawel
Solved:
2019-01-24
Last query:
2019-01-24
2019-01-24
 Bruno Chareyre (bruno-chareyre) said on 2019-01-24: #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

 Pawel (pawel-p) said on 2019-01-24: #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

 Bruno Chareyre (bruno-chareyre) said on 2019-01-24: #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

 Bruno Chareyre (bruno-chareyre) said on 2019-01-24: #4

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

Then the top sphere rotates.

Bruno

 Pawel (pawel-p) said on 2019-01-24: #5

Hi Bruno

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

Best
Pawel

 Bruno Chareyre (bruno-chareyre) said on 2019-01-24: #6

> the bug is still there

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