RFT Curves: Add more segment curves

- add CONGRAT
- add pressure track
- add CONFAC
- fix some plot layout issues
- Fix bug for first segment MD location
- Add default scale factor 1e-3 for gas curves
- Avoid inf values in some curves, seen in PRESSURE and CONFAC
- Use assignment in statements instead of std::get
This commit is contained in:
Magne Sjaastad
2022-10-27 11:17:41 +02:00
parent f6bde92d81
commit 4c3e1c3fe8
19 changed files with 455 additions and 188 deletions

View File

@@ -112,7 +112,8 @@ void RifReaderOpmRft::values( const RifEclipseRftAddress& rftAddress, std::vecto
try
{
auto data = m_opm_rft->getRft<float>( resultName, wellName, y, m, d );
std::vector<float> data = resultAsFloat( resultName, wellName, y, m, d );
if ( !data.empty() )
{
if ( rftAddress.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES )
@@ -391,22 +392,17 @@ void RifReaderOpmRft::buildMetaData()
importWellNames();
auto reports = m_opm_rft->listOfRftReports();
for ( const auto& report : reports )
for ( const auto& [wellName, reportDate, reportTime] : reports )
{
auto [wellName, reportDate, reportTime] = report;
auto rftVectors = m_opm_rft->listOfRftArrays( wellName, reportDate );
auto results = m_opm_rft->listOfRftArrays( wellName, reportDate );
for ( const auto& rftVec : rftVectors )
for ( const auto& [name, arrayType, size] : results )
{
auto [resultDataName, arrType, itemCount] = rftVec;
int y = std::get<0>( reportDate );
int m = std::get<1>( reportDate );
int d = std::get<2>( reportDate );
const auto& [y, m, d] = reportDate;
auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) );
auto channelType = identifyChannelType( resultDataName );
auto channelType = identifyChannelType( name );
if ( channelType != RifEclipseRftAddress::RftWellLogChannelType::NONE )
{
auto adr = RifEclipseRftAddress::createAddress( QString::fromStdString( wellName ), dt, channelType );
@@ -423,22 +419,17 @@ void RifReaderOpmRft::buildMetaData()
auto [wellName, reportDate] = segmentWellData.first;
auto segmentData = segmentWellData.second;
auto resultNameAndSizes = segmentData.resultNameAndSize();
int y = std::get<0>( reportDate );
int m = std::get<1>( reportDate );
int d = std::get<2>( reportDate );
auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) );
const auto& [y, m, d] = reportDate;
auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) );
m_rftSegmentTimeSteps.insert( dt );
for ( const auto& resultNameAndSize : resultNameAndSizes )
auto resultNameAndSizes = segmentData.resultNameAndSize();
for ( const auto& [name, arrayType, size] : resultNameAndSizes )
{
auto resultName = std::get<0>( resultNameAndSize );
auto adr = RifEclipseRftAddress::createSegmentAddress( QString::fromStdString( wellName ),
auto adr = RifEclipseRftAddress::createSegmentAddress( QString::fromStdString( wellName ),
dt,
QString::fromStdString( resultName ) );
QString::fromStdString( name ) );
m_addresses.insert( adr );
}
@@ -508,11 +499,10 @@ void RifReaderOpmRft::buildSegmentData()
RifRftSegment segment;
segment.setSegmentData( segmentsForWellDate );
auto arraysAtWellDate = m_opm_rft->listOfRftArrays( wellName, date );
auto results = m_opm_rft->listOfRftArrays( wellName, date );
for ( const auto& rftResultMetaData : arraysAtWellDate )
for ( const auto& [name, arrayType, size] : results )
{
auto [name, arrayType, size] = rftResultMetaData;
if ( ( name.find( "SEG" ) == 0 ) && m_segmentResultItemCount == 0 )
{
m_segmentResultItemCount = size;
@@ -523,9 +513,9 @@ void RifReaderOpmRft::buildSegmentData()
}
}
for ( const auto& rftResultMetaData : arraysAtWellDate )
for ( const auto& rftResultMetaData : results )
{
auto [name, arrayType, size] = rftResultMetaData;
const auto& [name, arrayType, size] = rftResultMetaData;
if ( size == static_cast<int64_t>( m_segmentResultItemCount ) ||
size == static_cast<int64_t>( m_connectionResultItemCount ) )
{
@@ -551,8 +541,9 @@ void RifReaderOpmRft::segmentDataDebugLog() const
auto [wellName, date] = a.first;
auto segmentData = a.second;
std::cout << "\nWell: " << wellName << "Date : " << std::get<0>( date ) << " " << std::get<1>( date ) << " "
<< std::get<2>( date ) << " \n";
const auto& [y, m, d] = date;
std::cout << "\nWell: " << wellName << "Date : " << y << " " << m << " " << d << " \n";
for ( const auto& r : segmentData.topology() )
{
@@ -606,11 +597,8 @@ void RifReaderOpmRft::buildSegmentBranchTypes( const RftSegmentKey& segmentKey )
auto date = segmentKey.second;
RifRftSegment& segmentRef = m_rftWellDateSegments[segmentKey];
int y = std::get<0>( date );
int m = std::get<1>( date );
int d = std::get<2>( date );
auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) );
const auto& [y, m, d] = date;
auto dt = RiaQDateTimeTools::createUtcDateTime( QDate( y, m, d ) );
std::vector<double> seglenstValues;
std::vector<double> seglenenValues;
@@ -943,3 +931,41 @@ std::string RifReaderOpmRft::resultNameFromChannelType( RifEclipseRftAddress::Rf
return {};
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<float>
RifReaderOpmRft::resultAsFloat( const std::string& resultName, const std::string& wellName, int year, int month, int day ) const
{
Opm::EclIO::eclArrType resultDataType = Opm::EclIO::eclArrType::REAL;
auto results = m_opm_rft->listOfRftArrays( wellName, year, month, day );
for ( const auto& [name, arrayType, size] : results )
{
if ( resultName == name )
{
resultDataType = arrayType;
break;
}
}
if ( resultDataType == Opm::EclIO::eclArrType::INTE )
{
std::vector<float> data;
auto integerData = m_opm_rft->getRft<int>( resultName, wellName, year, month, day );
for ( auto val : integerData )
{
data.push_back( val );
}
return data;
}
else
{
return m_opm_rft->getRft<float>( resultName, wellName, year, month, day );
}
return {};
}

View File

@@ -89,6 +89,9 @@ private:
static RifEclipseRftAddress::RftWellLogChannelType identifyChannelType( const std::string& resultName );
static std::string resultNameFromChannelType( RifEclipseRftAddress::RftWellLogChannelType channelType );
std::vector<float>
resultAsFloat( const std::string& resultName, const std::string& wellName, int year, int month, int day ) const;
private:
std::unique_ptr<Opm::EclIO::ERft> m_opm_rft;

View File

@@ -327,9 +327,10 @@ std::vector<size_t> RifRftSegment::packerSegmentIndicesOnAnnulus( int branchInde
auto segment = m_topology[segmentIndex];
auto outflowSegmentNumber = segment.segNext();
auto candidateSegment = segmentData( outflowSegmentNumber );
auto candidateBranchType = branchType( candidateSegment->segBrno() );
auto candidateSegment = segmentData( outflowSegmentNumber );
if ( !candidateSegment ) continue;
auto candidateBranchType = branchType( candidateSegment->segBrno() );
if ( candidateBranchType == RiaDefines::RftBranchType::RFT_DEVICE )
{
packerSegmentIndices.push_back( segmentIndex );