Commit Graph
4001 Commits
Author SHA1 Message Date
Kristian Bendiksen 14a4aa0f62 #14621 Sector model export: Preserve include-only wrapper files
Include files containing only INCLUDE statements, such as a wrapper
collecting many lift curve (.ecl/.vfp) files, were dropped during
sector model export, and the includes for all leaf files were written
directly into the exported .DATA file.

Update the custom-opm-common submodule so FileDeck recreates
include-only files in the output directory and preserves the include
hierarchy at any nesting depth. Add a regression test exporting a deck
with a nested include-only wrapper and reloading the result.
2026-08-31 21:48:39 +02:00
Kristian Bendiksen fd35578463 #14620 Sector model export: limit deck lines to 132 characters
Table keywords such as PVTO and SGOF were rewritten by opm-common as one
unbounded line when saving the deck, exceeding the 132 character line
limit of Eclipse 100 and making exported sector models unusable there.

Update the custom-opm-common submodule so DeckOutput tracks the current
line width and wraps records at item boundaries before a line exceeds
132 characters. Quoted values are never split. Add a regression test
that round-trips a deck with a long rel. perm. table and a record of
quoted mnemonics.
2026-08-31 20:17:48 +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 91af3667c8 Add field and object keywords 2026-08-31 12:22:51 +02:00
Magne Sjaastad fd219da50f #14619 ReservoirDataModel: Guard well target mapping against missing or incomplete result data
RigWellTargetMappingTools accessed cellScalarResults() and result vectors without verifying the requested time step or index was within bounds, and without checking for null case data pointers.  Add the missing guards.
2026-08-31 12:20:48 +02:00
Magne Sjaastad cda9551dbb #14222 Well target mapping: Avoid clamp crash with invalid min/max bounds
std::clamp() invokes undefined behavior when the low bound is greater
than the high bound. In resetMinimumCellValuesToDefault(), the
minimum/maximum bounds for saturation, pressure, permeability and
transmissibility are derived from case data and can end up inverted
when no data is available, which crashed or produced garbage values.
2026-08-31 12:20:48 +02:00
Magne Sjaastad f8a55787fd #14646 MSW: Number fracture branches by measured depth
The branch number of a fracture followed the order the fractures were created, so appending a second set of fractures to a well put them after the existing ones regardless of where along the well they sit. Sort by the fracture start MD instead. The order also decides which fracture connects a grid cell shared by two of them.
2026-08-31 10:28:41 +02:00
Magne Sjaastad d085f6ce74 #14646 MSW: Report a grid cell only once across COMPSEGS branches
A grid cell has a single COMPDAT connection and must be connected to exactly one segment, but the geometry-based export emitted one COMPSEGS row per branch intersecting the cell. Restore the well-global bookkeeping the removed tree path had: tag each branch with its origin and let the branch carrying most flow claim a shared cell, perforations before fishbones before fractures.
2026-08-31 10:28:41 +02:00
Magne Sjaastad 377751eb68 Histogram: Make selected sub-plot visible in histogram multi plot
Selecting a curve or a plot inside a RimHistogramMultiPlot in the project
tree now scrolls the multi plot view to make the containing histogram plot
visible, mirroring the existing behavior for RimSummaryMultiPlot.
2026-08-31 10:28:10 +02:00
Magne Sjaastad a4e031b734 Grid statistics: Zoom all on histogram plot after creation
When creating a histogram from grid cell results (e.g. PERMX) via
"Create Grid Statistics Plot", zoom the histogram plot to fit the data
right after the curve is populated, instead of leaving it at default axis
ranges.
2026-08-31 10:28:10 +02:00
Magne Sjaastad e5c3e54227 #14538 Well path: Preserve renamed file well name without breaking legacy projects
Reverts the unconditional change from commit 74ffc822f2 and replaces it with
a safer fix: only skip re-initializing the well path name from the source
file on reload when a name has already been set. Older projects that never
serialized the well path Name field (e.g. TestCase_RFT_PLT/RegressionTest.rsp)
still get their name populated from the file on load, while renamed well
paths in newer projects keep their custom name across reloads.

Restores the RMS well round-trip test that verifies a renamed well path
name persists after save/reopen.
2026-08-31 10:28:10 +02:00
JJ 75ebd7f20b Well target updates (#14619)
Support well target mapping calculations for ensembles.
2026-08-28 13:36:02 +02:00
Kristian Bendiksen 04be720491 #14614 Orion Events: Make import an experimental feature 2026-08-28 13:22:33 +02:00
Kristian Bendiksen b00471dce2 #14614 Orion Events: Add menu item for importing events from file
Add RicImportOrionEventsFeature to File -> Import -> Well Data and the well
path collection context menu. The feature opens a file dialog and launches
the Python interpreter asynchronously with the new --apply mode of the
rips.orion_events CLI, which connects back to the running instance through
RESINSIGHT_GRPC_PORT and applies the events to the well event timeline.
Output is shown in the Process Monitor panel.
2026-08-28 13:22:33 +02:00
Magne Sjaastad 5f0c3f8a54 #14632 Guard against out-of-range time step index when loading results
A case in an ensemble can have fewer time steps than the case defining the time step axis of a statistics case. The time step index was used to index m_cellScalarResults directly, reading past the end of the vector in Release where CAF_ASSERT is a no-op.
2026-08-28 07:15:47 +02:00
Magne Sjaastad 6d7959d150 #14542 Summary: Assign unique case ids when importing multiple cases
Summary cases are created and given a case id before they are added to the
project. The id search only sees cases already in the project, so every case
in a batch import was given the same id.

The Data Sources tree stores the owning case id in each summary address, and
all lookups resolve to the first case with that id. Selecting the same vector
from several cases therefore produced a single curve, and dropping a vector
from one of the other cases hit the duplicate check and did nothing.
2026-08-28 07:02:50 +02:00
Magne Sjaastad 5e17f9986d #14627 Grid statistics: Fix NaN deviation for near-constant results
The single-pass sum-of-squares formula subtracts two large and nearly equal numbers. Where a result such as PORO is identical or near-identical across the realizations, the true variance is below the rounding noise floor, the radicand turns negative and sqrt() returns NaN.

Compute the deviation in two passes instead, centering on the exact mean. This also removes the loss of significance the old formula had for values with a large common offset.

Min, max, range, mean and deviation all report HUGE_VAL when the input holds no valid values, but the sum reported the zero it was accumulated from. A caller testing the result with isValidNumber would accept that zero as real data.
2026-08-28 07:01:57 +02:00
Magne Sjaastad ca8c1b8d04 #14626 Add Import Summary Case to the File menu in the main window 2026-08-27 15:02:49 +02:00
Magne Sjaastad 9a5af909f2 #14511 Activate 3D view after importing grid model from summary case 2026-08-27 12:45:28 +02:00
Magne Sjaastad 3508b0a72e #14558 3D filters: Reconnect filter signals after project load
Reading a caf::PdmPtrField sets the pointer to null before the reference string is resolved, and clearing a ptr field disconnects all signals between the referenced object and the field owner. The signal connections established by RimFilterInViewCollection::setSourceCollections() in the view constructor were therefore lost when a project was loaded, and adding a cell filter, property filter or data filter no longer refreshed the Filters node in the project tree. Reconnect in initAfterRead, which runs after the references have been resolved.
2026-08-27 11:42:50 +02:00
Magne Sjaastad 5edefe4ad7 #14602 Summary: Keep the summary toolbar active for child objects of a multi plot
The toolbar is only shown when the active plot view window is a multi plot. When a child object is selected, the first ancestor view window is the sub plot, so the toolbar was cleared and hidden.

Use the summary multi plot as active plot view window when any object inside the multi plot is selected.
2026-08-27 10:16:06 +02:00
Magne Sjaastad 61117162da #14602 Contour map: Keep interactive panning when reloading a project
Viewer::setView() moves the camera to look straight at the point of interest. Panning does not move the point of interest, so this discarded the camera position restored from the project file.

Only reset the view direction if the camera is not already oriented top-down, which is the case when a contour map has been rotated by a linked 3D view.
2026-08-27 10:16:06 +02:00
Magne Sjaastad cf3dadacf7 #14602 UI adjustments for summary import and curve calculator
Use a file dialog caption matching the imported file type instead of always showing "Import Grid Model".

Parent the summary vector selection dialog to the active window, so closing it does not raise the 3D main window in front of the plot window when opened from the Summary Curve Calculator.
2026-08-27 10:16:06 +02:00
Magne Sjaastad 6c63c755e7 #14606 Contour Map: Use the cached ensemble statistics when the project is reloaded
The map size of the sample grid was recomputed from the expanded bounding box and the sample spacing stored in the project file. The expanded bounding box is an exact multiple of the sample spacing, but after the limited precision of the project file the division can land just above a whole number of cells, and the map size gets one extra cell. The cache files were then rejected, and the ensemble statistics recomputed.

Store the map size in the project file, and use it directly when the sample grid is restored from the cache.

Identify the input grids of the cache validity key by file path, size and modification time, so that the cache is also invalidated when a grid file is modified in place. Label and count the primary case and the ensemble cases, so that a primary case can not be mistaken for the first ensemble case.
2026-08-27 09:37:31 +02:00
Kristian Bendiksen d760925090 #14611 Nested hybrid grid: number sibling LGRs consistently
A refinement level with a single reconstructed LGR keeps the bare level name (LGR_NHG_L2). A level with several LGRs now numbers all of them with 1-based suffixes (LGR_NHG_L4_1 .. LGR_NHG_L4_N) instead of leaving the first one without a suffix.
2026-08-26 14:59:25 +02:00
Magne Sjaastad d7ea4351e3 #14600 Keep MdiWindowController as project file keyword
Older versions of ResInsight depend on this keyword to create the window controller for plot windows. 3D views work with both keywords, because Rim3dView creates the controller in its constructor, while plots only get one from the project file. DockWindowController is kept as a read alias so project files written by recent dev builds still load.
2026-08-26 14:42:42 +02:00
Kristian Bendiksen 74ffc822f2 #14538 Well path: Preserve renamed file well name
The renamed well path name is serialized correctly, but reopening the project reloads the source well path file and overwrites the saved name with the name from that file. The reload flag only protected the completion export name, despite the loader also updating the displayed well path name.

Only initialize the well path and export names from the source file during first import. Subsequent data reloads preserve the names stored in the project while continuing to refresh geometry and metadata.

Add an RMS well round-trip test that renames an imported well, saves and reopens the project, and verifies that the custom name is retained.
2026-08-25 08:25:20 +02:00
Magne Sjaastad 7b11292839 #14596 Skip computing corner coordinates for cells excluded by the K filter
Move the call to cellCornerVertices below the K filter early out, so the corner coordinates are only computed for the cells that are actually tested against the polygon.
2026-08-25 08:22:29 +02:00
Magne Sjaastad 4a6ebedade #14596 Name the remaining unnamed OpenMP critical sections
All unnamed critical regions map to the same implicit name, so a single process wide lock was shared by summary import, geometry generation, grid bounding box computation and NNC merging. Unrelated parallel loops therefore serialized against each other.

Give each region a critical_section_ name describing what it protects. The two regions guarding RifOpmCommonEclipseSummary::sm_createdEsmryFileCount deliberately share one name, as they protect the same counter.
2026-08-25 08:22:29 +02:00
Magne Sjaastad eec9a88bd3 #14596 Collect cells per thread in polygon filter instead of using critical sections
All four cell filter loops guarded a push_back into a shared container with an unnamed critical section, taking a process wide lock for every cell matching the polygon. On large grids with a permissive polygon this can be slower than running single threaded, and it made the resulting cell order vary between runs.

Collect the cells in per thread buffers and append them in thread order after the parallel region, following the pattern used elsewhere in the code base. This removes eight critical sections.
2026-08-25 08:22:29 +02:00
Magne Sjaastad 5c325dcc0b #14596 Remove unnecessary critical section in RiaCurveMerger
Each iteration writes to its own element of accumulatedValidValues, which is sized before the loop, so no synchronization is required. The write to curveValues a few lines below uses the same pattern without a critical section.

All unnamed critical regions share a single process wide lock, so this also removes contention against unrelated parallel loops.
2026-08-25 08:22:29 +02:00
Magne Sjaastad ad0f5f1bce #14596 Remove dead ordered clause and per-triangle lock in NNC geometry generation
The loop was declared with an ordered clause, but the body contains no ordered region, so the clause only enabled the ordered scheduling machinery without providing any ordering. The intended deterministic vertex order was not achieved either, because the actual synchronization was a critical section, which does not preserve iteration order.

Collect vertices in per thread buffers and merge them in thread order after the parallel region, following the pattern already used in RivFaultGeometryGenerator. This removes a lock acquisition per triangle in the innermost polygon loop, and makes the generated geometry identical from run to run.
2026-08-25 08:22:29 +02:00
Magne Sjaastad fa85100da7 #14596 Remove dead reserve and redundant barrier in NNC computation
totalNumberOfConnections was declared, listed in the reduction clause and used to size otherConnections, but it was never incremented. The counting was lost when the loop body was moved into extractConnectionsForFace, so the call has always been reserve( size() + 0 ), which RigConnectionContainer::reserve turns into a no-op.

The reserve was also called by every thread on the shared container without synchronization. Removing it eliminates that data race. The explicit barrier is redundant as well, since the omp for construct has no nowait clause and therefore already synchronizes before the merge.
2026-08-25 08:22:29 +02:00
Magne Sjaastad a7684a14d6 #14596 Use #pragma omp parallel for when building corner point grids
The loops were annotated with #pragma omp for, which is a work-sharing construct that does nothing outside an enclosing parallel region. Replace it with #pragma omp parallel for so the cell loops actually run in parallel.
2026-08-25 08:22:29 +02:00
Kristian Bendiksen 0adf471a5d #14514 Orion Events: Include report dates in schedule 2026-08-24 13:26:19 +02:00
Kristian Bendiksen e1b192ff86 #14570 Orion Events: Fix schedule user metadata 2026-08-24 13:26:19 +02:00
Kristian Bendiksen d6878ea562 #14513 Orion Events: Add raw schedule text events 2026-08-24 13:26:19 +02:00
Kristian Bendiksen 2ef4814257 #13672 Python: Add APIs to arrange and link views 2026-08-24 12:43:44 +02:00
Magne Sjaastad c9750f4698 Avoid crash when grid data is missing in shared grid ensemble 2026-08-24 09:10:22 +02:00
Magne Sjaastad a6b903acf3 Avoid terminate on parse error in element property file 2026-08-24 09:10:22 +02:00
Magne Sjaastad d53e5b48b3 Avoid GUI cleanup on a main window being destroyed 2026-08-24 09:10:22 +02:00
Magne Sjaastad 7032832774 Avoid crash when displacements are missing for GeoMech intersections 2026-08-24 09:10:22 +02:00
Magne Sjaastad c6c5ff5808 #14584 Move ResInsight-tests out of the shared build root
ResInsight-tests linked into the build root and copied its full runtime DLL
set there as a POST_BUILD step, the same pattern that made
extract-projectfile-versions race against the generated_classes.py edge. The
set is a superset of the one that failed, covering Qt6Gui, Qt6Widgets and the
rest, and nothing orders it against the code generation edge either. It fires
rarely only because copy_if_different compares content, so windeployqt having
already placed identical DLLs makes it a no-op. On a cold build where the copy
wins that race it genuinely writes.

Give the target its own RUNTIME_OUTPUT_DIRECTORY, and point the companion
PreBuildFileCopyTest target at the same directory so the ODB, OpenVDS and HDF5
runtime files stay next to the executable. That target runs before the link
creates the directory, so create it first.

Update the three workflows that run the test executable by path.
2026-08-22 11:50:55 +02:00
JJ e9b60d7167 Add tile windows feature (#14583)
Support tiling and maximizing views
2026-08-21 16:25:32 +02:00
Magne Sjaastad 135ed69369 #14559 Summary Calculator: Update dependent data when the last calculation is deleted
deleteCalculation() removes the calculation before rebuildCaseMetaData() is called, and updateDataDependingOnCalculations() returned early for an empty collection. The addresses created by the last calculation were then left behind in the readers until the next refresh or a reload of the project.

Perform one more update after the last calculation is deleted, and keep the early return for the case where no calculations have been present.
2026-08-21 15:54:28 +02:00
Magne Sjaastad 1778a9637b #14559 Delta Ensemble: Refresh calculated addresses for all realizations
A delta ensemble creates summary addresses for all realizations of the source ensembles. When a calculation was created after this, only the realizations showing tree nodes had their addresses recreated. The other realizations had no calculated address, and RimDeltaSummaryCase::values() discarded the vector as being present in only one of the source ensembles. Only realization 0 was plotted until the project was reloaded.

Add RifSummaryReaderInterface::refreshCalculatedAddresses() to recreate the addresses of the calculated readers without touching the native readers, and call it for all cases in an ensemble when calculations are updated.
2026-08-21 15:54:28 +02:00
Magne Sjaastad 2a35edcca9 #14555 Make sure views in a grid ensemble are updated when a grid calculation is evaluated
A case in a grid ensemble is displayed by views in the view collection of the grid ensemble, but RimEclipseCase::reservoirViews() only inspected the view collection of the case itself and the global view collection. No views were found for such a case, so the display model was never rebuilt after a grid calculation was evaluated. When loading a project file, the view was left with the display model created before the calculation was evaluated, showing no legend and no cell colors.
2026-08-21 14:53:48 +02:00
Magne Sjaastad 6022980d54 #14555 Allow statistical grid cases to be used as source for grid calculator expressions
Statistics cases were filtered out of the case lists used by the grid calculator, both in the variable table and in the Select Result dialog. Statistics cases belonging to a grid ensemble were also missing from RimProject::allGridCases(), as only the source cases of the ensemble were collected. Statistics cases in a grid case group were already included.

A statistics case can be used as source only. A calculated result stored in a statistics case is interpreted as computed statistics, and would block recomputation of the statistics, so a statistics case is never assigned as destination case.

A statistics case with no computed statistics is not necessarily opened. Make sure source cases are opened before grid dimensions are validated and before result data is read.
2026-08-21 14:53:48 +02:00
Magne Sjaastad e2319d0bd3 #14566 OpenTelemetry: stop unbounded log flood on send failures
Send one batched request per event batch instead of one request per event.
Application Insights v2/track accepts an array of envelopes, so a batch of up
to maxBatchSize (512) events was previously issued as 512 concurrent POSTs.
QNetworkAccessManager only opens a handful of connections per host, so the
queued requests were aborted by their own transfer timeout before reaching the
wire, reported as "HTTP 0: Operation canceled".

Honour the circuit breaker in processEvents(). It was only checked when
enqueuing, so the up to 10000 already queued events kept being posted at full
rate after the breaker opened. The crash and shutdown flush bypasses the
breaker so a crash report is still attempted.

Keep at most one request in flight. Failures are only observed when the reply
finishes, which for an unreachable endpoint takes the full transfer timeout,
and the 100 ms timer kept launching requests during that window.

Log the circuit breaker transition once instead of on every subsequent failure.

Only read the reply body when the device is open. An aborted reply has a closed
device, and reading from it emitted a QIODevice warning per request.

Call attemptReconnection() from the process timer. It was dead code, so once
the breaker opened it could only close if a reply happened to succeed.
2026-08-21 14:37:58 +02:00
Magne Sjaastad f13fbbbd87 #14565 Grid model results: Make SGAS for Two-phase Gas/Water models when missing in output
Simulators for two-phase gas/water models may report only SWAT. In this case no SGAS result entry was created, so SGAS was missing from the result list and TERNARY fell back to computing SOIL = 1 - SWAT, presenting the gas saturation as oil saturation.

Add RigSgasResultCalculator that creates a placeholder SGAS entry when the model has gas and water but no oil phase, SWAT is present and SGAS is missing. SGAS is then computed as SGAS = 1 - SWAT. The computation is dispatched from findOrLoadKnownScalarResult() and findOrLoadKnownScalarResultForTimeStep() the same way as SOIL.

The equivalent logic in RigCaseCellResultsData::testAndComputeSgasForTimeStep() was only reachable from RigSoilResultCalculator, which never runs for models without an oil phase. This function is replaced by computeSgasForTimeStep() delegating to the new calculator, and the unreachable call in RigSoilResultCalculator is removed.
2026-08-21 14:36:22 +02:00