MatchTracker for Cohesion

Asked by Seti

Hi All,

As you may know the "iAdhesion" is computed from the minima of "iCohesion".

However I need to change this logic, I was told "MatchMaker" in Ip2_CohFrictMat_CohFrictMat_CohFrictPhys should do what I am looking for. I have tried below engine, however it does not work.

O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Box_Sphere_ScGeom(),Ig2_Wall_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom()],[Ip2_FrictMat_FrictMat_FrictPhys()],
                [Ip2_FrictMat_FrictMat_MindlinPhys(en=MatchMaker(matches=((mat1,mat2,.6),(mat2,mat2,.9))),es=MatchMaker(matches=((mat1,mat2,.6),(mat2,mat2,.9))),krot=3)],
                [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(normalCohesion=MatchMaker(matches=((mat1,mat2,500),(mat2,mat2,1e6))),shearCohesion=MatchMaker(matches=((mat1,mat2,50e6),(mat2,mat2,80e6))),label="cohesiveIp")], [Law2_ScGeom_MindlinPhys_Mindlin(includeMoment=True,includeAdhesion=True)],
                [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
   useIncrementalForm=True, #useIncrementalForm is turned on as we want plasticity on the contact moments
   always_use_moment_law=False, #if we want "rolling" friction even if the contact is not cohesive (or cohesion is broken), we will have to turn this true somewhere
   label='cohesiveLaw')]

Would you please advise?

Thanks

Seti

Question information

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

Hi Seti,
I suggest having a look at those guidelines, especially points 2,3 and 6:
https://yade-dem.org/wiki/Howtoask
Bruno

Revision history for this message
Jérôme Duriez (jduriez) said :
#2

Hi,

The above link suggests to ask concise questions, and I think it's also good to try to write yade scripts that are as concise as possible..

The small piece of script you provided is enough to show that your script does not follow this guideline. It seems you tried to stuff as many "Engine things" as possible into it, in a maybe desperate attempt to have something that works ;-)

In particular, your InteractionLoop definition is a mess, honestly.. The doc [1] says it has been defined "from 3 lists of Ig2, Ip2, Law functors": there should be three lists (between brackets "[..]") inside the parenthesis of InteractionLoop(...), see for instance [2]. Here, you have six of them...

As a general remark, I would suggest to give a very close look to [3] as a whole

[1] https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.InteractionLoop
[2] https://yade-dem.org/doc/user.html#basic-dem-model
[3] https://yade-dem.org/doc/user.html#base-engines

Revision history for this message
Seti (seti) said :
#3

Hi Jerome/Bruno,

Thanks for reply. Lets make it simple. Would you please help me to understand why below (simple) script does not work?

Thank you so much for your time.

#############

utils.readParamsFromTable(rMean=0.02,rRelFuzz=0.1,maxLoad=10e8,minLoad=10)
from yade.params.table import *
from yade import pack, plot

###### Define the material for your facet here
O.bodies.append(utils.geom.facetBox((0.5,0.5,0.5),(0.5,0.5,0.5),wallMask=31))

mat1 = O.materials.append(CohFrictMat(young=30e9,poisson=0.3,frictionAngle=radians(30),momentRotationLaw=True,etaRoll=1,density=2600,isCohesive=True,normalCohesion=1e6, shearCohesion=80e6,label='spheres1'))
mat2 = O.materials.append(CohFrictMat(young=30e9,poisson=0.3,frictionAngle=radians(30),momentRotationLaw=True,etaRoll=1,density=2600,isCohesive=True,normalCohesion=1e6, shearCohesion=80e6,label='spheres2'))

sp=pack.SpherePack()
sp.makeCloud((0,0,0),(1,1,1),rMean=rMean,rRelFuzz=rRelFuzz)

##### add the sphere pack to the simulation
sp.toSimulation()

##### add the sphere pack to the simulation

