How to record the breakage of the cohesion?

Asked by whr

Dear all,

I am a new yade user. I'm trying to use the cohesion friction model to simulate the behavior of sand stone.

The material type is 'CohFrictMat'.
I choose the following three to form the Interaction loop:
Ig2_Sphere_Sphere_ScGeom6D()
Ip2_CohFrictMat_CohFrictMat_CohFrictPhys
Law2_ScGeom6D_CohFrictPhys_CohesionMoment

I'd like to know if there is a way to track the breakage of the cohesion. Or should I write in the script to record the events that satisfy breakage condition myself.

Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jan Stránský
Solved:
Last query:
Last reply:
Revision history for this message
Jan Stránský (honzik) said :
#1

Hello,

it depends on what you mean by "track the breakage of the cohesion"
(overall breakage, breakage of one specific interaction, of all
interactions...).

but it is definitely possible :-) so please be more specific and we should
find a solution
cheers
Jan

2014-12-22 4:21 GMT+01:00 whr <email address hidden>:

> New question #259419 on Yade:
> https://answers.launchpad.net/yade/+question/259419
>
> Dear all,
>
> I am a new yade user. I'm trying to use the cohesion friction model to
> simulate the behavior of sand stone.
>
> The material type is 'CohFrictMat'.
> I choose the following three to form the Interaction loop:
> Ig2_Sphere_Sphere_ScGeom6D()
> Ip2_CohFrictMat_CohFrictMat_CohFrictPhys
> Law2_ScGeom6D_CohFrictPhys_CohesionMoment
>
> I'd like to know if there is a way to track the breakage of the cohesion.
> Or should I write in the script to record the events that satisfy breakage
> condition myself.
>
> Thanks in advance.
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
whr (huanran-wu) said :
#2

Dear Jan,

Thanks for your reply.

Actually, I'm trying to count the number of the cohesion-breakage during compression to compare with data on acoustic emission (AE) activity.

I tried the following code to count the interactions with broken cohesion every 100 steps.

   num = 0
   for i in O.interactions:
      if i.phys.cohesionBroken:
         num+=1

However, when I used that code, I found the number decrease sometimes. The amount of interactions (len(O.interactions)) also varies. FYI, I use periodic boundary.
So, any suggestions?

Cheers
Huanran

Revision history for this message
Best Jan Stránský (honzik) said :
#3

Hi Huanran,

O.interactions contains real and also non-real interactions and its length
indeed varies during simulation. You can try something like:

intrsOrigIds = [(i.id1,i.id2) for i in O.interactions] # done at the
beginning of simulation, but after first O.step().
# import __builtins__; __builtin__.intrsOrigIds = intrsOrigIds # might be
needed (not sure) if you call the function from PyRunner

def numBroken():
   ret = 0
   for id1,id2 in intrsOrigIds:
      try:
         i = O.interactions[id1,id2]
         if i.phys.cohesionBroken:
            ret += 1
      except IndexError: # the interaction does not exist any more
         ret += 1

cheers
Jan

2014-12-28 13:26 GMT+01:00 whr <email address hidden>:

> Question #259419 on Yade changed:
> https://answers.launchpad.net/yade/+question/259419
>
> Status: Answered => Open
>
> whr is still having a problem:
> Dear Jan,
>
> Thanks for your reply.
>
> Actually, I'm trying to count the number of the cohesion-breakage during
> compression to compare with data on acoustic emission (AE) activity.
>
> I tried the following code to count the interactions with broken
> cohesion every 100 steps.
>
> num = 0
> for i in O.interactions:
> if i.phys.cohesionBroken:
> num+=1
>
> However, when I used that code, I found the number decrease sometimes. The
> amount of interactions (len(O.interactions)) also varies. FYI, I use
> periodic boundary.
> So, any suggestions?
>
> Cheers
> Huanran
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>

Revision history for this message
whr (huanran-wu) said :
#4

Hi Jan,

Thanks for your answer. I followed your suggestion and try that code. Then I got following error information:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "test_load.py", line 25, in saveAddData
    if i.phys.cohesionBroken:
AttributeError: 'NoneType' object has no attribute 'cohesionBroken'

I added following code and got results that seems right.

  except AttributeError:
      ret +=1

Am I right? Where did this AttributeError come from? It seems the interaction remains but no physical information.

Revision history for this message
Jan Stránský (honzik) said :
#5

Ah, sorry, I forgot the isReal check. Your solution is correct, but more
clean way is to put

if not i.isReal: continue

line:

def numBroken():
   ret = 0
   for id1,id2 in intrsOrigIds:
      try:
         i = O.interactions[id1,id2]
         if not i.isReal:
            continue
         if i.phys.cohesionBroken:
            ret += 1
      except IndexError: # the interaction does not exist any more
         ret += 1

cheers
Jan

Revision history for this message
whr (huanran-wu) said :
#6

Dear Jan,

Thanks for your answer. This way is better.

However, the interaction is not real should be counted into the broken one, right?
So I think the code should be:

if not i.isReal:
   ret +=1
   continue

Am I right?
In this way, the result is same as my previous method.

Cheers
Huanran

Revision history for this message
whr (huanran-wu) said :
#7

Thanks Jan Stránský, that solved my question.

Revision history for this message
Jan Stránský (honzik) said :
#8

sorry again, you are absolutely right :-)
cheers
Jan

2014-12-28 17:26 GMT+01:00 whr <email address hidden>:

> Question #259419 on Yade changed:
> https://answers.launchpad.net/yade/+question/259419
>
> Status: Answered => Solved
>
> whr confirmed that the question is solved:
> Dear Jan,
>
> Thanks for your answer. This way is better.
>
> However, the interaction is not real should be counted into the broken
> one, right?
> So I think the code should be:
>
> if not i.isReal:
> ret +=1
> continue
>
> Am I right?
> In this way, the result is same as my previous method.
>
> Cheers
> Huanran
>
> --
> You received this question notification because you are a member of
> yade-users, which is an answer contact for Yade.
>
> _______________________________________________
> Mailing list: https://launchpad.net/~yade-users
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~yade-users
> More help : https://help.launchpad.net/ListHelp
>