From ab2af7b991693a9463cb7bb3144515d4696a41c7 Mon Sep 17 00:00:00 2001 From: npillardou Date: Thu, 22 Oct 2026 14:51:18 +0200 Subject: [PATCH 01/10] Fix surface gen issue with wells --- .../ALM_inclinedFault_ISG_well_smoke.xml | 377 ++++++++++++++++++ .../surfaceGeneration/SurfaceGenerator.cpp | 54 ++- 2 files changed, 423 insertions(+), 8 deletions(-) create mode 100644 inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml diff --git a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml new file mode 100644 index 00000000000..011cd875ac4 --- /dev/null +++ b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml @@ -0,0 +1,377 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index ef2b09b7e6a..a8d2d0f740c 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -57,6 +57,15 @@ using namespace constitutive; using namespace fields; +/// Return the cell sub-region referenced by a node-to-element map entry, or nullptr if the entry +/// points to a non-3D element (e.g. well elements, which also register themselves in the node maps). +static CellElementSubRegion const * getCellSubRegion( ElementRegionManager const & elemManager, + localIndex const er, + localIndex const esr ) +{ + return dynamic_cast< CellElementSubRegion const * >( &elemManager.getRegion( er ).getSubRegion( esr ) ); +} + /// Return the other edge of a face given one edge. static localIndex GetOtherFaceEdge( const map< localIndex, std::pair< localIndex, localIndex > > & localFacesToEdges, const localIndex thisFace, const localIndex thisEdge ) @@ -1076,7 +1085,11 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, localIndex const er = nodeToRegionMap[k]; localIndex const esr = nodeToSubRegionMap[k]; localIndex const ei = nodeToElementMap[k]; - CellElementSubRegion const * subRegion = &elemManager.getRegion( er ).getSubRegion< CellElementSubRegion >( esr ); + CellElementSubRegion const * subRegion = getCellSubRegion( elemManager, er, esr ); + if( subRegion == nullptr ) + { + continue; + } std::pair< CellElementSubRegion const *, localIndex > const p( subRegion, ei ); // Keep pairs unique (small N — linear search is fine). @@ -1100,6 +1113,12 @@ bool SurfaceGenerator::findFracturePlanes( localIndex const nodeID, stdVector< std::pair< CellElementSubRegion const *, localIndex > > const nodeToElementMaps( buildNodeToElementMaps() ); + // A node attached only to non-3D elements (e.g. a well node) cannot be split. + if( nodeToElementMaps.empty() ) + { + return false; + } + arrayView1d< integer const > const & isEdgeExternal = edgeManager.isExternal(); // const std::set& usedFaces = nodeManager.GetUnorderedVariableOneToManyMap("usedFaces")[nodeID]; @@ -2725,9 +2744,11 @@ void SurfaceGenerator::mapConsistencyCheck( localIndex const GEOS_UNUSED_PARAM( { if( nodeToRegionMap[a][k]!=-1 && nodeToSubRegionMap[a][k]!=-1 && nodeToElementMap[a][k]!=-1 ) { - nodeToElements.emplace( &elementManager.getRegion( nodeToRegionMap( a, k ) ). - getSubRegion< CellElementSubRegion >( nodeToSubRegionMap( a, k ) ), - nodeToElementMap( a, k ) ); + CellElementSubRegion const * const subRegion = getCellSubRegion( elementManager, nodeToRegionMap( a, k ), nodeToSubRegionMap( a, k ) ); + if( subRegion != nullptr ) + { + nodeToElements.emplace( subRegion, nodeToElementMap( a, k ) ); + } } } @@ -3142,7 +3163,12 @@ void SurfaceGenerator::calculateNodeAndFaceSif( DomainPartition const & domain, localIndex const esr = nodeToSubRegionMap[nodeIndex][k]; localIndex const ei = nodeToElementMap[nodeIndex][k]; - CellElementSubRegion const & elementSubRegion = elementManager.getRegion( er ).getSubRegion< CellElementSubRegion >( esr ); + CellElementSubRegion const * const cellSubRegion = getCellSubRegion( elementManager, er, esr ); + if( cellSubRegion == nullptr ) + { + continue; + } + CellElementSubRegion const & elementSubRegion = *cellSubRegion; arrayView2d< localIndex const, cells::NODE_MAP_USD > const & elementsToNodes = elementSubRegion.nodeList(); arrayView2d< real64 const > const & elementCenter = elementSubRegion.getElementCenter().toViewConst(); @@ -3243,20 +3269,27 @@ void SurfaceGenerator::calculateNodeAndFaceSif( DomainPartition const & domain, { real64 averageYoungModulus( 0 ), averagePoissonRatio( 0 ); localIndex nodeID = i == 0 ? tralingNodeID : theOtherTrailingNodeID; + localIndex numCellElements = 0; for( localIndex k=0; k( fExternal[i], fext[nodeID] ); LvArray::tensorOps::scale< 3 >( fExternal[i], averageYoungModulus / (1 - averagePoissonRatio * averagePoissonRatio) ); @@ -3933,7 +3966,12 @@ int SurfaceGenerator::calculateElementForcesOnEdge( DomainPartition const & doma localIndex const esr = nodeToSubRegionMap[nodeID][k]; localIndex const ei = nodeToElementMap[nodeID][k]; - CellElementSubRegion const & elementSubRegion = elementManager.getRegion( er ).getSubRegion< CellElementSubRegion >( esr ); + CellElementSubRegion const * const cellSubRegion = getCellSubRegion( elementManager, er, esr ); + if( cellSubRegion == nullptr ) + { + continue; + } + CellElementSubRegion const & elementSubRegion = *cellSubRegion; real64 xEle[3] = LVARRAY_TENSOROPS_INIT_LOCAL_3( elemCenter[er][esr][ei] ); From f608457655ee78947d328ae90c7b5436b0af3fa7 Mon Sep 17 00:00:00 2001 From: npillardou Date: Thu, 22 Oct 2026 14:56:56 +0200 Subject: [PATCH 02/10] modify old input files --- .../ALM_inclinedFault_ESG_friction_cohesion_smoke.xml | 7 +++++++ .../ALM_inclinedFault_ESG_smoke.xml | 7 +++++++ .../ALM_inclinedFault_ISG_DruckerPrager_smoke.xml | 7 +++++++ .../ALM_inclinedFault_ISG_smoke.xml | 7 +++++++ .../ALM_inclinedFault_base.xml | 7 ------- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ESG_friction_cohesion_smoke.xml b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ESG_friction_cohesion_smoke.xml index d5faabd5dbd..50f099f595d 100755 --- a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ESG_friction_cohesion_smoke.xml +++ b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ESG_friction_cohesion_smoke.xml @@ -173,6 +173,13 @@ + + + + + + + + - - Date: Thu, 22 Oct 2026 15:02:30 +0200 Subject: [PATCH 03/10] add test in ats file --- .../AugmentedLagrangianMultipliers.ats | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/AugmentedLagrangianMultipliers.ats b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/AugmentedLagrangianMultipliers.ats index 9f47eb6bdf8..f40c5605260 100644 --- a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/AugmentedLagrangianMultipliers.ats +++ b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/AugmentedLagrangianMultipliers.ats @@ -40,6 +40,13 @@ decks = [ restart_step=0, check_step=1, restartcheck_params=RestartcheckParameters(**restartcheck_params)), + TestDeck( + name="ALM_inclinedFault_ISG_well_smoke", + description='PoroElastic ALM inclined fault with internal surface generator and an injection well', + partitions=((1, 1, 1), (2, 2, 1)), + restart_step=0, + check_step=1, + restartcheck_params=RestartcheckParameters(**restartcheck_params)), TestDeck( name="ALM_inclinedFault_ESG_smoke", description='PoroElastic ALM inclined fault with external surface generator (elastic)', From ff463faefafcd42b843e741ce7b663faeb08494b Mon Sep 17 00:00:00 2001 From: npillardou Date: Fri, 23 Oct 2026 11:46:41 +0200 Subject: [PATCH 04/10] rebase line --- .integrated_tests.yaml | 2 +- BASELINE_NOTES.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index d0fd9460472..e1cac842136 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr4155-17777-be35229 + baseline: integratedTests/baseline_integratedTests-pr4169-17816-0a4a326 allow_fail: all: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 40932cf470f..b6769039430 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,6 +5,10 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). +PR #4169 (2026-10-23) +===================== +Fix surface generator splitting for contact mechanics case with wells + PR #4155 (2026-10-22) ===================== Add the missing restart baselines for the injection, production, and combined From a6235925651541f52bc88f22985d1057f7295af0 Mon Sep 17 00:00:00 2001 From: npillardou Date: Mon, 26 Oct 2026 10:35:42 +0100 Subject: [PATCH 05/10] update rebaseline --- .integrated_tests.yaml | 2 +- BASELINE_NOTES.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index ec41ed6c4b9..20d6bf7cc74 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr4005-17824-bac337a + baseline: integratedTests/baseline_integratedTests-pr4169-17832-bbcba22 allow_fail: all: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 48e94dbe5a7..84f5952dfd9 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,7 +5,7 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). -PR #4169 (2026-10-23) +PR #4169 (2026-10-23) ===================== Fix surface generator splitting for contact mechanics case with wells From d2d5455a79ac2587d6aba732c2806b233a8320d9 Mon Sep 17 00:00:00 2001 From: Nicolas Pillardou <71120126+npillardou@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:55:17 +0100 Subject: [PATCH 06/10] Update inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml Co-authored-by: Jian Huang <53012159+jhuang2601@users.noreply.github.com> --- .../ALM_inclinedFault_ISG_well_smoke.xml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml index 011cd875ac4..0dcc8b8da48 100644 --- a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml +++ b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml @@ -298,13 +298,6 @@ fieldName="rockPerm_permeability" scale="1.0e-13"/> - From 4094502286d7fba0095c97d5020607efd667e5ce Mon Sep 17 00:00:00 2001 From: Nicolas Pillardou <71120126+npillardou@users.noreply.github.com> Date: Mon, 26 Oct 2026 15:55:45 +0100 Subject: [PATCH 07/10] Update inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml Co-authored-by: Jian Huang <53012159+jhuang2601@users.noreply.github.com> --- .../ALM_inclinedFault_ISG_well_smoke.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml index 0dcc8b8da48..5b711bd9474 100644 --- a/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml +++ b/inputFiles/poromechanicsFractures/Contact/AugmentedLagrangianMultipliers/ALM_inclinedFault_ISG_well_smoke.xml @@ -1,5 +1,4 @@ - From 93c93843f114c823abf96a71e99a7fa792c44ba4 Mon Sep 17 00:00:00 2001 From: npillardou Date: Thu, 29 Oct 2026 12:35:09 +0100 Subject: [PATCH 08/10] solve baseline --- .integrated_tests.yaml | 2 +- BASELINE_NOTES.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index d05fec1255c..4ef4499d599 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr4164-17838-91151f5 + baseline: integratedTests/baseline_integratedTests-pr4169-17853-2d10586 allow_fail: all: '' diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 1160a6da45d..c06d6aa22d4 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,7 +5,7 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). -PR #4169 (2026-10-23) +PR #4169 (2026-10-23) ===================== Fix surface generator splitting for contact mechanics case with wells From 9d4384331ca051e3c4e71b94901593ad815e4c11 Mon Sep 17 00:00:00 2001 From: npillardou Date: Fri, 30 Oct 2026 09:49:33 +0100 Subject: [PATCH 09/10] fix baseline update --- .integrated_tests.yaml | 2 +- BASELINE_NOTES.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.integrated_tests.yaml b/.integrated_tests.yaml index 373eae27d7a..8ccd9f29703 100644 --- a/.integrated_tests.yaml +++ b/.integrated_tests.yaml @@ -1,6 +1,6 @@ baselines: bucket: geosx - baseline: integratedTests/baseline_integratedTests-pr4165-17850-4a6ed2e + baseline: integratedTests/baseline_integratedTests-pr4169-17857-d74ab90 allow_fail: all: '' streak: '' \ No newline at end of file diff --git a/BASELINE_NOTES.md b/BASELINE_NOTES.md index 1a82b7a9d90..b288f0f493c 100644 --- a/BASELINE_NOTES.md +++ b/BASELINE_NOTES.md @@ -5,7 +5,7 @@ This file is designed to track changes to the integrated test baselines. Any developer who updates the baseline ID in the .integrated_tests.yaml file is expected to create an entry in this file with the pull request number, date, and their justification for rebaselining. These notes should be in reverse-chronological order, and use the following time format: (YYYY-MM-DD). -PR #4169 (2026-10-23) +PR #4169 (2026-10-23) ===================== Fix surface generator splitting for contact mechanics case with wells From c7a9e74c10459ce01a803bed15779e6da945af41 Mon Sep 17 00:00:00 2001 From: npillardou Date: Fri, 30 Oct 2026 11:05:39 +0100 Subject: [PATCH 10/10] fix comment --- .../physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp index a8d2d0f740c..7535d184e1a 100644 --- a/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp +++ b/src/coreComponents/physicsSolvers/surfaceGeneration/SurfaceGenerator.cpp @@ -3288,6 +3288,10 @@ void SurfaceGenerator::calculateNodeAndFaceSif( DomainPartition const & domain, averagePoissonRatio += ( 3 * K - 2 * G ) / ( 2 * ( 3 * K + G ) ); } + GEOS_ERROR_IF( numCellElements == 0, + GEOS_FMT( "node {} is not connected to any cell element, cannot compute the average elastic moduli", nodeID ), + getDataContext() ); + averageYoungModulus /= numCellElements; averagePoissonRatio /= numCellElements;