From 3ae102ba6ca2cdd527c7e711506f785083f62524 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 18 Jun 2026 15:56:23 +0200 Subject: [PATCH] #14241 MSW: Use valve segment MD for ICV COMPSEGS distances ICV valve COMPSEGS rows used the cell overlap MD range within the valve coverage instead of the valve segment measured depth. The legacy tree export redirected the perforation intersections onto the ICV segment, so their COMPSEGS Start/End Length reflected the valve segment MD range. Restore that behavior by emitting the ICV COMPSEGS with the valve segment MD range while still selecting the overlapping cells. Fixes test_well_events test_wells_only_appear_at_their_event_dates. --- .../MswExport/RicMswBranchBuilder.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp index 1c5f971c01..4bdfdfcfe6 100644 --- a/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp +++ b/ApplicationLibCode/Commands/CompletionExportCommands/MswExport/RicMswBranchBuilder.cpp @@ -594,7 +594,10 @@ std::vector buildValveBranches( const RimWellPath* valveSeg.sourceWellName = wellPath->name().toStdString(); valveSeg.description = QString( "%1 #%2" ).arg( valve->name() ).arg( vi + 1 ).toStdString(); - // COMPSEGS: cells that overlap this valve's coverage range (valveSegStart..valveSegEnd) + // COMPSEGS: cells that overlap this valve's coverage range (valveSegStart..valveSegEnd). + // The perforation intersections are redirected onto the ICV segment, so their COMPSEGS + // Start/End Length reflect the valve segment MD range (valveMD..valveEndMD) rather than + // the individual cell overlaps, matching the legacy tree-based export. for ( const auto& cellInfo : filteredIntersections ) { const double overlapStart = std::max( valveSegStart, cellInfo.startMD ); @@ -602,7 +605,7 @@ std::vector buildValveBranches( const RimWellPath* if ( overlapEnd > overlapStart ) { if ( !filterEval.includesGlobalCell( cellInfo.globCellIndex ) ) continue; - if ( auto ci = toMswCellIntersection( cellInfo, mainGrid, overlapStart, overlapEnd ) ) + if ( auto ci = toMswCellIntersection( cellInfo, mainGrid, valveMD, valveEndMD ) ) valveSeg.intersections.push_back( *ci ); } }