Commit Graph
29 Commits
Author SHA1 Message Date
Kristian Bendiksen 66c2cd47d3 Sector export: Assign all refined sub-cells to segments in COMPSEGS
Only END_IJK denotes a cell range, DIRECTION alone is a single cell and the MD
interval is split. A defaulted start MD is zero. Without an end MD the record is
copied to each sub-cell so all refined COMPDAT connections are attached to a segment.
2026-10-21 14:42:53 +02:00
Kristian Bendiksen 2a8cd7856b Sector export: Split COMPSEGS MD interval in the direction the well travels through the refined cell 2026-10-21 14:42:53 +02:00
Kristian Bendiksen b84eea5cb1 Sector export: Correct connection factors for refinement perpendicular to wells
Lateral refinement reduces the Peaceman pressure equivalent radius r0 of the
completed center sub-cell. Explicit CF is scaled by
(ln(r0_old/rw)+S)/(ln(r0_new/rw)+S), and an explicit PR item is updated to r0_new.
r0_old is taken from PR, or computed from the original cell size and permeability.
2026-10-21 14:42:53 +02:00
Kristian Bendiksen 9a01e09ecd Sector export: Complete all refined sub-cells along well connections
COMPDAT and COMPSEGS cells were mapped to the center refined sub-cell only,
so with K refinement only every other refined layer was completed, and the
original connection factor was copied unchanged.

Along the connection penetration direction (COMPDAT DIR) all sub-cells are
now completed, with explicit CF and KH scaled by the sub-cell length
fraction. COMPSEGS records are split the same way with the MD interval
divided between the sub-cells. Perpendicular directions still use the
center sub-cell.
2026-10-21 14:42:53 +02:00
Kristian Bendiksen 65f16d04ef #14622 Sector export: Preserve separate include files for ACTNUM and FAULTS
Sector model export removed all ACTNUM and FAULTS keywords from the deck
and re-inserted the sector-specific replacements at the end of the GRID
section, which always lands in the main DATA file. Decks that keep these
keywords in separate include files lost their file organization, leaving
the original include files empty while the data was written inline.

Collapse duplicates to a single occurrence instead of removing all
occurrences, so the subsequent in-place replacement keeps the keyword in
its original file when the deck is saved with OutputMode::COPY. ACTNUM
keeps the last occurrence since a later ACTNUM overrides an earlier one;
FAULTS keeps the first so fault definitions do not move past keywords
referencing them.
2026-08-31 20:14:38 +02:00
Kristian Bendiksen 8638e5a14c #13959 RigSimulationInputTool-Test: Check transformKeywordsInDeckFile return value
Wrap the discarded calls to the [[nodiscard]] std::expected-returning
transformKeywordsInDeckFile in EXPECT_TRUE(...has_value()) to silence
C4834 and assert that the transformation succeeded.
2026-05-06 12:34:22 +02:00
Kristian Bendiksen 0c949f2dc3 #13854 Sector export: Shift BCCON Z-face K indices when pad model is enabled
Pad-model extension assumed OPM-style "Z+" for the positive-Z exterior face,
but ResInsight emits "Z" (OPM-Flow short form). The K1/K2 shift never fired,
leaving the bottom boundary face at the original NZ instead of the new
padded NZ. Match both "Z" and "Z+" so the extension applies.

Adds a regression test verifying that with BCCON_BCPROP and padding the "Z"
exterior face is shifted by nzUpper + nzLower while the "Z-" face remains
at K=1, and documents the exterior-face semantics of the direction mapping.
2026-04-23 19:50:19 +02:00
Kristian Bendiksen f881899815 #13855 Ensure BCPROP goes first in schedule section during sector export 2026-04-17 19:56:49 +02:00
Kristian Bendiksen 3067823e71 #12957 Sector Model Export: introduce RigRefinement interface hierarchy
Replace the monolithic RigNonUniformRefinement class with a proper
polymorphic hierarchy: RigRefinement (abstract base), RigNoRefinement
(identity), RigUniformRefinement (O(1) uniform), and
RigNonUniformRefinement (per-cell custom fractions).

Ownership uses std::unique_ptr<RigRefinement>, consumers receive
const RigRefinement&. This eliminates the misleading class name,
removes effectiveRefinement() indirection, and gives each refinement
mode an appropriately optimized implementation.
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 5d6aba0f70 #12957 Sector Model Export: unified refinement abstraction via effectiveRefinement()
Add effectiveRefinement() to RicRefinementSettings, RicExportSectorModelUi, and
RigSimulationInputSettings, always returning RigNonUniformRefinement regardless of
whether uniform, non-uniform, or no refinement is active.

Merge the dual RigGridExportAdapter constructors into a single one taking
RigNonUniformRefinement, and unify transformIjkToSectorCoordinates to a single
overload. Eliminate all hasNonUniformRefinement() branching patterns in
RigSimulationInputTool.cpp in favour of effectiveRefinement().
2026-03-30 11:24:56 +02:00
Kristian Bendiksen a3b784ea34 #13740 Add tests for FIP keyword handling in sector model export
Add regression tests verifying that custom FIPABC keyword in the
REGIONS section is correctly cropped and padded during sector model
export, similar to how FIPNUM is handled.
2026-03-23 09:30:16 +01:00
Kristian Bendiksen 9678cbf88d #13411 Add tests for MULTIPLY and ADD inside BOX/ENDBOX context
Tests cover record-level processing (no overlap, partial overlap with
clamping, completely inside sector) and full deck transformation with
BOX/ENDBOX for both MULTIPLY and ADD keywords.
2026-03-20 14:30:34 +01:00
Kristian Bendiksen 539eec6cc5 #13411 Sector Model Export: unify BOX/ENDBOX processing into single pass
Replace 7 separate deck iterations (cropDataKeywordsInsideBoxContext,
expandBoxContextInDeckFile, and 5 replace*KeywordIndices wrappers) with
a single transformKeywordsInDeckFile function that tracks BOX/ENDBOX
state once and handles all keyword types as they are encountered.
2026-03-20 14:30:34 +01:00
Kristian Bendiksen fce37b8fdb #13411 Sector Model Export: crop data keywords inside BOX/ENDBOX to sector intersection
Data keywords (PORO, EQLNUM, etc.) inside BOX/ENDBOX contain values for the
sub-box only. When BOX coordinates are transformed to sector coordinates, the
data size must match the transformed box dimensions. Crop boxed data keywords
to the intersection of the BOX region with the sector, preserving the
BOX/ENDBOX structure in the exported deck. If the box does not intersect the
sector, the data keyword is removed.
2026-03-20 14:30:34 +01:00
Kristian Bendiksen ff1018a65f #13411 Add test for data keyword cropping with 4 EQLNUM regions
Add a new .DATA file with K-layer based EQLNUM regions (1-4) and a
test that verifies correct spatial cropping of EQLNUM, EQUIL records,
and PORO when exporting a sector model.
2026-03-20 14:30:34 +01:00
Kristian Bendiksen 42df3170dd #13411 Add integration test for data keyword cropping in sector model export
Verify that PORO, EQLNUM, and SATNUM are correctly cropped from 6000
to 600 values when exporting a 10x10x6 sector from the 20x30x10
model5 grid, and that cropped values match the original uniform data.
2026-03-20 14:30:34 +01:00
Kristian Bendiksen 1f42f70d26 OpmFlowDeck: avoid swallowing error messages when loading deck. 2026-03-16 12:53:49 +01:00
Kristian Bendiksen 7db39cf092 #13467 Add model padding functionality for sector model export
Add Z-direction padding support for sector models based on OPM-Flow's
padmodel.cpp. This feature enables users to add padding layers above
and/or below the exported sector model grid.

Adapts padmodel.cpp from
https://github.com/hnil/opm-flowgeomechanics/blob/geomech_hypre_cgal/examples/padmodel.cpp
Commit: 5ee483e

Fixes #13467.
2026-02-16 18:42:15 +01:00
Kristian Bendiksen 1c9c5a85ad #13333 Simulation Input: Add EDITNNC export functionality for sector models 2026-01-12 17:19:38 +01:00
Kristian Bendiksen fe609def88 Simulation Input: Add refinement support for border boundary conditions
Add refined grid border detection for BCCON_BCPROP boundary conditions.
The refined functions operate on the exported refined grid dimensions,
ensuring border cells are correctly identified when using grid refinement.
2025-12-12 13:38:22 +01:00
Kristian Bendiksen b1f9f8c4a5 Simulation Input: Fix bug in BOX transformation when using refinement. 2025-12-11 12:07:21 +01:00
Kristian Bendiksen ab708f5e0e Simulation Input: Handle AQUNUM keyword. 2025-12-11 12:07:21 +01:00
Kristian Bendiksen d3f43dfebb Simulation Input: Handle EQUALS keyword without ijk box. 2025-12-11 12:07:21 +01:00
Kristian Bendiksen e08ba63f01 Simulation input: Add refinement test. 2025-12-01 14:20:49 +01:00
JJ 6689000d85 New Sector Model Export user interface (#13247)
* Add sector model export wizard
* GUI cleanup
* Use job name as deck name for simulation runs
* Remove new things from old export GUI
* Use radio-buttons for enum dropdowns
2025-11-28 16:43:51 +01:00
Kristian Bendiksen 655737aa33 Simulation Input: Add test for bccon/bcprop. 2025-11-19 16:47:27 +01:00
Kristian Bendiksen 0626c2e199 Simulation Input: reintroduce OPERNUM+OPERATER/BCCON+BCPROP.
Was incorrectly removed in the refactoring in c47e8ac76f
2025-11-19 16:47:27 +01:00
Kristian Bendiksen 4df9bc49c8 Simulation Input: add test case for opm-tests model5. 2025-11-19 16:47:27 +01:00
Kristian Bendiksen c47e8ac76f Refactor: move simulation file/input code to separate class. 2025-11-17 15:48:12 +01:00