Crack Volume and Crack Surface (For a joint plane & the whole sample)

Asked by Yousef Golabchi on 2020-04-17

Hello everyone,

I am doing a simulation with Yade. I have a sample with a main joint plane and I am injecting water in the joint plane.

I am supposed to monitor the crack volume (p33) and the crack surface (p32) of the whole sample and the joint specifically.

The code that I use is as follows:

#####

ex0=ey0=ez0=0
#if npatches == 1:
def recorder():
 global ex0,ey0,ez0
 crackVolume=crackSurface=0
 crackVolumeJoint=crackSurfaceJoint=0
 for i in O.interactions:
  if i.phys.breakOccurred:
   crackVolume+=i.phys.crossSection*i.phys.crackJointAperture
   crackSurface+=i.phys.crossSection
  if i.phys.isOnJoint:
   crackVolumeJoint+=i.phys.crossSection*i.phys.crackJointAperture
   crackSurfaceJoint+=i.phys.crossSection
  if i.phys.isOnJoint:
   crackVolumeJoint+=i.phys.crossSection*i.phys.crackJointAperture
   crackSurfaceJoint+=i.phys.crossSection
 yade.plot.addData(t=O.time
    ,i=O.iter
    ,p32Total=crackSurface
    ,p33Total=crackVolume
    ,p32Joint=crackSurfaceJoint
    ,p33Joint=crackVolumeJoint
 )
 plot.saveDataTxt(OUT)

#####

I know form [1] that for a specific flow rate the crack opens however when I plot the Joint's Crack Surface and Volume, it shows that the joint crack surface and volume are always 0.

Could you please let me know what I do wrong in the code?

Thank you in advanced for your help.

Best regards,
Yousef

P.S. [1]=https://answers.launchpad.net/yade/+question/689817

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Luc Scholtès
Solved:
2020-04-24
Last query:
2020-04-24
Last reply:
2020-04-18
Robert Caulk (rcaulk) said : #1

Because breakOccurred is always false unless a break has occurred in the most recent triangulation step [1]. Is the documentation unclear? Probably you seek isBroken [2].

[1]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.JCFpmPhys.breakOccurred
[2]https://yade-dem.org/doc/yade.wrapper.html#yade.wrapper.JCFpmPhys.isBroken

Best Luc Scholtès (luc) said : #2

It should work... Isn't it just a problem of indentation?

For:
   if:
      do

Apart from printing up some variables during the simulation to see if your loops and tests are effective, I don't know what to say.

Also:

1) careful as you have the same test defined twice which would make your calculation wrong:

  if i.phys.isOnJoint:
   crackVolumeJoint+=i.phys.crossSection*i.phys.crackJointAperture
   crackSurfaceJoint+=i.phys.crossSection

2) I would use isBroken instead of breakOccurred as I think that breakOcurred is a global variable (unless you are using a custom version of the code).

Dear Luc and Robert,

Thanks for your replies. The indentation on the python file is correct. It was not copied here exactly as the python file. Same goes for the repetition. I was deleting the necessarily part to reduce the code here, so I inadvertently copied the "if i.phys.isOnJoint:" here twice.

I will change the breakOccurred to isBroken which is for crack volume and crack surface of the whole sample. However, my inquiry was more about the joint's crack volume and joint's crack surface which are 0.

Best regards,
Yousef

Luc Scholtès (luc) said : #4

Did you define neverErase=True in the Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM()?

Hi Luc,

Yes neverErase is True in the Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM().

#####

[Law2_ScGeom_JCFpmPhys_JointedCohesiveFrictionalPM(smoothJoint=True,neverErase=1,recordCracks=True,Key=OUT,label='interactionLaw')]

#####

Best,
Yousef

Robert Caulk (rcaulk) said : #6

Please post an MWE so we can stop guessing [1].

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

Hi Robert,

You are right. I should have sent an MWE. However, please note that the problem of sending MWE is that it is not just a code. It is required to define a joint so the script uses another python code and also .stl file. Without them the script does not work, even if I I send it entirely let alone MWE.

Anyhow, I will provide the parts that might cause the problem soon.

Thanks,
Yousef

I'm writing to sum up the question and mark it as solved. As Luc and Robert pointed out, the code 'isBroken' has to be replaced by 'breakOccurred' for the crack volume and the crack surface of the sample (rock medium). For the crack volume and crack surface of the joint plane, the code was correct as Luc said but I had to increase the time steps to be able to get results.

Thanks,
Yousef

Thanks Luc Scholtès, that solved my question.

Robert Caulk (rcaulk) said : #10

Correction 'breakOccurred' needs to be replaced with 'isBroken'.