Skip to content

Nested hybrid grid: import as a reconstructed LGR hierarchy#14231

Draft
kriben wants to merge 1 commit into
devfrom
nested-hybrid-grid-lgr
Draft

Nested hybrid grid: import as a reconstructed LGR hierarchy#14231
kriben wants to merge 1 commit into
devfrom
nested-hybrid-grid-lgr

Conversation

@kriben

@kriben kriben commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

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:

  • _NEST_ID.grdecl : per-cell nesting level, loaded as a discrete category property for coloring/filtering.
  • _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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant