mirror of
https://github.com/OPM/ResInsight.git
synced 2026-09-03 20:53:13 -05:00
#14252 MSW: Report a grid cell only once in COMPSEGS
When several perforation intervals overlap the same grid cell, the main bore COMPSEGS table emitted one row per interval. Two perforations placed back to back therefore reported the same IJK twice, while COMPDAT correctly reported a single connection for that cell. The candidate intersections collected for one cell all describe the same IJK, so they are now merged into a single COMPSEGS row spanning the union of the overlapping measured depth ranges. Add TestModels/msw-export/project-files/perf_two_back_to_back.rsp covering the case.
This commit is contained in:
+13
-1
@@ -360,7 +360,19 @@ RigMswBranch buildMainBoreBranch( const RimWellPath*
|
||||
if ( !filterEval.includesGlobalCell( cellInfo.globCellIndex ) ) continue;
|
||||
if ( auto ci = toMswCellIntersection( cellInfo, mainGrid, overlapStart, overlapEnd ) )
|
||||
{
|
||||
cellCompsegs.push_back( *ci );
|
||||
// All candidates here describe the same grid cell, as they are derived from a single cellInfo.
|
||||
// Several perforation intervals may overlap that cell, but the cell must be connected only once,
|
||||
// matching the single COMPDAT connection. Widen the existing range instead of adding another row.
|
||||
if ( cellCompsegs.empty() )
|
||||
{
|
||||
cellCompsegs.push_back( *ci );
|
||||
}
|
||||
else
|
||||
{
|
||||
auto& existing = cellCompsegs.front();
|
||||
existing.distanceStart = std::min( existing.distanceStart, ci->distanceStart );
|
||||
existing.distanceEnd = std::max( existing.distanceEnd, ci->distanceEnd );
|
||||
}
|
||||
emittedCountPerInterval[perf]++;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user