# Using Capillary law and CohFrictPhys for rolling resistance

Hi all,

I was wondering if we can use the capillary law along with "Law2_ScGeom6D_CohFrictPhys_CohesionMoment" for the sake of considering the rolling resistance. I get an error (" <ERROR> Engine:76 virtual void Law2_ScGeom_CapillaryPhys_Capillarity::action(): The capillary law is not implemented for interactions using CohFrictPhys ") by such a combination of Laws.

I know "The only combinations of laws supported are currently capillary law + Law2_ScGeom_FrictPhys_CundallStrack and capillary law + Law2_ScGeom_MindlinPhys_Mindlin (and the other variants of Hertz-Mindlin)" [1]; but with the existence of the attribute "neverErase" for "Law2_ScGeom6D_CohFrictPhys_CohesionMoment" [2], I thought this might be possible. Here is my trial script (that works without capillary law):

#************ Packing generation ***********
# parameters:
phi0 = 0.5
uc = 100
conf = 10
num_particles = 10
Ey = 1.e7
rMin,rMax = 0.4e-5,0.8e-5
size=1e-4
mn,mx=Vector3(0,0,0),Vector3(size,size,size)

# materials properties:
sphMat=O.materials.append( CohFrictMat(density = 2600,young=Ey,poisson=1,frictionAngle=radians(phi0),isCohesive=False,momentRotationLaw=True,alphaKr=1.25,etaRoll=0.5, alphaKtw=0.0,etaTwist=0.0) )

#Walls:
wallIds=O.bodies.append(aabbWalls([mn,mx], thickness=0.,oversizeFactor=2,material=O.materials[boxMat])) # 1 = max, 2 = min

# Sphere cloud:
sp=pack.SpherePack()
sp.makeCloud(maxCorner=Vector3(size,size,size),num=num_particles,psdSizes=[2*rMin,2*rMax],psdCumm=[0,1]) # uniform psd in number
sp.toSimulation(material=O.materials[sphMat])

O.engines=[ForceResetter()
,InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb()])
,InteractionLoop(
[Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom6D()],
[Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(setCohesionNow=True,setCohesionOnNewContacts=True,label='ipcfm')],
[Law2_ScGeom6D_CohFrictPhys_CohesionMoment(always_use_moment_law=True,neverErase=True,useIncrementalForm=True)])
#,Law2_ScGeom_CapillaryPhys_Capillarity(capillaryPressure=uc*1.e3,label='capLaw2')
,GlobalStiffnessTimeStepper(timestepSafetyCoefficient=0.8)
,NewtonIntegrator(damping=0.6,label='newton')
,internalCompaction = 1
,label = 'tsc')
]

#************ Confinement ***********
tsc.goal1=tsc.goal2=tsc.goal3=-conf*1e3

while 1:
O.run(1000, True)
unb=unbalancedForce()
if O.iter % 1000 ==0:
print ('unbalanced force:',unb,' mean stress (Pa): ',-tsc.meanStress)
if unb<0.01 and abs((tsc.goal1-tsc.meanStress)/-tsc.goal1)<1.e-3:
for inter in O.interactions:
print(inter.id1,inter.id2,inter.phys.moment_bending.norm(),inter.phys.moment_twist.norm())
break
#############################################################################

I really appreciate if you can confirm the issue or help me to solve the problem.
Thanks a lot,
Mojtaba

## Question information

Language:
English Edit question
Status:
Solved
For:
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
2020-12-10
Last query:
2020-12-10
2020-12-10
 Jérôme Duriez (jduriez) said on 2020-12-10: #1

Hi,

It s impossible to negotiate with computers: if YADE tells you it does not work, then it does not work.

With some C++ coding (maybe not much) one possibility could be to switch CapillaryPhys one step in the inheritance tree [*], so that it becomes a child of CohFrictPhys ?

 Mojtaba (farahnak) said on 2020-12-10: #2

Thanks Jérôme Duriez, that solved my question.