Repository navigation
fix: SurfaceGenerator crash when wells are present - #4169
Open
npillardou wants to merge 5 commits into
Open
npillardou wants to merge 5 commits into
npillardou wants to merge 5 commits into
Conversation
npillardou
requested review from
OmarDuran,
bd713,
jhuang2601,
joshua-white and
rrsettgast
as code owners
October 22, 2026 13:06
victorapm
self-requested a review
October 22, 2026 13:32
bd713
approved these changes
Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Running a case that combines a
SurfaceGeneratorwith wells crashes during the fracturing step:SurfaceGenerator::findFracturePlanes → getSubRegion
Error cause: castedChild == nullptr (…/wellRegion/elementSubRegions/wellRegionUniqueSubRegion)
Wells register their own nodes and elements in the node-to-element maps
(
WellElementSubRegion::updateNodeManagerNodeToElementMap).SurfaceGeneratorassumes everyentry of these maps is a 3D cell and casts it to
CellElementSubRegion. That cast throws as soonas the mesh contains a
WellElementRegion.Changes
SurfaceGenerator.cppgetCellSubRegion, that returnsnullptrfor non-cell entries (e.g. wellelements).
findFracturePlanes,mapConsistencyCheck,calculateNodeAndFaceSifand
calculateElementForcesOnEdge.calculateNodeAndFaceSif, average the elastic moduli over cell elements only. Before, thesum was divided by the total number of node-to-element entries, wells included.
The other
CellElementSubRegioncasts in this file go through the face-to-element maps, wherewells never appear, so they are left unchanged.
New integrated test:
ALM_inclinedFault_ISG_well_smokeThis is
ALM_inclinedFault_ISG_smoke, with the injection done through a well instead of apressure prescribed on a whole block:
SinglePhaseReservoirPoromechanicsConformingFracturesALM+SinglePhaseReservoir+WellManager.underburden (1e-18 m²).
FieldApplicator.It is not prescribed, so it can evolve with the injection.
Input refactoring
prescribedFaultPressuremoved fromALM_inclinedFault_base.xmlto the four cases thatinclude it (
ISG,ISG_DruckerPrager,ESG,ESG_friction_cohesion). The definition isunchanged.
included file cannot override it.
Testing
ALM_inclinedFault_ISG_well_smokecrashes at cycle 0 withthe error above.
elements.
prescribedFaultPressuremove (time steps, fracture states, ALM convergence, linear iterationsand residuals).
Notes
ALM_inclinedFault_ISG_well_smoke.FieldApplicator, thetargetRegionsfilter never matches. It compares
subRegion.getParent().getName()to the region name, but theparent of a sub-region is the
elementSubRegionsgroup. The new test does not settargetRegions. The specification'sobjectPathalready targets the fault.