From a94c2e67b23b5831132e68a94d0eb15510a1888d Mon Sep 17 00:00:00 2001 From: liyangrock Date: Wed, 4 Dec 2024 11:54:46 +0800 Subject: [PATCH] fix: update m_weight indexing in SurfaceElementStencil to enable it is correct for intersected fractures --- .../finiteVolume/SurfaceElementStencil.hpp | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/coreComponents/finiteVolume/SurfaceElementStencil.hpp b/src/coreComponents/finiteVolume/SurfaceElementStencil.hpp index 5639a109b71..beed2c5b734 100644 --- a/src/coreComponents/finiteVolume/SurfaceElementStencil.hpp +++ b/src/coreComponents/finiteVolume/SurfaceElementStencil.hpp @@ -334,8 +334,8 @@ SurfaceElementStencilWrapper:: localIndex const esr1 = m_elementSubRegionIndices[iconn][k[1]]; localIndex const ei1 = m_elementIndices[iconn][k[1]]; - real64 const t0 = m_weights[iconn][0] * coefficient[er0][esr0][ei0][0][0]; // this is a bit insane to access perm - real64 const t1 = m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][0]; + real64 const t0 = m_weights[iconn][k[0]] * coefficient[er0][esr0][ei0][0][0]; // this is a bit insane to access perm + real64 const t1 = m_weights[iconn][k[1]] * coefficient[er1][esr1][ei1][0][0]; real64 const harmonicWeight = t0*t1 / sumOfTrans; real64 const arithmeticWeight = 0.25 * (t0+t1); @@ -345,8 +345,8 @@ SurfaceElementStencilWrapper:: weight[connectionIndex][0] = value; weight[connectionIndex][1] = -value; - real64 const dt0 = m_weights[iconn][0] * dCoeff_dVar[er0][esr0][ei0][0][0]; - real64 const dt1 = m_weights[iconn][1] * dCoeff_dVar[er1][esr1][ei1][0][0]; + real64 const dt0 = m_weights[iconn][k[0]] * dCoeff_dVar[er0][esr0][ei0][0][0]; + real64 const dt1 = m_weights[iconn][k[1]] * dCoeff_dVar[er1][esr1][ei1][0][0]; real64 dHarmonic[2]; dHarmonic[0] = ( dt0 * t1 * sumOfTrans - dt0 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); @@ -384,8 +384,8 @@ SurfaceElementStencilWrapper:: { for( k[1]=k[0]+1; k[1]( m_cellCenterToEdgeCenters[iconn][k[1]], gravityVector ) ) > MULTIPLIER_THRESHOLD ) ? coefficientMultiplier[er1][esr1][ei1][0][1] : coefficientMultiplier[er1][esr1][ei1][0][0]; - real64 const t0 = mult0 * m_weights[iconn][0] * coefficient[er0][esr0][ei0][0][0]; - real64 const t1 = mult1 * m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][0]; + real64 const t0 = mult0 * m_weights[iconn][k[0]] * coefficient[er0][esr0][ei0][0][0]; + real64 const t1 = mult1 * m_weights[iconn][k[1]] * coefficient[er1][esr1][ei1][0][0]; real64 const harmonicWeight = t0*t1 / sumOfTrans; real64 const arithmeticWeight = 0.25 * (t0+t1);