mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8225 MSW export : Adjust position of valve segments
This commit is contained in:
parent
d6b699c38a
commit
4366146fbb
@ -869,17 +869,41 @@ void RicMswTableFormatterTools::writeValveWelsegsSegment( const RicMswSegment*
|
||||
|
||||
auto segments = valve->segments();
|
||||
|
||||
auto subSegment = segments.front();
|
||||
subSegment->setSegmentNumber( *segmentNumber );
|
||||
double startMD = 0.0;
|
||||
double endMD = 0.0;
|
||||
|
||||
double startMD = subSegment->startMD();
|
||||
double endMD = subSegment->endMD();
|
||||
if ( valve->completionType() == RigCompletionData::CompletionType::PERFORATION_ICD ||
|
||||
valve->completionType() == RigCompletionData::CompletionType::PERFORATION_AICD )
|
||||
{
|
||||
CVF_ASSERT( segments.size() > 1 );
|
||||
|
||||
double midPointMD = 0.5 * ( startMD + endMD );
|
||||
double midPointTVD = tvdFromMeasuredDepth( valve->wellPath(), midPointMD );
|
||||
// The 0.1 valve segment is the first, the perforated segment is the second
|
||||
auto subSegment = segments[0];
|
||||
subSegment->setSegmentNumber( *segmentNumber );
|
||||
|
||||
subSegment->setOutputMD( midPointMD );
|
||||
subSegment->setOutputTVD( midPointTVD );
|
||||
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 );
|
||||
|
||||
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 );
|
||||
|
||||
|
@ -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 ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user