mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11562 RFT plots with nonproducing segments
Identify when we have a tubing segments that do not have a device segment connected. Mark the downstream device segment as non-continuous. When MD for device curve is created, add an extra MD for noncontinuous segments. Use inf as data value for this MD. This will ensure that no curve is displayed in this section of the device curve.
This commit is contained in:
@@ -383,3 +383,46 @@ int RifRftSegment::segmentIndexFromSegmentNumber( int segmentNumber ) const
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<size_t> RifRftSegment::nonContinuousDeviceSegmentIndices( int branchIndex ) const
|
||||
{
|
||||
auto deviceSegmentNumbers = segmentNumbersForBranchIndex( branchIndex, RiaDefines::RftBranchType::RFT_DEVICE );
|
||||
if ( deviceSegmentNumbers.size() < 2 ) return {};
|
||||
|
||||
// Find all device segments that are connected to a tubing segment with a upstream tubing segment that is not connected to a device
|
||||
// segment.
|
||||
//
|
||||
// Device numbers : 50 51 52 53
|
||||
// | | | |
|
||||
// Tubing numbers : 1 - 2 - 3 - 4 - 5 - 6
|
||||
//
|
||||
// Device 53 is connected to tubing 5. There are tubing segments between device 52 and 51. We mark device 52 as non-continuous
|
||||
// device segment.
|
||||
|
||||
std::vector<size_t> deviceSegmentIndices;
|
||||
size_t i = deviceSegmentNumbers.size() - 1;
|
||||
while ( i > 1 )
|
||||
{
|
||||
auto currentDeviceSegment = segmentData( deviceSegmentNumbers[i] );
|
||||
if ( !currentDeviceSegment ) continue;
|
||||
|
||||
auto upstreamDeviceSegment = segmentData( deviceSegmentNumbers[i - 1] );
|
||||
if ( !upstreamDeviceSegment ) continue;
|
||||
|
||||
auto tubingSegData = segmentData( currentDeviceSegment->segNext() );
|
||||
if ( !tubingSegData ) continue;
|
||||
|
||||
auto upstreamTubingSegmentNumber = tubingSegData->segNext();
|
||||
if ( upstreamDeviceSegment->segNext() != upstreamTubingSegmentNumber )
|
||||
{
|
||||
deviceSegmentIndices.push_back( segmentIndexFromSegmentNumber( deviceSegmentNumbers[i] ) );
|
||||
}
|
||||
|
||||
i--;
|
||||
}
|
||||
|
||||
return deviceSegmentIndices;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user