Nested hybrid grid: import as a reconstructed LGR hierarchy#14231
Draft
kriben wants to merge 1 commit into
Draft
Nested hybrid grid: import as a reconstructed LGR hierarchy#14231kriben wants to merge 1 commit into
kriben wants to merge 1 commit into
Conversation
Add support for importing Eclipse "nested hybrid grids" (produced by xtgeo/fmu-tools). Such a grid is a single flat EGRID in which the refined region is appended to the end of the I axis at higher resolution and connected to the coarse grid through NNCs; in IJK space the refined cells are far from their coarse parent, but their COORD/ZCORN place them inside the coarse region. The coarse parent cells are collapsed to zero volume, so the parent of each refined cell is supplied explicitly by a HOSTNUM sidecar. Both sidecars are auto-detected next to the grid file: - <base>_NEST_ID.grdecl : per-cell nesting level, loaded as a discrete category property for coloring/filtering. - <base>_HOSTNUM.grdecl : per refined cell, the 1-based natural index of its parent coarse cell (0 otherwise). RigNestedHybridGridReconstructor rebuilds each refined region as a true RigLocalGrid: it appends contiguous cells/nodes, copies the real refined geometry, links each cell to its parent (subGrid/parentCellIndex), hides the original scattered cells, transfers active-cell result indexing, copies result values onto the LGR cells, and re-points the file NNCs to the LGR cells. The reconstructed LGR is flagged so it is excluded from the on-file grid count, preventing the result reader from reading it as a phantom grid. The refined region then appears as a proper LGR with correct geometry, INDEX_I/J/K, static/dynamic results and computed results (e.g. SOIL). Normal grids (no sidecar present) are unaffected. Key changes: - RigNestedHybridGridReconstructor (new) + RimEclipseResultCase hooks - RigLocalGrid isReconstructedGrid flag; RigMainGrid gridCountOnFile and nestedHybridLgrSourceCells - RigCaseCellResultsData: copy results onto reconstructed-LGR cells - RiaResultNames: NEST_ID name + category-result handling - RigActiveCellInfo::computeDerivedData made idempotent - Unit tests in RigNestedHybridGridReconstructor-Test.cpp
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.
Add support for importing Eclipse "nested hybrid grids" (produced by xtgeo/fmu-tools). Such a grid is a single flat EGRID in which the refined region is appended to the end of the I axis at higher resolution and connected to the coarse grid through NNCs; in IJK space the refined cells are far from their coarse parent, but their COORD/ZCORN place them inside the coarse region. The coarse parent cells are collapsed to zero volume, so the parent of each refined cell is supplied explicitly by a HOSTNUM sidecar.
Both sidecars are auto-detected next to the grid file:
RigNestedHybridGridReconstructor rebuilds each refined region as a true RigLocalGrid: it appends contiguous cells/nodes, copies the real refined geometry, links each cell to its parent (subGrid/parentCellIndex), hides the original scattered cells, transfers active-cell result indexing, copies result values onto the LGR cells, and re-points the file NNCs to the LGR cells. The reconstructed LGR is flagged so it is excluded from the on-file grid count, preventing the result reader from reading it as a phantom grid.
The refined region then appears as a proper LGR with correct geometry, INDEX_I/J/K, static/dynamic results and computed results (e.g. SOIL). Normal grids (no sidecar present) are unaffected.
Key changes: