Commit Graph
60 Commits
Author SHA1 Message Date
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
Magne Sjaastad 56e98ba1c4 #14476 ApplicationLibCode: Replace CVF_ASSERT with CAF_ASSERT
Migrate all assert macros in ApplicationLibCode to CAF_ASSERT and remove every
use of cvfAssert.h.

CVF_ASSERT is replaced one to one. CVF_TIGHT_ASSERT is also replaced by
CAF_ASSERT, which is semantically exact: CVF_ENABLE_TIGHT_ASSERTS is 1 only
under _DEBUG, and that is what CAF_ASSERT now does. The two CVF_FAIL_MSG sites
become CAF_ASSERT( false && "message" ), preserving the message with the idiom
already used elsewhere in the code base.

Counts before and after: CVF_ASSERT 1044 to 0, CVF_TIGHT_ASSERT 66 to 0,
CVF_FAIL_MSG 2 to 0, cvfAssert.h references 154 to 0.

Include handling: files that included cvfAssert.h directly now include
cafAssert.h instead, includes left dead by the migration are removed, and files
that were relying on cvfAssert.h transitively get an explicit cafAssert.h. Files
that reach cafAssert.h through another caf header are left unchanged; a missing
include here is a compile error, not a silently disabled assert.

ResultStatisticsCache links only LibCore and therefore had no path to
cafAssert.h. Add the cafPdmCore directory as a private include path rather than
linking the library, since cafAssert.h is header only.

Note that this stops these asserts from firing in Release and RelWithDebInfo,
where CVF_ASSERT was previously active.
2026-08-07 15:05:57 +02:00
Kristian Bendiksen 5ffcb69acc #13126 RiaLogging: Use std::string_view instead of QString for logging 2026-05-08 10:11:09 +02:00
Kristian Bendiksen 87e9ab7b5b Sector Export: scale MINPV with refinement
This avoids marking small cells as inactive.
2026-04-29 13:14:49 +02:00
jonjenssen bc7fbc7b76 Add valve keywords to list of well keywords to filter when exporting sector model 2026-04-27 15:09:39 +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 4aa0910db3 #12957 Sector Model Export: add non-uniform refinement support to faults code path
Add RigNonUniformRefinement overloads for extractFaults and faultsKeyword,
following the existing dual-overload pattern. The Vec3st overloads now
delegate via fromUniform() to preserve backward compatibility. Update
addFaultsToDeckFile to call effectiveRefinement() instead of refinement().
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 3e0b2b3fe8 #12957 Sector Model Export: fix off-by-one in WELSPECS HEAD coordinates for non-uniform refinement
The non-uniform path produced 0-based indices using subcellCount/2,
while WELSPECS expects 1-based values. Use (subcellCount+1)/2 to match
the uniform formula semantics of (ref+1)/2.
2026-03-30 11:24:56 +02:00
Kristian Bendiksen a9918f814e #12957 Sector Model Export: add logging for non-uniform refinement
Log sector size, grid-to-sector coordinate conversion, parsed widths,
clamping, and final refined grid dimensions to help diagnose refinement
issues.
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 06f985b1ed #12957 Sector Model Export: add non-uniform cell refinement
Add a new "Non-Uniform" refinement mode that coexists with the existing
uniform refinement. Users can specify a cell range, direction, and
fractional subdivision widths to create variable-resolution grids.

Core infrastructure:
- RigNonUniformRefinement: per-dimension refinement with cumulative
  fractions and offset tables for O(1)/O(log n) lookups
- RiaCellDividingTools: non-uniform createHexCornerCoords overload
- RigGridExportAdapter: non-uniform constructor, mapping, and
  coordinate transformation overloads

Pipeline integration:
- RigSimulationInputSettings: non-uniform refinement storage
- RigSimulationInputTool: non-uniform paths for grid construction,
  data cropping, BOX context, well keywords, and WELLDIMS
- RifEclipseInputFileTools: non-uniform extractKeywordData overload

UI:
- RicExportSectorModelUi: Uniform/Non-Uniform mode selector with
  direction, cell range, and fractional widths fields
2026-03-30 11:24:56 +02:00
Kristian Bendiksen 27c0647611 Refactor: split long method. 2026-03-20 14:30:34 +01:00
Kristian Bendiksen 6ae364200f #13411 Sector Model Export: skip ACTNUM in replaceKeywordValuesInDeckFile
ACTNUM is already correctly computed by updateCornerPointGridInDeckFile
with proper inactive cell handling. Prevent replaceKeywordValuesInDeckFile
from overwriting it with all-1s via extractKeywordData, which treats
ACTNUM as a category result and sets defaultExportValue=1 for all cells.
2026-03-20 14:30:34 +01:00
Kristian Bendiksen cc61559c7d Janitor: Cleanup includes. 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 e6d5c8e6d4 #13411 Sector Model Export: skip ACTNUM in cropDataKeywordsInDeckFile
ACTNUM is handled separately during export, so it should not be
cropped by the generic data keyword cropping logic.
2026-03-20 14:30:34 +01:00
Kristian Bendiksen 983be234c1 #13411 Sector Model Export: crop direct listing data keywords from deck
Add cropDataKeywordsInDeckFile() that reads raw cell values directly from
OPM deck keywords (via isDataKeyword/getRawDoubleData/getIntData) and crops
them to the sector box. This handles relperm endpoint arrays (SWL, SWU,
SGCR, SOWCR, etc.) that are specified via direct listing in the .DATA file
and not available in eclipse case results. Runs before
replaceKeywordValuesInDeckFile, which now skips already-cropped keywords.
2026-03-20 14:30:34 +01:00
Jon Jenssen 62519d9b24 Support custom DATA file input name.
Fix crash due to invalid cell box
2026-03-10 15:27:48 +01:00
Jon Jenssen 04dc045b19 Handle AQUNUM and AQUANCON keywords in sector export 2026-03-10 13:40:51 +01:00
JJ ecd89bc8ab Sector model export: support WLIST kw (#13641)
* Support ADD and NEW operations in WLIST kw
* Add support for DEL operation
2026-02-23 20:15:04 +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 92d6276266 Refactor: replace generic replaceKeyword with proper keyword construction. 2026-02-16 18:42:15 +01:00
JJ 5bb431ef33 Improve handling of data keywords in deck files. (#13423)
* Handle data keywords, and use data flag to check if a result with a given name should be added or not to the output file.
2026-01-14 12:06:59 +01:00
Kristian Bendiksen e34d36ee99 Simulation Input: Support more well keywords. 2026-01-12 17:19:38 +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 11dfdc2c21 Refactor: convert RigBoundingBoxIjk to template class. 2026-01-12 09:58:55 +01:00
Kristian Bendiksen 15ef5e4701 Refactor: use bounding box more. 2026-01-12 09:58:55 +01:00
Kristian Bendiksen a4ade9e595 Remove duplicated code. 2026-01-12 09:58:55 +01:00
Kristian Bendiksen 2836885850 Refactor: avoid using VecIjk1 internally. 2026-01-12 09:58:55 +01:00
jonjenssen 3821434022 Support removing user specified keywords from output sector model. 2026-01-12 08:13:43 +01:00
Kristian Bendiksen 84dd61d4b5 #13347 Remove duplicate FAULTS keywords before adding to GRID section
Apply the same pattern used for ACTNUM keyword: remove all occurrences
of FAULTS before adding a single instance to the GRID section. This
handles deck files where FAULTS appears more than once.
2026-01-05 09:22:21 +01:00
JJ 64b5dcd1b9 Add validation to sector model export wizard (#13348)
* Add validation to sector model export wizard
2025-12-17 13:16:10 +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 cfcdd67255 Simulation Input: Refactor border conditions to use in-memory results. 2025-12-12 13:38:22 +01:00
Kristian Bendiksen 11352f525c Simulation Input: Handle multiple ACTNUM keywords 2025-12-11 12:07:21 +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 101b4f4926 Refactor: extract common code for converting sector box 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 799c774cbe Simulation Input: refactor to remove duplicated code. 2025-12-08 15:27:51 +01:00
Kristian Bendiksen 206c2ebed8 Simulation Input: Handle WTEST keyword. 2025-12-08 15:27:51 +01:00
Kristian Bendiksen afbcc13606 Simulation Input: Handle ADD keyword. 2025-12-08 15:27:51 +01:00
Kristian Bendiksen cfd5f3a310 Simulation Input: Handle COPY keyword. 2025-12-08 15:27:51 +01:00
Kristian Bendiksen 5e67dbd48f Simulation Input: Fix EQUALS keyword.
Ended up handling the same keyword twice.
2025-12-08 15:27:51 +01:00
Kristian Bendiksen 90ce34ac6c Simulation Input: handle BOX records. 2025-12-08 15:27:51 +01:00
Kristian Bendiksen d053d4b0a6 Simulation Input: Handle MULTIPLY keyword. 2025-12-08 15:27:51 +01:00
Kristian Bendiksen 1ed297e124 Simulation Input: remove excessive logging. 2025-12-05 13:06:29 +01:00