Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update m_weights indexing in SurfaceElementStencil.hpp #3474

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

liyangrock
Copy link
Contributor

The PR fixes incorrect array indexing when accessing m_weights for intersected fractures.

@rrsettgast
Copy link
Member

@liyangrock Do you have a small example problem you can add to the integrated tests that exercising intersecting fractures?

@Guotong-Ren
Copy link
Contributor

Guotong-Ren commented Dec 4, 2024

if it is TPFA, k array just equals 0, 1 which is identical to the original formulation. but i think it is good to be consistent

@rrsettgast
Copy link
Member

@Guotong-Ren Even in TPFA, if there are 3 fracture volumes connected to a "connector" the for loop:

  for( k[0]=0; k[0]<numPointsInFlux( iconn ); ++k[0] )
  {
    for( k[1]=k[0]+1; k[1]<numPointsInFlux( iconn ); ++k[1] )
    {

results in the permutations of k[2] of (0,1), (0,2), (1,2). Do I have this incorrect?

@Guotong-Ren
Copy link
Contributor

@Guotong-Ren Even in TPFA, if there are 3 fracture volumes connected to a "connector" the for loop:

  for( k[0]=0; k[0]<numPointsInFlux( iconn ); ++k[0] )
  {
    for( k[1]=k[0]+1; k[1]<numPointsInFlux( iconn ); ++k[1] )
    {

results in the permutations of k[2] of (0,1), (0,2), (1,2). Do I have this incorrect?

numPointsInFlux(iconn) = 2 for TPFA. (0,2) and (1,2) should be ruled out in the loop ending criterion?

@CusiniM
Copy link
Collaborator

CusiniM commented Dec 4, 2024

@Guotong-Ren Even in TPFA, if there are 3 fracture volumes connected to a "connector" the for loop:

  for( k[0]=0; k[0]<numPointsInFlux( iconn ); ++k[0] )
  {
    for( k[1]=k[0]+1; k[1]<numPointsInFlux( iconn ); ++k[1] )
    {

results in the permutations of k[2] of (0,1), (0,2), (1,2). Do I have this incorrect?

numPointsInFlux(iconn) = 2 for TPFA. (0,2) and (1,2) should be ruled out in the loop ending criterion?

This is not the case for fractures. Each connection contains the halfWeight of each fracture element connected to that connection. In the case of two intersecting fractures, with 4 faceElements connected through a single edge, m_weights will have size 4 and then, on the fly, we compute transmissibilities (weights) pair by pair. So, I think this fix is actually needed.

@CusiniM
Copy link
Collaborator

CusiniM commented Dec 4, 2024

@liyangrock Do you have a small example problem you can add to the integrated tests that exercising intersecting fractures?

I think we have one in there. Note that if all elements have same geometry differences won't be noticeable.

@rrsettgast
Copy link
Member

rrsettgast commented Dec 4, 2024

@liyangrock Do you have a small example problem you can add to the integrated tests that exercising intersecting fractures?

I think we have one in there. Note that if all elements have same geometry differences won't be noticeable.

We should modify it s.t. incorrect calculations will be obvious....this is an easy statement to make...perhaps harder to implement.

@liyangrock
Copy link
Contributor Author

@liyangrock Do you have a small example problem you can add to the integrated tests that exercising intersecting fractures?

Currently, I don’t have a small example problem related to intersecting fractures that can be added to the integrated tests. I’m not familiar with the integrated tests yet, but I’m open to exploring them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants