Commit Graph
147 Commits
Author SHA1 Message Date
Kristian Bendiksen 6357cef1ab #14334 Fix formation dip sign when aligning fracture with formation dip
The sign of the projected formation direction vector flips with the fracture
direction normal, which follows the well drilling direction, while the fracture
azimuth defining the dip rotation in RimFracture::transformMatrix() is only
defined mod 180 degrees. Canonicalize the formation direction against the
fracture azimuth direction before computing the dip, so a positive dip means
the formation descends toward the azimuth direction.

Restore std::abs() in calculateFormationDipFromHorizontal() so the StimPlan
model formation dip (BedDipDeg in the Asymmetric FRK export) keeps the
non-negative convention from #8877.
2026-07-13 14:34:17 +02:00
Jon Jenssen d2d7c6ac61 First non-MDI version. Still some missing links and features. 2026-06-17 13:55:32 +02:00
Kristian Bendiksen a4fe22508a #14192 Python: Update discrete property color legend in place instead of delete/create
Address review feedback on #14199: deleting and recreating the legend left
views bound to the old legend pointing at a deleted object. Add
RimColorLegendCollection::updateColorLegend and a matching UpdateColorLegend
scriptable method that mutate the existing custom legend (name and items) so
referring views keep their binding and are notified once. A new legend is only
created when none is registered for the result or the registered legend is a
standard legend.

set_discrete_property_category_names now performs a single atomic call instead
of delete + create + per-item appends. The empty-dict removal path still uses
DeleteColorLegend.
2026-06-10 18:02:07 +02:00
Kristian Bendiksen b274641e0c #14198 Exclude ResInsight-generated faults from default fault distance selection
When a new Fault Distance defaults to all faults, the ResInsight-generated
undefined grid faults were ticked by default. Add RimFaultInView::isGeneratedFault
and filter these faults out of the default selection in both the UI feature and
the Python command. An explicit fault selection is still honored.
2026-06-10 13:11:16 +02:00
Kristian Bendiksen c2b4f83643 #14101 Rename RimFaultDistanceResult/Collection classes and files to RimFaultDistance/RimFaultDistanceCollection
Carries the "Fault Distance" rename through to the C++ class names, file
names, PDM/scriptable keywords and the Python API (add_fault_distance,
class FaultDistance). The RicNewFaultDistanceResultFeature command class
keeps its name.
2026-06-08 21:42:19 +02:00
Kristian Bendiksen f2e40ee754 #14101 Python: trigger fault distance calculation when result object is created 2026-06-08 21:42:19 +02:00
kriben afb0e8726a Fixes by clang-format 2026-06-01 17:40:21 +02:00
Kristian Bendiksen 19c547cc2e Well Event: Add opt-in column-aligned schedule output
Add an align_columns option to schedule generation. When enabled, each
keyword is serialized with a '--'-prefixed column-header comment and data
rows right-aligned into fixed-width columns, instead of the compact default
form. The default output is unchanged.

A new RimKeywordFactory::deckKeywordToAlignedString introspects the OPM deck
model and renders each item in its own column (consecutive defaults are not
collapsed into 'N*'). The flag is threaded through RicScheduleDataGenerator
and exposed on the GenerateSchedule scriptable method as align_columns in the
Python generate_schedule_text wrapper.
2026-06-01 15:45:03 +02:00
Kristian Bendiksen 31c1271034 #13890 Faults: Move fault distance results collection to the view
Reparent RimFaultDistanceResultCollection so it is owned directly by
RimEclipseView instead of RimFaultInViewCollection, and show it as a
top-level node next to the Faults node in the project tree.

RimFaultDistanceResult::calculateValueOptions now reaches the fault list
through the view (the fault collection is a sibling rather than an
ancestor after the move). RicNewFaultDistanceResultFeature resolves the
view from the selection and takes both the distance collection and the
all-faults fallback from it.

The scriptable API moves with the collection: add_fault_distance_result
is now exposed on RimEclipseView (view.add_fault_distance_result(...))
via the new RimcEclipseView, replacing RimcFaultInViewCollection.
2026-06-01 11:28:46 +02:00
Kristian Bendiksen b78ef0d0a1 #13890 Python: Add scriptable API for selected-fault FAULTDIST
Expose the new RimFaultDistanceResult facility to Python by marking the
relevant PDM classes and fields scriptable. RimEclipseView's
m_faultCollection, RimFaultInViewCollection, RimFaultInView,
RimFaultDistanceResult, and RimFaultDistanceResultCollection are now
scriptable, so faults can be enumerated from Python via
view.fault_collection().faults().

A new Rimc method add_fault_distance_result on RimFaultInViewCollection
takes a name and a list of fault objects, creates the result
(auto-numbered FAULTDIST<n> when the name is empty), and returns the
new RimFaultDistanceResult. An empty fault list falls back to every
fault in the view, matching the static-native FAULTDIST behaviour.

Add a Python test exercising both a subset call and a parity check
that asserts the all-faults result matches the existing static-native
FAULTDIST cell-for-cell.
2026-06-01 11:28:46 +02:00
Kristian Bendiksen cb9274ecd6 Python: Add first_date_as_comment option to generate_schedule_text
Some commercial simulators reject a DATES keyword whose value equals the
simulation start date. The earliest event date is, by construction, that start
date, so generate_schedule_text now emits it as a comment line (e.g.
"-- Date: 1 JAN 2024") instead of a DATES keyword by default.

The new first_date_as_comment parameter (default True) threads from the Python
wrapper through the GenerateSchedule scriptable method into
RicScheduleDataGenerator. Only the first/earliest date is affected; later dates
are always emitted as DATES keywords. Pass first_date_as_comment=False to
restore the previous behavior.
2026-06-01 11:28:27 +02:00
Kristian Bendiksen 9515e6c277 #13273 Well Event: Support completion number on perforation events for COMPLUMP
Add a completion_number parameter to the add_perf_event Python API
(AddPerfEvent scriptable method) and a matching field on
RimWellEventPerf. When a timeline perforation event is materialised into
a RimPerforationInterval, a non-zero completion number is copied across,
so it flows through the existing completion-data path onto
RigCompletionData.