O.materials.append(FrictMat(young=1e10,poisson=0.1, frictionAngle = radians(0) , label='wallmat'))
wallmat = O.materials[-1]

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
   InteractionLoop([Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom(),Ig2_Wall_Sphere_L3Geom()],
   [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(normalCohesion=MatchMaker(matches=((mat1,mat2,50),(mat2,mat2,100))),shearCohesion=MatchMaker(matches=((mat1,mat2,5000),(mat2,mat2,80000))),label="cohesiveIp")],
   [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
   label='cohesiveLaw')]

   ),
 #NewtonIntegrator(damping=0.4,gravity=(0,0,-9.81)),
        NewtonIntegrator(damping=0.4),
 PyRunner(command='checkUnbalanced()',realPeriod=2,label='checker'),
 PyRunner(command='addPlotData()',iterPeriod=100)
 ]

O.dt=20*utils.PWaveTimeStep()
O.trackEnergy=True

def checkUnbalanced():

 global Forcewall
 if O.iter<5000: return
 if utils.unbalancedForce()>.1: return

 plot.saveDataTxt('Elaheh3.txt.bz2')

 O.bodies.append(utils.wall((0.5,0.5,1.0),2,sense = -1, material = 'wallmat'))
 Forcewall = O.bodies[-1]

 Forcewall.state.vel = (0,0,-0.01) ### applying the velocity to the wall (0,0,-1)=(u,v,w)

 O.engines=O.engines+[PyRunner(command='addPlotData()',iterPeriod=200)]

 checker.command='unloadPlate()'
def unloadPlate():
   # if the force on Forcewall exceeds maximum load, start unloading
   if abs(O.forces.f(Forcewall.id)[2])>maxLoad:
      Forcewall.state.vel = (0,0,0) ##you hadn't defined Forcewall before. so it gave you an error
      # next time, do not call this function anymore, but the next one (stopUnloading) instead
      checker.command='stopUnloading()'

def stopUnloading():
   if abs(O.forces.f(Forcewall.id)[2])<minLoad:
      # O.tags can be used to retrieve unique identifiers of the simulation
      # if running in batch, subsequent simulation would overwrite each other's output files otherwise
      # d (or description) is simulation description (composed of parameter values)
      # while the id is composed of time and process number
      plot.saveDataTxt(O.tags['d.id']+'.txt')

def addPlotData():
    if not isinstance(O.bodies[-1].shape,Wall):
       plot.addData(); return
    Fz=O.forces.f(Forcewall.id)[2]
    plot.addData(Fz=Fz,w=Forcewall.state.pos[2]-Forcewall.state.refPos[2])#,unbalanced=utils.unbalancedForce(),i=O.iter)

plot.plots={'w':('Fz',)}#,'i':('unbalanced',)
plot.plot()

O.run()
utils.waitIfBatch()
plot.saveDataTxt('m.txt.bz2',vars=('Fz','w'))

Revision history for this message
Seti (seti) said :
#4

to be more specific. I need to use MatchMacker to assign different cohesion value to two materials . would you please just have a look at defined engine as per below. Thanks

O.engines=[
 ForceResetter(),
 InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb(),Bo1_Wall_Aabb()]),
   InteractionLoop([Ig2_Sphere_Sphere_L3Geom(),Ig2_Facet_Sphere_L3Geom(),Ig2_Wall_Sphere_L3Geom()],
   [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(normalCohesion=MatchMaker(matches=((mat1,mat2,50),(mat2,mat2,100))),shearCohesion=MatchMaker(matches=((mat1,mat2,5000),(mat2,mat2,80000))),label="cohesiveIp")],
   [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
   label='cohesiveLaw')]

   ),
 #NewtonIntegrator(damping=0.4,gravity=(0,0,-9.81)),
        NewtonIntegrator(damping=0.4),
 PyRunner(command='checkUnbalanced()',realPeriod=2,label='checker'),
 PyRunner(command='addPlotData()',iterPeriod=100)
 ]

Revision history for this message
Launchpad Janitor (janitor) said :
#5

This question was expired because it remained in the 'Open' state without activity for the last 15 days.