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 segments = valve->segments();
|
||||||
|
|
||||||
auto subSegment = segments.front();
|
double startMD = 0.0;
|
||||||
subSegment->setSegmentNumber( *segmentNumber );
|
double endMD = 0.0;
|
||||||
|
|
||||||
double startMD = subSegment->startMD();
|
if ( valve->completionType() == RigCompletionData::CompletionType::PERFORATION_ICD ||
|
||||||
double endMD = subSegment->endMD();
|
valve->completionType() == RigCompletionData::CompletionType::PERFORATION_AICD )
|
||||||
|
{
|
||||||
|
CVF_ASSERT( segments.size() > 1 );
|
||||||
|
|
||||||
double midPointMD = 0.5 * ( startMD + endMD );
|
// The 0.1 valve segment is the first, the perforated segment is the second
|
||||||
double midPointTVD = tvdFromMeasuredDepth( valve->wellPath(), midPointMD );
|
auto subSegment = segments[0];
|
||||||
|
subSegment->setSegmentNumber( *segmentNumber );
|
||||||
|
|
||||||
subSegment->setOutputMD( midPointMD );
|
double midPointMD = subSegment->outputMD();
|
||||||
subSegment->setOutputTVD( midPointTVD );
|
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 );
|
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 );
|
CVF_ASSERT( superValve->segments().size() == 1u );
|
||||||
|
|
||||||
double aggregatedMinStartMD = std::numeric_limits<double>::max();
|
|
||||||
|
|
||||||
// Remove and take over ownership of the superValve completion
|
// Remove and take over ownership of the superValve completion
|
||||||
auto completionPtr = segment->removeCompletion( superValve );
|
auto completionPtr = segment->removeCompletion( superValve );
|
||||||
for ( auto perforation : perforations )
|
for ( auto perforation : perforations )
|
||||||
{
|
{
|
||||||
for ( auto subSegment : perforation->segments() )
|
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
|
// 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
|
// 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
|
// 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 );
|
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 ) );
|
completionPtr->addSegment( std::move( valveInflowSegment ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove all completions and re-add the super valve
|
// Remove all completions and re-add the super valve
|
||||||
segment->deleteAllCompletions();
|
segment->deleteAllCompletions();
|
||||||
|
segment->addCompletion( std::move( completionPtr ) );
|
||||||
auto segmentWithLowerMD = branch->findClosestSegmentWithLowerMD( aggregatedMinStartMD );
|
|
||||||
if ( segmentWithLowerMD )
|
|
||||||
{
|
|
||||||
segmentWithLowerMD->addCompletion( std::move( completionPtr ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user