From 8bb93a1c4ae5b889b403a47810100566d803c84c Mon Sep 17 00:00:00 2001 From: fei2 Date: Mon, 19 Aug 2024 17:07:37 -0700 Subject: [PATCH] only use the matrix perm for the FaceElementToCellStencil --- .../finiteVolume/FaceElementToCellStencil.hpp | 71 ++++++++++++------- 1 file changed, 44 insertions(+), 27 deletions(-) diff --git a/src/coreComponents/finiteVolume/FaceElementToCellStencil.hpp b/src/coreComponents/finiteVolume/FaceElementToCellStencil.hpp index 72edefcab25..d701c2b9e66 100644 --- a/src/coreComponents/finiteVolume/FaceElementToCellStencil.hpp +++ b/src/coreComponents/finiteVolume/FaceElementToCellStencil.hpp @@ -263,30 +263,35 @@ inline void FaceElementToCellStencilWrapper:: localIndex const esr0 = m_elementSubRegionIndices[iconn][0]; localIndex const ei0 = m_elementIndices[iconn][0]; - localIndex const er1 = m_elementRegionIndices[iconn][1]; - localIndex const esr1 = m_elementSubRegionIndices[iconn][1]; - localIndex const ei1 = m_elementIndices[iconn][1]; + // localIndex const er1 = m_elementRegionIndices[iconn][1]; + // localIndex const esr1 = m_elementSubRegionIndices[iconn][1]; + // localIndex const ei1 = m_elementIndices[iconn][1]; real64 faceConormal[3]; // Will change when implementing collocation points. LvArray::tensorOps::hadamardProduct< 3 >( faceConormal, coefficient[er0][esr0][ei0][0], m_faceNormal[iconn] ); real64 const t0 = m_weights[iconn][0] * LvArray::tensorOps::AiBi< 3 >( m_cellToFaceVec[iconn], faceConormal ); + // real64 const t0 = m_weights[iconn][0] * coefficient[er1][esr1][ei1][0][2]; // We consider the 3rd component of the permeability which is the normal one. - real64 const t1 = m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][2]; + // real64 const t1 = m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][2]; - real64 const sumOfTrans = t0+t1; - real64 const value = m_transMultiplier[iconn]*t0*t1/sumOfTrans; + // real64 const sumOfTrans = t0+t1; + // real64 const value = m_transMultiplier[iconn]*t0*t1/sumOfTrans; + real64 const value = m_transMultiplier[iconn]*t0; weight[0][0] = value; weight[0][1] = -value; // We consider the 3rd component of the permeability which is the normal one. - 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][2]; + // 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][2]; - dWeight_dVar[0][0] = ( dt0 * t1 * sumOfTrans - dt0 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); - dWeight_dVar[0][1] = ( t0 * dt1 * sumOfTrans - dt1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + // dWeight_dVar[0][0] = ( dt0 * t1 * sumOfTrans - dt0 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + // dWeight_dVar[0][1] = ( t0 * dt1 * sumOfTrans - dt1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + GEOS_UNUSED_VAR( dCoeff_dVar ); + dWeight_dVar[0][0] = 0.0; + dWeight_dVar[0][1] = 0.0; } GEOS_HOST_DEVICE @@ -298,10 +303,12 @@ FaceElementToCellStencilWrapper { // Will change when implementing collocation points. real64 const t0 = m_weights[iconn][0] * LvArray::tensorOps::AiBi< 3 >( m_cellToFaceVec[iconn], m_faceNormal[iconn] ); - real64 const t1 = m_weights[iconn][1]; + // real64 const t0 = m_weights[iconn][0]; + // real64 const t1 = m_weights[iconn][1]; - real64 const sumOfTrans = t0+t1; - real64 const value = m_transMultiplier[iconn]*t0*t1/sumOfTrans; + // real64 const sumOfTrans = t0+t1; + // real64 const value = m_transMultiplier[iconn]*t0*t1/sumOfTrans; + real64 const value = m_transMultiplier[iconn]*t0; weight[0][0] = value; weight[0][1] = -value; @@ -325,35 +332,45 @@ FaceElementToCellStencilWrapper:: localIndex const esr0 = m_elementSubRegionIndices[iconn][0]; localIndex const ei0 = m_elementIndices[iconn][0]; - localIndex const er1 = m_elementRegionIndices[iconn][1]; - localIndex const esr1 = m_elementSubRegionIndices[iconn][1]; - localIndex const ei1 = m_elementIndices[iconn][1]; + // localIndex const er1 = m_elementRegionIndices[iconn][1]; + // localIndex const esr1 = m_elementSubRegionIndices[iconn][1]; + // localIndex const ei1 = m_elementIndices[iconn][1]; real64 faceConormal[3]; // Will change when implementing collocation points. LvArray::tensorOps::hadamardProduct< 3 >( faceConormal, coefficient[er0][esr0][ei0][0], m_faceNormal[iconn] ); real64 const t0 = m_weights[iconn][0] * LvArray::tensorOps::AiBi< 3 >( m_cellToFaceVec[iconn], faceConormal ); + // real64 const t0 = m_weights[iconn][0] * coefficient[er1][esr1][ei1][0][2]; // We consider the 3rd component of the permeability which is the normal one. - real64 const t1 = m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][2]; + // real64 const t1 = m_weights[iconn][1] * coefficient[er1][esr1][ei1][0][2]; - real64 const sumOfTrans = t0+t1; - real64 const value = m_transMultiplier[iconn]*t0*t1/sumOfTrans; + // real64 const sumOfTrans = t0+t1; + // real64 const value = m_transMultiplier[iconn]*t0*t1/sumOfTrans; + real64 const value = m_transMultiplier[iconn]*t0; weight[0][0] = value; weight[0][1] = -value; // We consider the 3rd component of the permeability which is the normal one. - real64 const dt0_dVar1 = m_weights[iconn][0] * dCoeff_dVar1[er0][esr0][ei0][0][0]; - real64 const dt1_dVar1 = m_weights[iconn][1] * dCoeff_dVar1[er1][esr1][ei1][0][2]; - real64 const dt0_dVar2 = m_weights[iconn][0] * dCoeff_dVar2[er0][esr0][ei0][0][0]; - real64 const dt1_dVar2 = m_weights[iconn][1] * dCoeff_dVar2[er1][esr1][ei1][0][2]; + // real64 const dt0_dVar1 = m_weights[iconn][0] * dCoeff_dVar1[er0][esr0][ei0][0][0]; + // real64 const dt1_dVar1 = m_weights[iconn][1] * dCoeff_dVar1[er1][esr1][ei1][0][2]; + // real64 const dt0_dVar2 = m_weights[iconn][0] * dCoeff_dVar2[er0][esr0][ei0][0][0]; + // real64 const dt1_dVar2 = m_weights[iconn][1] * dCoeff_dVar2[er1][esr1][ei1][0][2]; + + // dWeight_dVar1[0][0] = ( dt0_dVar1 * t1 * sumOfTrans - dt0_dVar1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + // dWeight_dVar1[0][1] = ( t0 * dt1_dVar1 * sumOfTrans - dt1_dVar1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + + // dWeight_dVar2[0][0] = ( dt0_dVar2 * t1 * sumOfTrans - dt0_dVar2 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + // dWeight_dVar2[0][1] = ( t0 * dt1_dVar2 * sumOfTrans - dt1_dVar2 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + + GEOS_UNUSED_VAR( dCoeff_dVar1, dCoeff_dVar2 ); - dWeight_dVar1[0][0] = ( dt0_dVar1 * t1 * sumOfTrans - dt0_dVar1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); - dWeight_dVar1[0][1] = ( t0 * dt1_dVar1 * sumOfTrans - dt1_dVar1 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + dWeight_dVar1[0][0] = 0.0; + dWeight_dVar1[0][1] = 0.0; - dWeight_dVar2[0][0] = ( dt0_dVar2 * t1 * sumOfTrans - dt0_dVar2 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); - dWeight_dVar2[0][1] = ( t0 * dt1_dVar2 * sumOfTrans - dt1_dVar2 * t0 * t1 ) / ( sumOfTrans * sumOfTrans ); + dWeight_dVar2[0][0] = 0.0; + dWeight_dVar2[0][1] = 0.0; } GEOS_HOST_DEVICE