#8225 MSW export : Adjust position of valve segments

This commit is contained in:
Magne Sjaastad 2021-11-02 10:48:15 +01:00
parent d6b699c38a
commit 4366146fbb
2 changed files with 40 additions and 18 deletions

View File

@ -869,17 +869,41 @@ void RicMswTableFormatterTools::writeValveWelsegsSegment( const RicMswSegment*
auto segments = valve->segments();
double startMD = 0.0;
double endMD = 0.0;
if ( valve->completionType() == RigCompletionData::CompletionType::PERFORATION_ICD ||
valve->completionType() == RigCompletionData::CompletionType::PERFORATION_AICD )
{
CVF_ASSERT( segments.size() > 1 );
// The 0.1 valve segment is the first, the perforated segment is the second
auto subSegment = segments[0];
subSegment->setSegmentNumber( *segmentNumber );
double midPointMD = subSegment->outputMD();
startMD = midPointMD;
endMD = startMD + 0.1;
double midPointTVD = tvdFromMeasuredDepth( valve->wellPath(), midPointMD );
subSegment->setOutputMD( midPointMD );
subSegment->setOutputTVD( midPointTVD );
}
else
{
auto subSegment = segments.front();
subSegment->setSegmentNumber( *segmentNumber );
double startMD = subSegment->startMD();
double endMD = subSegment->endMD();
startMD = subSegment->startMD();
endMD = subSegment->endMD();
double midPointMD = 0.5 * ( startMD + endMD );
double midPointTVD = tvdFromMeasuredDepth( valve->wellPath(), midPointMD );
subSegment->setOutputMD( midPointMD );
subSegment->setOutputTVD( midPointTVD );
}
std::vector<std::pair<double, double>> splitSegments = createSubSegmentMDPairs( startMD, endMD, maxSegmentLength );

View File

@ -1639,16 +1639,12 @@ void RicWellPathExportMswCompletionsImpl::moveIntersectionsToSuperICDsOrAICDs( g
CVF_ASSERT( superValve->segments().size() == 1u );
double aggregatedMinStartMD = std::numeric_limits<double>::max();
// Remove and take over ownership of the superValve completion
auto completionPtr = segment->removeCompletion( superValve );
for ( auto perforation : perforations )
{
for ( auto subSegment : perforation->segments() )
{
aggregatedMinStartMD = std::min( aggregatedMinStartMD, subSegment->startMD() );
// The valve completions on the main branch will be deleted. Create a segment with startMD and
// endMD representing the perforation along main well path to be connected to the valve. When COMPSEGS
// data is exported, the startMD and endMD of the segment is used to define the Start Length and End
@ -1675,18 +1671,20 @@ void RicWellPathExportMswCompletionsImpl::moveIntersectionsToSuperICDsOrAICDs( g
valveInflowSegment->addIntersection( intersectionPtr );
}
{
double midpoint = ( segment->startMD() + segment->endMD() ) * 0.5;
// Set the output MD to the midpoint of the segment, this info is used when exporting WELSEGS in
// RicMswTableFormatterTools::writeValveWelsegsSegment
completionPtr->segments()[0]->setOutputMD( midpoint );
}
completionPtr->addSegment( std::move( valveInflowSegment ) );
}
}
// Remove all completions and re-add the super valve
segment->deleteAllCompletions();
auto segmentWithLowerMD = branch->findClosestSegmentWithLowerMD( aggregatedMinStartMD );
if ( segmentWithLowerMD )
{
segmentWithLowerMD->addCompletion( std::move( completionPtr ) );
}
segment->addCompletion( std::move( completionPtr ) );
}
}