# yade-users team mailing list archive

## Re: [Question #707430]: Contact model for differentiating between static and dynamic friction

```Question #707430 on Yade changed:

Status: Solved => Open

Paul Schröder is still having a problem:
Thanks for your feedback, Karol and thanks for the sample code,

that helped me a lot and also answered my question so far. I just have a small question about this, which is rather less related to the friction value itself:
Why does the rotational speed of the particle sp1 not decrease despite the counteracting friction force. How can friction dissipation be activated in the Mindlin-material-model?

In addition, for future readers, I would like to extend the above
example in the code shown below to include the friction values from the
different material pairings distinguished in my other question.

With best wishes, Paul

############
###### PARAMS
mu_static00 = 0.8
mu_static01 = 0.4
mu_static11 = 0.1
mu_dynamic00 = 0.5
mu_dynamic01 = 0.3
mu_dynamic11 = 0.1

##### FUNCTIONS
def check_interactions():
for i in O.interactions:
b1, b2 = O.bodies[i.id1],O.bodies[i.id2]
if i.phys.isSliding:
if b1.mat.id == idMat0 and b2.mat.id == idMat0:
i.phys.tangensOfFrictionAngle = mu_dynamic00
elif (b1.mat.id == idMat0 and b2.mat.id == idMat1) or (b1.mat.id == idMat1 and b2.mat.id == idMat0):
i.phys.tangensOfFrictionAngle = mu_dynamic01
elif b1.mat.id == idMat1 and b2.mat.id == idMat1:
i.phys.tangensOfFrictionAngle = mu_dynamic11
else:
print("Kombination Gleitreibpartner nicht vorgesehen")
else:
if b1.mat.id == idMat0 and b2.mat.id == idMat0:
i.phys.tangensOfFrictionAngle = mu_static00
elif (b1.mat.id == idMat0 and b2.mat.id == idMat1) or (b1.mat.id == idMat1 and b2.mat.id == idMat0):
i.phys.tangensOfFrictionAngle = mu_static01
elif b1.mat.id == idMat1 and b2.mat.id == idMat1:
i.phys.tangensOfFrictionAngle = mu_static11
else:
print("Kombination Haftreibpartner nicht vorgesehen")

###### MATERIALS
idMat0 = O.materials.append(FrictMat(frictionAngle = atan(mu_static00), label='Mat0'))
idMat1 = O.materials.append(FrictMat(frictionAngle = atan(mu_static11), label='Mat1'))

###### BODIES
sp1 = O.bodies.append(sphere((0,0,0),0.1, fixed = True, material = O.materials['Mat0']))
sp2 = O.bodies.append(sphere((0,0.199,0),0.1, fixed = True, material = O.materials['Mat1']))

# rotate one sphere
O.bodies[sp1].state.angVel = (2.5e-3,0,0)

###### ENGINES
O.engines=[
ForceResetter(),
InsertionSortCollider([Bo1_Sphere_Aabb()]),
InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom()],
[Ip2_FrictMat_FrictMat_MindlinPhys()],
[Law2_ScGeom_MindlinPhys_Mindlin()],
),
NewtonIntegrator(),
PyRunner(command = "plot.addData(t = O.time, F = O.interactions[0,1].phys.shearForce.norm(), v1 = O.bodies[sp1].state.angVel[0], v2 = O.bodies[sp2].state.angVel[0])", virtPeriod = 1),
PyRunner(command = "check_interactions()", iterPeriod = 100),#
]

O.dt = PWaveTimeStep()*0.5

plot.plots = {'t':(('F','b-'),None,('v1','g--'),('v2','r--'))}
plot.plot(subPlots = False)

O.run()

--