setCohesionNow=True problem

Asked by Ferenc Safranyik on 2019-01-25

Dear All,

I try to make a simply simulation of a very cohesive particulate solid. To this CohFrictMat material model was used. After unbalancedForce was decreased I try to turn on cohesion on every contact but I get an erre: "Segmentation fault (core dumped)" and I can not recognise until this time the problem. Can anybody help to me? Thanks in advance!

Some piece of the code:

densT = 2600
ET = 5e5 * 25
nuT = .9
frictAngT = .2
nCoh = 1e8
sCoh = 1e8
eRoll = .1

talaj = O.materials.append(CohFrictMat(young=ET,poisson=nuT,density=densT,frictionAngle=frictAngT,normalCohesion=nCoh,
                                     shearCohesion=sCoh,isCohesive=True,momentRotationLaw=True,etaRoll=eRoll,label='talaj'))
acel = O.materials.append(FrictMat(young=EA,poisson=nuA,density=densA,frictionAngle=frictAngA,label='acel'))

doboz = O.bodies.append(geom.utils.facetBox((1.25,0,.05),(.25,.2,.15),wallMask=63, color=(.2,.2,.0),material = 'acel'))

Sugar1 = .02
felho = pack.SpherePack()
felho.makeCloud((1,-.2,-.1),(1.5,.2,.2),rMean=Sugar1)
particles = O.bodies.append([sphere(c,r,material='talaj',color=(.3,.8,.1)) for c,r in felho])

O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Box_Aabb(),Bo1_Facet_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom(),Ig2_Facet_Sphere_ScGeom(),Ig2_Box_Sphere_ScGeom()],
                [Ip2_FrictMat_FrictMat_FrictPhys(),Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='coh')],
                [Law2_ScGeom_FrictPhys_CundallStrack(),Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
   useIncrementalForm=True,
   always_use_moment_law = True)]
        ),
        NewtonIntegrator(damping=.4,gravity=(0,0,-9.81),label='newton'),
]

O.dt=.01*utils.PWaveTimeStep()

O.engines=O.engines + [PyRunner(command='ment()',iterPeriod = 1,label='ment')]

def ment():
 plot.addData(i=O.iter,uF=utils.unbalancedForce())
 if O.iter > 80000 and utils.unbalancedForce() < .05:
                coh.setCohesionNow=True

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Ferenc Safranyik
Solved:
2019-01-28
Last query:
2019-01-28
Last reply:
2019-01-28
Jérôme Duriez (jduriez) said : #1

Hi,

If I were you, I would first try to simplify your script. Do you really need that many Bo1 / Ig2 / Ip2 /Law2 functors ?

It should be possible to just use CohFrictMat for instance (and no FrictMat), possibly two of them: one with non zero cohesive properties, and an other one with zero cohesive properties, if this was what you were looking for.

Jérôme

File "test.py", line 11, in <module>
     acel =
O.materials.append(FrictMat(young=EA,poisson=nuA,density=densA,frictionAngle=frictAngA,label='acel'))
NameError: name 'EA' is not defined

Please check [1].

Bruno

[1] https://yade-dem.org/wiki/Howtoask

Ferenc Safranyik (safranyikf) said : #3

Dear Jerome and Bruno,

thanks for your reply and sorry my mistake: I forget to write in my question some material parameters...

The code was changed based on your suggestions and now it is working! Thanks!

densT = 2600
ET = 5e5 * 25
nuT = .9
frictAngT = .2
nCoh = 1e8
sCoh = 1e8
eRoll = .1

EA = 2.1e8
nuA = .3
densA = 7800
frictAngA = .35

talaj = O.materials.append(CohFrictMat(young=ET,poisson=nuT,density=densT,frictionAngle=frictAngT,normalCohesion=nCoh,
                                     shearCohesion=sCoh,isCohesive=True,momentRotationLaw=True,etaRoll=eRoll,label='talaj'))
acel = O.materials.append(CohFrictMat(young=EA,poisson=nuA,density=densA,frictionAngle=frictAngA,normalCohesion=0,
                                      shearCohesion=0,etaRoll=.1,isCohesive=False,momentRotationLaw=False,label='acel'))

doboz = O.bodies.append(geom.utils.facetBox((1.25,0,.05),(.25,.2,.15),wallMask=63, color=(.2,.2,.0),material = 'acel'))

Sugar1 = .02
felho = pack.SpherePack()
felho.makeCloud((1,-.2,-.1),(1.5,.2,.2),rMean=Sugar1)
particles = O.bodies.append([sphere(c,r,material='talaj',color=(.3,.8,.1)) for c,r in felho])

O.engines=[
        ForceResetter(),
        InsertionSortCollider([Bo1_Sphere_Aabb(),Bo1_Facet_Aabb()]),
        InteractionLoop(
                [Ig2_Sphere_Sphere_ScGeom6D(),Ig2_Facet_Sphere_ScGeom6D()],
                [Ip2_CohFrictMat_CohFrictMat_CohFrictPhys(label='coh')],
                [Law2_ScGeom6D_CohFrictPhys_CohesionMoment(
   useIncrementalForm=True,
   always_use_moment_law = True)]
        ),
        NewtonIntegrator(damping=.4,gravity=(0,0,-9.81),label='newton'),
]

O.dt=.01*utils.PWaveTimeStep()

O.engines=O.engines + [PyRunner(command='ment()',iterPeriod = 1,label='ment')]

def ment():
 plot.addData(i=O.iter,uF=utils.unbalancedForce())
 if O.iter > 80000 and utils.unbalancedForce() < .05:
                coh.setCohesionNow=True