Show branch ID range in addition to branch index

This commit is contained in:
Magne Sjaastad
2022-09-21 16:46:44 +02:00
parent f1139f5f14
commit 89d7dd4561
7 changed files with 62 additions and 53 deletions

View File

@@ -98,15 +98,6 @@ void RifReaderOpmRft::values( const RifEclipseRftAddress& rftAddress, std::vecto
}
return;
}
else if ( rftAddress.segmentResultName() == RiaDefines::segmentOneBasedBranchIndexResultName() )
{
auto branchIndices = segment.oneBasedBranchIndices();
for ( const auto& branchNumber : branchIndices )
{
values->push_back( branchNumber );
}
return;
}
}
if ( resultName.empty() )
@@ -295,6 +286,25 @@ void RifReaderOpmRft::cellIndices( const RifEclipseRftAddress& rftAddress, std::
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<int, int> RifReaderOpmRft::branchIdsAndOneBasedIndices( const QString& wellName, const QDateTime& timeStep )
{
int y = timeStep.date().year();
int m = timeStep.date().month();
int d = timeStep.date().day();
auto key = std::make_pair( wellName.toStdString(), RftDate{ y, m, d } );
if ( m_rftWellDateSegments.count( key ) > 0 )
{
auto segment = m_rftWellDateSegments[key];
return segment.branchIdsAndOneBasedBranchIndices();
}
return {};
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -538,7 +548,8 @@ void RifReaderOpmRft::buildSegmentBranchTypes( const RftSegmentKey& segmentKey )
// The device segment is connected to a segment on the tubing branch
//
// Annulus branch
// Layer between device branch and reservoir. The segment connection data is imported from WSEGLINK in the data deck
// Layer between device branch and reservoir. The segment connection data is imported from WSEGLINK in the data
// deck
auto wellName = segmentKey.first;
auto date = segmentKey.second;

View File

@@ -53,6 +53,8 @@ public:
void cellIndices( const RifEclipseRftAddress& rftAddress, std::vector<caf::VecIjk>* indices ) override;
std::map<int, int> branchIdsAndOneBasedIndices( const QString& wellName, const QDateTime& timeStep );
private:
// Segment data
// RftDate must be synced with definition in Opm::EclIO::ERft::RftDate

View File

@@ -149,21 +149,6 @@ std::vector<int> RifRftSegment::branchIds() const
return v;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<int> RifRftSegment::oneBasedBranchIndices() const
{
std::set<int> indices;
for ( auto b : m_oneBasedBranchIndexMap )
{
indices.insert( b.second );
}
return indices;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -174,6 +159,14 @@ int RifRftSegment::oneBasedBranchIndexForBranchId( int branchId ) const
return -1;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::map<int, int> RifRftSegment::branchIdsAndOneBasedBranchIndices() const
{
return m_oneBasedBranchIndexMap;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -55,10 +55,11 @@ public:
void addResultNameAndSize( const Opm::EclIO::EclFile::EclEntry& resultNameAndSize );
std::vector<Opm::EclIO::EclFile::EclEntry> resultNameAndSize() const;
std::vector<int> tubingBranchIds() const;
std::vector<int> branchIds() const;
std::set<int> oneBasedBranchIndices() const;
int oneBasedBranchIndexForBranchId( int branchId ) const;
std::vector<int> tubingBranchIds() const;
std::vector<int> branchIds() const;
int oneBasedBranchIndexForBranchId( int branchId ) const;
std::map<int, int> branchIdsAndOneBasedBranchIndices() const;
const RifRftSegmentData* segmentData( int segmentNumber ) const;
void createDeviceBranch( int deviceBranchFirstSegmentNumber, int oneBasedBranchIndex );