#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.
This commit is contained in:
Magne Sjaastad committed 2026-06-19 12:50:14 +02:00
1 parent f4a7d2cb4a
commit 3ae102ba6c
1 file changed
+5 -2
@@ -594,7 +594,10 @@ std::vector<RigMswBranch> 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<RigMswBranch> 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 );
}
}