The schedule generator now emits COMPLUMP alongside COMPDAT: COMPDAT
generation is folded into generateCompletionsForWell, which computes the
completion data once and builds both keywords from it via the existing
RimKeywordFactory::complumpKeyword (added in #13273). COMPLUMP only
produces records for perforations that have a completion number and is
merged across wells like COMPDAT.
2026-05-29 15:43:30 +02:00
Kristian Bendiksen 24269b07d5 #14079 Well Event: Export MSW keywords per well via explicit well list
Replace the include_welsegs / include_compsegs boolean flags on the
schedule-generation API with a list of wells (export_msw_for_wells) that
gates the multi-segment-well keywords. WSEGVALV and WSEGAICD are now gated
the same way as WELSEGS and COMPSEGS: all four are emitted only for wells
present in the list. An empty list (the default) suppresses MSW export for
all wells, while COMPDAT and well-control keywords are unaffected.

C++: RicScheduleDataGenerator takes a std::set<const RimWellPath*> mswWells
and generateMswForWell early-returns for wells not in the set.
RimcWellEventTimeline_generateSchedule replaces the two bool fields with a
scriptable PdmPtrArrayField<RimWellPath*>, resolved via
ptrReferencedObjectsByType().

Python: generate_schedule_text / generate_schedule expose
export_msw_for_wells (List[WellPath]) instead of the boolean flags. Updates
the well_event_schedule example and adds regression tests covering the
empty-list default, per-well selection, and WSEGVALV/WSEGAICD gating.
2026-05-29 15:43:30 +02:00
Kristian Bendiksen c74ed10157 Well Event: generate_schedule takes an Eclipse case object directly
Replace the integer eclipse_case_id parameter on
RimcWellEventTimeline_generateSchedule with a
caf::PdmPtrField<RimEclipseCase*>. The execute() method no longer needs
to walk the project tree and look up the case by ID — the gRPC layer
resolves the object pointer for us.

generate_schedule_text passes the Eclipse case object through to the
underlying generate_schedule call, matching how add_perf_event /
add_well_keyword_event already take a WellPath object rather than an
ID.
2026-05-28 08:21:17 +02:00
Kristian Bendiksen 80417b9947 #14064 Well Event: Make WELSEGS and COMPSEGS optional in schedule export
Add include_welsegs and include_compsegs flags (default True, preserving
current behaviour) to the schedule-generation API. Plumbed through
RimcWellEventTimeline_generateSchedule -> RicScheduleDataGenerator ->
generateMswForWell, gating only the WELSEGS / COMPSEGS merge calls.
WSEGVALV and WSEGAICD are unaffected.

Python: generate_schedule_text gains include_welsegs / include_compsegs
keyword arguments that forward to generate_schedule. Callers wanting
control-only / well-header-only schedule updates can now suppress the
verbose MSW table blocks.
2026-05-28 08:21:17 +02:00
Kristian Bendiksen d2e7bed6b8 Well Event: Emit RPTRST/RPTSCHED as proper mnemonic lists
Schedule-level keywords whose OPM ParserRecord is a single ALL-sized item
(RPTRST, RPTSCHED, ...) are not positional — they take a free-form list
of mnemonic tokens like `BASIC=2 DEN ROCKC NORST=1`. Previously each
`keyword_data` entry became its own DeckItem, and OPM emitted them
either as truncated positional values or as a quoted, space-collapsed
single string.

Detect that schema shape in `RifEventKeywordFormatter::formatKeyword`
and pack the user's entries into one RawString DeckItem of mnemonic
tokens: `KEY` for FLAG items, `KEY=VALUE` otherwise.

To distinguish flag mnemonics (`DEN`) from `KEY=1`-style entries, add a
new `FLAG` value to `RimWellEventKeywordItem::ItemType` plumbed end to
end (Python -> GRPC -> Rimc -> storage -> formatter). The Python API
now maps `bool True` to FLAG and silently drops `bool False`.

For positional keywords (WCONHIST etc.) FLAG items have no value to
emit and are rendered as default markers ("1*").

A `rawStringItem` helper is added to `RifOpmDeckTools` so the
mnemonic-list path can produce DeckItems whose OPM output is not
quoted.
2026-05-28 08:21:17 +02:00
Magne Sjaastad 071d6cc19e #14050 CMake: Remove dead variable definitions and references
* CMake: Remove dead CODE_HEADER_FILES variable
* CMake: Remove dead COMMAND_CODE_HEADER_FILES and COMMAND_MOC_SOURCE_FILES
* CMake: Remove dead MOC_SOURCE_FILES and FORM_FILES_CPP references
* CMake: Remove dead HEADER_FILES reference
* CMake: Delete unused CustomPCH.cmake superseded by target_precompile_headers
2026-05-26 13:10:20 +02:00
Kristian Bendiksen e21a32a180 #14001 Python: Use AppEnum fields for property_data_type arguments
Replace QString + setFromText parsing with typed
caf::PdmField<caf::AppEnum<...>> for m_propertyType and m_porosityModel
on RimcEclipseCase_propertyDataType. The script keywords stay
"PropertyType" / "PorosityModel" so the Python parameter names are
unchanged (property_type, porosity_model), and the auto-generated
StrEnum classes are now PropertyType and PorosityModelType (typed
annotations on the call site).

Register caf::AppEnum<RiaDefines::PorosityModelType> -> "PorosityModelType"
alongside the existing ResultCatType override so PorosityModelType's
auto-generated class name is stable regardless of which field the
generator visits first.

executeEnum() drops the setFromText parsing and the "Invalid property
type / porosity model" branches — the values now flow through typed
already, so an invalid enum text cannot reach the method body.
2026-05-26 08:23:28 +02:00
Kristian Bendiksen 8971ebfc9c #14001 Python: Auto-generate StrEnum return types for scriptable methods
Replace the hand-written PropertyDataType wrapper with first-class enum
return support in the code generator. Scriptable methods that derive
from the new caf::PdmEnumObjectMethod<T> template return a typed enum
value across the gRPC boundary; the Python generator emits a StrEnum
class with the texts pulled from the underlying caf::AppEnum<T> and
wraps the call site so callers receive `EnumClass(value)` directly.

caf::PdmDataContainerEnum is the small PdmObject the framework uses to
carry the enum text on the wire (single scriptable QString field).
RimcEclipseCase_propertyDataType becomes declarative: implement
executeEnum() returning the typed RiaDefines::ResultDataType and pick a
returnEnumScriptName() — the base handles serialization and reports
the four AppEnum members (UNKNOWN, FLOAT, DOUBLE, INTEGER) to the
generator.

Drop the hand-written PropertyDataType in enums.py — the generated one
in resinsight_classes is wire-equivalent and now the single source of
truth.
2026-05-26 08:23:28 +02:00
Kristian Bendiksen c33c63e8d0 #14001 Python: Add getters for discrete grid property data type and category mapping
Add the inverse APIs to the existing discrete-property setters:

- case.property_data_type(property_type, property_name) returns "FLOAT" or
  "INTEGER", matching the data_type flag passed to set_active_cell_property
  / set_grid_property.
- case.discrete_property_category_names(property_name) and
  case.discrete_property_category_colors(property_name) return the
  {int: str} mappings previously bound via
  set_discrete_property_category_names, or empty dicts when nothing is bound.

Implemented as PdmObjectMethods on RimEclipseCase and
RimColorLegendCollection so the bindings surface automatically through
generated_classes.py.
2026-05-26 08:23:28 +02:00
Kristian Bendiksen ddcfef736b Python: Add filtered_cells API for evaluating a data filter on a case
Adds case.filtered_cells(filter, time_step, grid_index) which applies any
RimCellFilter to an Eclipse case and returns a per-cell 0/1 mask. The mask
length and ordering match case.grid_property(..., grid_index), so callers
can combine the two vectors element-wise.

Implemented as a scriptable Rimc method (PdmVoidObjectMethod) on
RimEclipseCase that writes the mask via the existing key-value store, with
a thin Python wrapper mirroring the visible_cells() pattern. No proto or
gRPC service changes.
2026-05-15 08:37:46 +02:00
Kristian Bendiksen c9456bba62 Python: Add cell filter reference to perforation intervals
Lets a script attach a cell filter to a RimPerforationInterval as a
typed reference so subsequent work can gate completion-export
connections by the filter's cell mask. Pure metadata in this commit:
no consumer of RimPerforationInterval is modified, the field exists
purely as an API surface.

Add a non-scriptable caf::PdmPtrField<RimCellFilter*> m_cellFilter to
RimPerforationInterval with public cellFilter()/setCellFilter()
accessors and a "Cell Filter" group in the property panel between the
existing geometry/flow group and the Date Settings group. The field is
deliberately non-scriptable: a scriptable PdmPtrField round-trips in
Python as an opaque "ClassName:0xADDR" string rather than a resolved
object, defeating the point. Two CAF object methods on
RimcPerforationInterval expose the relationship:

- AddFilter (perf.add_filter(filter)) sets the pointer; replaces any
  existing filter (single filter per perforation).
- cell_filter (perf.cell_filter()) resolves to the referenced
  RimCellFilter object on read, mirroring the valve.template() pattern.

Composition stays in RimCombinedFilter: a script that wants AND/OR
across multiple filters attaches a combined filter as the single
filter on the perforation.

The Python example in PythonExamples builds a case-level AND combined
filter (PERMX 100..20000 AND K=5..10), creates a modeled well path
with two perforation intervals, and shares the same filter between
them. test_perforation_filter.py covers single-set, replace-on-second-
add, and shared-pointer round-trips.
2026-05-15 08:37:46 +02:00
Kristian Bendiksen 3a1ff7a1e3 CellFilters: Auto-derive combined-filter name from children
Combined filters used to always show whatever literal string the user
passed in (or the default "Combined Filter"). For programmatic creation
without a name, that string never reflected the children, leaving the
case-level "Data Filters" tree row stale when child bounds changed.

Add an m_autoDeriveName flag (default true) to RimCombinedFilter. When
on, the display name is recomputed on every relevant change — addFilter,
removeFilter, onChildAdded, onChildFilterChanged, and combineMode
toggle — by joining children's name() with " AND " / " OR ". The flag
flips to false the first time the user renames the filter via the UI
property panel or via Python (combined.user_description = "..."),
preserving any explicitly typed name verbatim from then on.

Two child-creation paths needed an extra triggerFilterChanged() so the
combined parent recomputes after the child's final name is set:
addPropertyFilterToCombinedFilter (setDefaults updates name without a
signal) and RimcCombinedFilter_addRangeFilter (Rimc applies user
params after addNewFilter).

The Rimc factory passes setAutoDeriveName(false) only when a name is
supplied. The Python example demonstrates both modes side by side, and
test_combined_filter.py adds three cases: named filter preserves its
name, auto-derived filter tracks bound mutations, and Python rename
locks the auto-derived filter.
2026-05-15 08:37:46 +02:00
Kristian Bendiksen eb70d32eb1 Python: Add scriptable Data Filters API for combined filters
Expose the case-level RimDataFilterCollection (introduced for
case-shared cell filters) to Python so scripts can build combined
filters with property-filter and IJK-range children without going
through a view.

Scriptable surface:
- RimEclipseCase.m_dataFilterCollection -> case.data_filter_collection()
- RimDataFilterCollection (object + Filters child array) -> filters()
- RimEclipsePropertyFilter (object + m_lowerBound + m_upperBound) ->
  pf.lower_bound, pf.upper_bound
- RimCellRangeFilter (object + start_index_{i,j,k}, cell_count_{i,j,k})

New CAF object methods under ProjectDataModelCommands/:
- RimcDataFilterCollection: add_combined_filter(name, combine_mode)
- RimcCombinedFilter: add_property_filter(result_variable, result_type)
  and add_range_filter(name, start_{i,j,k}, cell_count_{i,j,k}).

Bounds are not part of add_property_filter because the Python class
generator emits a bare nan literal as the default for double fields
initialised to quiet_NaN, which fails to import. Bounds are set via
the now-scriptable lower_bound/upper_bound fields after creation,
matching the update() pattern used elsewhere in the API.

RicEclipsePropertyFilterFeatureImpl::addPropertyFilterToCombinedFilter
now returns the new RimEclipsePropertyFilter* so the CAF method can
hand it back to Python. setDefaults is relaxed to be view-tolerant:
case-level filters have no Rim3dView ancestor and the eclipse case is
already wired by RimEclipsePropertyFilter::setCase via the owning
collection's onItemsChanged hook.

End-to-end coverage in tests/test_combined_filter.py: round-trip
create, mode toggle, property-filter add/mutate, range-filter
add/mutate. Example script in PythonExamples builds an AND combined
filter that gates PERMX between 100 and 20000 against a K=5..10
slice.
2026-05-15 08:37:46 +02:00
Magne Sjaastad 3375e37ffc #13987 PDM: Make loadData() virtual on RimPolygonContainer
Replace the dynamic_cast dispatch in RimPolygonCollection::loadData() with a
virtual loadData() on RimPolygonContainer. The base recurses through
subCollections; RimPolygonFile overrides to load file data. The folder
RimPolygonCollection no longer needs its own loadData().

Move RimPolygonFile::canAddSubCollection() and RimPolygonInView::sourceItem()
implementations from headers to .cpp.

Simplify std::unexpected calls in RimcNestedCollectionBase by removing
redundant explicit QString construction.
2026-05-13 14:53:00 +02:00
Magne Sjaastad dc20a016f7 #13987 PDM: Migrate Surface and Polygon collections to PdmNestedCollection
Port RimSurfaceCollection, RimPolygonCollection and the polygon-in-view
side onto the new caf::PdmNestedCollection framework, replacing the
per-class folder plumbing (m_subCollections field, topmost-folder flag,
add/remove/find sub-collection, factory, "new folder" command) with the
shared base.

- RimSurfaceCollection and RimPolygonCollection now derive from
  caf::PdmNestedCollection. Each constructor uses the generic folder
  icon and exposes a static createTopmost() that marks the top instance
  and applies the branded domain icon; RimOilField calls the factory.
- RimPolygonInViewCollection uses the new RimNestedMirrorCollectionInView
  helper, and a new RimPolygonContainer carries the source-side polygon
  link.
- RicNewSurfaceCollectionFeature is removed; the generic
  RicNewNestedCollectionFeature drives the "Add Folder" action against
  both collections.
- Update callers (RimAnnotationCollection, RimEnsembleSurface, polygon
  command features) and the scripting wrapper (RimcSurfaceCollection),
  plus the Python add-folder binding and polygon test.
2026-05-13 14:53:00 +02:00
Magne Sjaastad 1e0ba3cdec #13987 PDM: Add RicNewNestedCollectionFeature and RimcNestedCollectionBase
Generalise the per-domain "Add Folder" command and the scripting-side
add-folder method so they work against any container that exposes
caf::PdmNestedCollectionBase.

- RicNewNestedCollectionFeature: command feature that walks the
  selected PdmObject up to the nearest PdmNestedCollectionBase ancestor
  and calls addNewSubCollection(). Hidden via canAddSubCollection() for
  leaf containers.
- RimcNestedCollectionBase: scripting wrapper exposing the same
  add-sub-collection action through the Python interface, so generated
  Python bindings get the operation for free on every derived class.

Neither is wired to a concrete collection yet; the per-domain features
remain in place until the migration commit replaces them.
2026-05-13 14:53:00 +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 2d88be506d #13908 Python: Add API to read well log information
Expose well logs attached to a well path through the Python API. A new
`well_path.well_logs()` returns the list of well logs, and each
`WellLog` gains `channel_names()` and `well_log_data()` for reading
channel names, measured depth, optional TVD MSL/RKB, and channel
values.

The read methods are registered on the abstract `RimWellLog` base
class and use the common `RigWellLogData` interface so they work for
imported, LAS and OSDU well logs alike.
2026-04-23 19:50:05 +02:00
Magne Sjaastad cf62f07224 #13806 Python: Add color legend scripting API
Expose RimColorLegendCollection and RimColorLegend to Python via
CAF_PDM_OBJECT_METHOD entries that let callers create a legend, append
category items with a hex-string color, bind a legend to a (case,
resultName) pair and delete that binding.

Scriptable fields on RimColorLegend and RimColorLegendItem make the
created objects inspectable from Python.

The (case, resultName) binding interface in RimColorLegendCollection,
RimRegularLegendConfig and RimEclipseCellColors now takes a const RimCase*
instead of a case id, matching the caller patterns and avoiding ambiguity
when multiple cases share an id domain.
2026-04-20 18:55:36 +02:00
Magne Sjaastad d37e50b55b #13876 WellPathGeometry: Return default values instead of assert and crash 2026-04-16 16:43:36 +02:00
Kristian Bendiksen b707c4588b #13841 Python: Add available_properties API for regular surfaces 2026-04-13 10:53:06 +02:00
Kristian Bendiksen 68b193cd56 #13841 Python: Add get_property API for regular surfaces 2026-04-09 07:59:34 +02:00
Kristian Bendiksen 49ea27ed62 #12957 Sector Model Export: require resolved max in RigGridExportAdapter
Move UNDEFINED max resolution to callers so it happens exactly once.
RigGridExportAdapter now asserts that max is resolved on construction.
2026-03-30 11:24:56 +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
Magne Sjaastad 83f667cdf8 Replace RimTools::wellPathCollection() with RimWellPathCollection::instance()
Remove the redundant wrapper function and update all call sites to use RimWellPathCollection::instance() directly.
Remove unused #include "RimTools.h" from files using RimWellPathCollection::instance() directly
2026-03-18 13:41:27 +01:00
JJ 24be78f105 Tie-in valve improvements (#13661)
Support (bool, something) pairs as tuples on python side.
Support custom outlet valve md
Add python test for custom outlet valve md
Use tie-in depth as default for custom valve md
Standalone valve creation and display updates
Update MSW valve export
Add valve open/shut flag.
Add python examples
2026-03-06 12:01:14 +01:00
Magne Sjaastad 71b734efec #13651 Fix formation dip sign issue when fracture normal is rotated 180 deg
Rename calculateFormationDip to calculateAngleFromVertical to better reflect what the function computes. Add calculateFormationDipFromHorizontal which applies the -90 deg adjustment and std::abs, fixing the wrong sign when the fracture direction normal is flipped.
2026-02-24 13:46:15 +01:00
Kristian Bendiksen 1ec53cc3f2 #13425 Fix ICD/AICD valve output in schedule generation
ICD valves now produce WSEGVALV and AICD valves now produce WSEGAICD
in the generated schedule. Three root causes were fixed:

- Create per-event valve templates with proper parameters instead of
  reusing default templates that lack orifice diameter and AICD fields
- Use perforation interval range for ICD/AICD valve positioning so
  valveLocations() returns non-empty results for the accumulator
- Add 5 AICD parameter fields to the Python API and event classes
2026-02-12 08:15:22 +01:00
Kristian Bendiksen a4dad97024 #13425 Add time-dependent well events and schedule data generation
Implement timeline-based event system for managing temporal changes in
well completions, perforations, valves, and production controls.

Features:
- Event timeline container with date-based querying
- Six event types: PERF, VALVE, TUBING, WSTATE, WTYPE, WCONTROL
- Schedule keyword generation (DATES, COMPDAT, WELSEGS, WCONPROD, WCONINJE)
- Multi-well schedule generation support
- Python GRPC API for event management
- YAML configuration file support
- Comprehensive test suite

Implementation:
- New directory: ApplicationLibCode/ProjectDataModel/WellEvents/
- Event classes inherit from RimWellEvent base class
- RimWellEventTimeline integrated into RimWellPath
- RicScheduleDataGenerator for multi-well schedule export
- Python API: event_timeline(), add_perf_event(), add_valve_event(), etc.
- Tests verify all event types and YAML config parsing

#13425 Add date tracking to valves and diameter/roughness intervals

Add creation date fields to RimWellPathValve and RimDiameterRoughnessInterval
to support filtering objects by date during completion data export.

- Add m_useCustomStartDate and m_startDate fields
- Add enableCustomStartDate(), setCustomStartDate(), isActiveOnDate() methods
- Set creation dates when applying valve and tubing events in RimWellEventTimeline

#13425 Add date-based filtering for schedule data export

Add optional export date parameter to MSW data collection functions to filter
valves and perforations based on their creation dates during schedule export.

- Add exportDate parameter to collectWsegvalvData, collectWsegAicdData,
  collectWsegSicdData, and collectCompsegData functions
- Filter valves by checking isActiveOnDate() on the associated RimWellPathValve
- Add RimPerforationInterval reference to RicMswPerforation for date filtering
- Pass export date from RicScheduleDataGenerator through the extraction chain

This ensures segment numbers reflect the full model while only including
objects active on the export date in output keywords.

Add test to prove compsegs changes over time.

#13425 Fix mypy type checking errors in well_events.py

- Add type annotations to all function parameters
- Fix generic type hints (dict -> Dict[str, Any])
- Import Any type for proper type safety
- Add type: ignore for method reassignment
- All 31 tests pass

#13425 Add schedule-level keyword events for non-well-specific keywords

Add a new event type called "Keyword Event" for schedule-level Eclipse
keywords (RPTRST, GRUPTREE, RPTSCHED, etc.) that are NOT tied to a
specific well path. This complements the existing RimWellEventKeyword
which operates at the well level.

- Add RimKeywordEvent class inheriting from RimWellEvent with null wellPath
- Add SCHEDULE_KEYWORD enum value to EventType
- Add addKeywordEvent() method to RimWellEventTimeline
- Add AddKeywordEvent Python API method to RimcWellEventTimeline
- Update RicScheduleDataGenerator to output global keywords after well sections
- Add Python wrapper add_keyword_event() with type inference
- Add tests and examples for RPTRST, GRUPTREE keywords
2026-02-12 08:15:22 +01:00
JJ 49147019a7 Python: Return names of imported properties (#13576)
* Python: Return names of imported properties
2026-02-06 19:34:34 +01:00
Kristian Bendiksen 0dfbcd34f6 #13562 Add python api for getting parent well path
Fixes #13562.
2026-02-06 13:32:22 +01:00
JJ 94c3059fd8 Add support for SICD valves (#13496)
* Add SICD parameters
* Add wsegsicd valves to completion export
* Add python method to read template info from valve
* Update tests
2026-01-29 11:16:05 +01:00
Magne Sjaastad 4b9f94efb8 Refactor depth property handling for regular surfaces
- Introduce RimRegularFileSurface::propertyName() as canonical property key for file-based surfaces.
- Change RimRegularSurface::setPropertyAsDepth() to void and remove existence check; error handling is now in updateSurfaceData().
- Update all usages to match new setPropertyAsDepth() behavior.
- Log and handle missing depth property in updateSurfaceData().
- Update tests to reflect new error handling approach.
- Minor includes and logging improvements.
2026-01-20 18:21:56 +01:00
JJ b87579961b Add support for using alias names for result names (#13453)
* Add alias editing to UI
* Enable result aliases for both eclipse and roff results
* Update python script to work on Windows
* Add Python interface for result aliases
* Add python test
2026-01-20 14:12:27 +01:00
Kristian Bendiksen a71fb9ad19 #13398 Python: Add API for custom well path segments
Add Python GRPC interface support for creating and managing custom segment
intervals for multi-segment wells. This provides API parity with the existing
GUI functionality.

Changes:
- Add createInterval() method to RimCustomSegmentIntervalCollection
- Add GRPC method addCustomSegmentInterval to RimcWellPathCompletionSettings
- Add validation to prevent creating intervals with start_md >= end_md
- Add Python test test_custom_segment_intervals.py with validation test
- Add usage example to modeled_well_path.py

Follows the pattern established by diameter roughness intervals.

Fixes #13398.
2026-01-13 10:44:55 +01:00
Magne Sjaastad c6ed12be92 Adds MSW name grouping pattern functionality
Implements a new command to set the MSW grouping pattern, and ensures that the pattern is only updated if a new value is set.
2026-01-12 09:32:42 +01:00
Kristian Bendiksen d62a6017bf Refactor RimElasticPropertyScalingCollection. 2026-01-05 13:15:47 +01:00
Kristian Bendiksen 79984604cc Refactor RimValveTemplateCollection. 2026-01-05 13:15:47 +01:00