mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
RFT: Support device and annulus branches (#9168)
* Add unit test used to read data from WSEGLINK * Add segment branch type * Add detection of device branches * Add data source stepping on branch type * parse wseglink data * add RFT case as child of RimFileSummaryCase
This commit is contained in:
@@ -140,9 +140,9 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentResultNameOptions( RifReaderRf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIdOptions( RifReaderRftInterface* readerRft,
|
||||
const QString& wellName,
|
||||
const QDateTime& timeStep )
|
||||
QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIndexOptions( RifReaderRftInterface* readerRft,
|
||||
const QString& wellName,
|
||||
const QDateTime& timeStep )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
@@ -152,8 +152,9 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIdOptions( RifReaderRftI
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
auto adr =
|
||||
RifEclipseRftAddress::createSegmentAddress( wellName, timeStep, RiaDefines::segmentBranchNumberResultName(), -1 );
|
||||
auto adr = RifEclipseRftAddress::createSegmentAddress( wellName,
|
||||
timeStep,
|
||||
RiaDefines::segmentOneBasedBranchIndexResultName() );
|
||||
|
||||
readerRft->values( adr, &values );
|
||||
for ( const auto& v : values )
|
||||
|
||||
@@ -42,5 +42,5 @@ public:
|
||||
static QList<caf::PdmOptionItemInfo>
|
||||
segmentResultNameOptions( RifReaderRftInterface* readerRft, const QString& wellName, const QDateTime& timeStep );
|
||||
static QList<caf::PdmOptionItemInfo>
|
||||
segmentBranchIdOptions( RifReaderRftInterface* readerRft, const QString& wellName, const QDateTime& timeStep );
|
||||
segmentBranchIndexOptions( RifReaderRftInterface* readerRft, const QString& wellName, const QDateTime& timeStep );
|
||||
};
|
||||
|
||||
@@ -107,7 +107,8 @@ RimWellLogCurveCommonDataSource::RimWellLogCurveCommonDataSource()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_rftTimeStep, "RftTimeStep", "RFT Time Step" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_rftWellName, "RftWellName", "RFT Well Name" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_rftSegmentBranchId, "SegmentBranchId", "RFT Segment Branch" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_rftSegmentBranchIndex, "SegmentBranchIndex", "RFT Branch" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_rftSegmentBranchType, "SegmentBranchType", "RFT Branch Type" );
|
||||
|
||||
m_case = nullptr;
|
||||
m_wellPath = nullptr;
|
||||
@@ -310,7 +311,8 @@ void RimWellLogCurveCommonDataSource::resetDefaultOptions()
|
||||
|
||||
m_uniqueRftTimeSteps.clear();
|
||||
m_uniqueRftWellNames.clear();
|
||||
m_uniqueRftBranchIds.clear();
|
||||
m_uniqueRftBranchIndices.clear();
|
||||
m_uniqueRftBranchTypes.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -390,7 +392,8 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
|
||||
{
|
||||
m_uniqueRftWellNames.insert( adr.wellName() );
|
||||
m_uniqueRftTimeSteps.insert( adr.timeStep() );
|
||||
m_uniqueRftBranchIds.insert( adr.segmentBranchNumber() );
|
||||
m_uniqueRftBranchIndices.insert( adr.segmentBranchIndex() );
|
||||
m_uniqueRftBranchTypes.insert( adr.segmentBranchType() );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -479,10 +482,17 @@ void RimWellLogCurveCommonDataSource::analyseCurvesAndTracks( const std::vector<
|
||||
m_rftTimeStep = *( m_uniqueRftTimeSteps.begin() );
|
||||
}
|
||||
|
||||
if ( m_uniqueRftBranchIds.size() == 1u )
|
||||
if ( m_uniqueRftBranchIndices.size() == 1u )
|
||||
{
|
||||
m_rftSegmentBranchId = *( m_uniqueRftBranchIds.begin() );
|
||||
m_rftSegmentBranchIndex = *( m_uniqueRftBranchIndices.begin() );
|
||||
}
|
||||
|
||||
if ( m_uniqueRftBranchTypes.size() == 1u )
|
||||
{
|
||||
m_rftSegmentBranchType = *( m_uniqueRftBranchTypes.begin() );
|
||||
}
|
||||
else
|
||||
m_rftSegmentBranchType = RiaDefines::RftBranchType::RFT_UNKNOWN;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -616,9 +626,13 @@ void RimWellLogCurveCommonDataSource::applyDataSourceChanges( const std::vector<
|
||||
}
|
||||
else if ( rftCurve )
|
||||
{
|
||||
if ( m_summaryCase() ) rftCurve->setSummaryCase( m_summaryCase() );
|
||||
rftCurve->setTimeStep( m_rftTimeStep() );
|
||||
rftCurve->setWellName( m_rftWellName() );
|
||||
rftCurve->setSegmentBranchId( m_rftSegmentBranchId() );
|
||||
rftCurve->setSegmentBranchIndex( m_rftSegmentBranchIndex() );
|
||||
|
||||
if ( m_rftSegmentBranchType() != RiaDefines::RftBranchType::RFT_UNKNOWN )
|
||||
rftCurve->setSegmentBranchType( m_rftSegmentBranchType() );
|
||||
|
||||
RimWellLogPlot* parentPlot = nullptr;
|
||||
rftCurve->firstAncestorOrThisOfTypeAsserted( parentPlot );
|
||||
@@ -794,7 +808,8 @@ std::vector<caf::PdmFieldHandle*> RimWellLogCurveCommonDataSource::fieldsToShowI
|
||||
if ( m_uniqueRftWellNames.size() == 1u ) fieldsToDisplay.push_back( &m_rftWellName );
|
||||
if ( m_uniqueTimeSteps.size() == 1u ) fieldsToDisplay.push_back( &m_timeStep );
|
||||
if ( m_uniqueRftTimeSteps.size() == 1u ) fieldsToDisplay.push_back( &m_rftTimeStep );
|
||||
if ( m_uniqueRftBranchIds.size() == 1u ) fieldsToDisplay.push_back( &m_rftSegmentBranchId );
|
||||
if ( m_uniqueRftBranchIndices.size() == 1u ) fieldsToDisplay.push_back( &m_rftSegmentBranchIndex );
|
||||
if ( m_uniqueRftBranchTypes.size() == 1u ) fieldsToDisplay.push_back( &m_rftSegmentBranchType );
|
||||
|
||||
return fieldsToDisplay;
|
||||
}
|
||||
@@ -985,9 +1000,9 @@ QList<caf::PdmOptionItemInfo>
|
||||
{
|
||||
options = RimRftTools::wellNameOptions( rftReader() );
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_rftSegmentBranchId )
|
||||
else if ( fieldNeedingOptions == &m_rftSegmentBranchIndex )
|
||||
{
|
||||
options = RimRftTools::segmentBranchIdOptions( rftReader(), m_rftWellName(), m_rftTimeStep() );
|
||||
options = RimRftTools::segmentBranchIndexOptions( rftReader(), m_rftWellName(), m_rftTimeStep() );
|
||||
}
|
||||
|
||||
return options;
|
||||
@@ -1047,7 +1062,8 @@ void RimWellLogCurveCommonDataSource::defineUiOrdering( QString uiConfigName, ca
|
||||
|
||||
if ( !m_uniqueRftTimeSteps.empty() ) group->add( &m_rftTimeStep );
|
||||
if ( !m_uniqueRftWellNames.empty() ) group->add( &m_rftWellName );
|
||||
if ( !m_uniqueRftBranchIds.empty() ) group->add( &m_rftSegmentBranchId );
|
||||
if ( !m_uniqueRftBranchIndices.empty() ) group->add( &m_rftSegmentBranchIndex );
|
||||
if ( !m_uniqueRftBranchTypes.empty() ) group->add( &m_rftSegmentBranchType );
|
||||
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
@@ -1062,8 +1078,9 @@ void RimWellLogCurveCommonDataSource::defineEditorAttribute( const caf::PdmField
|
||||
auto* myAttr = dynamic_cast<caf::PdmUiComboBoxEditorAttribute*>( attribute );
|
||||
if ( myAttr )
|
||||
{
|
||||
if ( field == &m_case || field == &m_simWellName || field == &m_wellPath || field == &m_timeStep ||
|
||||
field == &m_rftTimeStep || field == &m_rftSegmentBranchId || field == &m_rftWellName )
|
||||
if ( field == &m_case || field == &m_summaryCase || field == &m_simWellName || field == &m_wellPath ||
|
||||
field == &m_timeStep || field == &m_rftTimeStep || field == &m_rftSegmentBranchIndex ||
|
||||
field == &m_rftWellName )
|
||||
{
|
||||
myAttr->showPreviousAndNextButtons = true;
|
||||
myAttr->nextIcon = QIcon( ":/ComboBoxDown.svg" );
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaRftDefines.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@@ -125,9 +126,10 @@ private:
|
||||
caf::PdmField<caf::Tristate> m_wbsSmoothing;
|
||||
caf::PdmField<double> m_wbsSmoothingThreshold;
|
||||
|
||||
caf::PdmField<QDateTime> m_rftTimeStep;
|
||||
caf::PdmField<QString> m_rftWellName;
|
||||
caf::PdmField<int> m_rftSegmentBranchId;
|
||||
caf::PdmField<QDateTime> m_rftTimeStep;
|
||||
caf::PdmField<QString> m_rftWellName;
|
||||
caf::PdmField<int> m_rftSegmentBranchIndex;
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_rftSegmentBranchType;
|
||||
|
||||
std::set<RimCase*> m_uniqueCases;
|
||||
std::set<RimSummaryCase*> m_uniqueSummaryCases;
|
||||
@@ -140,7 +142,8 @@ private:
|
||||
std::set<bool> m_uniqueWbsSmoothing;
|
||||
std::set<double, DoubleComparator> m_uniqueWbsSmoothingThreshold;
|
||||
|
||||
std::set<QDateTime> m_uniqueRftTimeSteps;
|
||||
std::set<QString> m_uniqueRftWellNames;
|
||||
std::set<int> m_uniqueRftBranchIds;
|
||||
std::set<QDateTime> m_uniqueRftTimeSteps;
|
||||
std::set<QString> m_uniqueRftWellNames;
|
||||
std::set<int> m_uniqueRftBranchIndices;
|
||||
std::set<RiaDefines::RftBranchType> m_uniqueRftBranchTypes;
|
||||
};
|
||||
|
||||
@@ -174,7 +174,8 @@ RimWellLogRftCurve::RimWellLogRftCurve()
|
||||
CAF_PDM_InitFieldNoDefault( &m_rftDataType, "RftDataType", "Data Type" );
|
||||
|
||||
CAF_PDM_InitField( &m_segmentResultName, "SegmentResultName", RiaResultNames::undefinedResultName(), "Segment Result Name" );
|
||||
CAF_PDM_InitField( &m_segmentBranchId, "SegmentBranchId", -1, "Segment Branch" );
|
||||
CAF_PDM_InitField( &m_segmentBranchIndex, "SegmentBranchIndex", -1, "Segment Branch" );
|
||||
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Branch Type" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -235,9 +236,17 @@ QDateTime RimWellLogRftCurve::timeStep() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogRftCurve::setSegmentBranchId( int branchId )
|
||||
void RimWellLogRftCurve::setSegmentBranchIndex( int branchIndex )
|
||||
{
|
||||
m_segmentBranchId = branchId;
|
||||
m_segmentBranchIndex = branchIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogRftCurve::setSegmentBranchType( RiaDefines::RftBranchType branchType )
|
||||
{
|
||||
m_segmentBranchType = branchType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -315,9 +324,9 @@ void RimWellLogRftCurve::setRftAddress( RifEclipseRftAddress address )
|
||||
|
||||
if ( address.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES )
|
||||
{
|
||||
m_rftDataType = RftDataType::RFT_SEGMENT_DATA;
|
||||
m_segmentResultName = address.segmentResultName();
|
||||
m_segmentBranchId = address.segmentBranchNumber();
|
||||
m_rftDataType = RftDataType::RFT_SEGMENT_DATA;
|
||||
m_segmentResultName = address.segmentResultName();
|
||||
m_segmentBranchIndex = address.segmentBranchIndex();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -332,7 +341,11 @@ RifEclipseRftAddress RimWellLogRftCurve::rftAddress() const
|
||||
{
|
||||
if ( m_rftDataType == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
return RifEclipseRftAddress::createSegmentAddress( m_wellName, m_timeStep, m_segmentResultName(), m_segmentBranchId() );
|
||||
return RifEclipseRftAddress::createBranchSegmentAddress( m_wellName,
|
||||
m_timeStep,
|
||||
m_segmentResultName(),
|
||||
m_segmentBranchIndex(),
|
||||
m_segmentBranchType() );
|
||||
}
|
||||
|
||||
return RifEclipseRftAddress::createAddress( m_wellName, m_timeStep, m_wellLogChannelName() );
|
||||
@@ -470,8 +483,10 @@ QString RimWellLogRftCurve::createCurveAutoName()
|
||||
{
|
||||
name.push_back( m_segmentResultName );
|
||||
|
||||
QString branchText = QString( "Branch %1" ).arg( m_segmentBranchId() );
|
||||
QString branchText = QString( "Branch %1" ).arg( m_segmentBranchIndex() );
|
||||
name.push_back( branchText );
|
||||
|
||||
name.push_back( m_segmentBranchType().uiText() );
|
||||
}
|
||||
|
||||
if ( !m_timeStep().isNull() )
|
||||
@@ -694,7 +709,8 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
else
|
||||
{
|
||||
curveDataGroup->add( &m_segmentResultName );
|
||||
curveDataGroup->add( &m_segmentBranchId );
|
||||
curveDataGroup->add( &m_segmentBranchIndex );
|
||||
curveDataGroup->add( &m_segmentBranchType );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
|
||||
@@ -759,9 +775,9 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions( const c
|
||||
{
|
||||
options = RimRftTools::segmentResultNameOptions( reader, m_wellName(), m_timeStep() );
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_segmentBranchId )
|
||||
else if ( fieldNeedingOptions == &m_segmentBranchIndex )
|
||||
{
|
||||
options = RimRftTools::segmentBranchIdOptions( reader, m_wellName(), m_timeStep() );
|
||||
options = RimRftTools::segmentBranchIndexOptions( reader, m_wellName(), m_timeStep() );
|
||||
}
|
||||
|
||||
return options;
|
||||
@@ -811,8 +827,8 @@ void RimWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
|
||||
}
|
||||
loadData = true;
|
||||
}
|
||||
else if ( changedField == &m_timeStep || changedField == &m_segmentResultName ||
|
||||
changedField == &m_segmentBranchId || changedField == &m_rftDataType )
|
||||
else if ( changedField == &m_timeStep || changedField == &m_segmentResultName || changedField == &m_segmentBranchIndex ||
|
||||
changedField == &m_rftDataType || changedField == &m_segmentBranchType )
|
||||
{
|
||||
loadData = true;
|
||||
}
|
||||
@@ -999,8 +1015,11 @@ std::vector<double> RimWellLogRftCurve::xValues()
|
||||
|
||||
if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
auto depthAddress =
|
||||
RifEclipseRftAddress::createSegmentAddress( m_wellName(), m_timeStep, m_segmentResultName(), segmentBranchId() );
|
||||
auto depthAddress = RifEclipseRftAddress::createBranchSegmentAddress( m_wellName(),
|
||||
m_timeStep,
|
||||
m_segmentResultName(),
|
||||
segmentBranchIndex(),
|
||||
m_segmentBranchType() );
|
||||
|
||||
reader->values( depthAddress, &values );
|
||||
|
||||
@@ -1063,10 +1082,11 @@ std::vector<double> RimWellLogRftCurve::tvDepthValues()
|
||||
|
||||
if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
auto depthAddress = RifEclipseRftAddress::createSegmentAddress( m_wellName(),
|
||||
m_timeStep,
|
||||
RiaDefines::segmentTvdDepthResultName(),
|
||||
segmentBranchId() );
|
||||
auto depthAddress = RifEclipseRftAddress::createBranchSegmentAddress( m_wellName(),
|
||||
m_timeStep,
|
||||
RiaDefines::segmentTvdDepthResultName(),
|
||||
segmentBranchIndex(),
|
||||
m_segmentBranchType() );
|
||||
|
||||
reader->values( depthAddress, &values );
|
||||
return values;
|
||||
@@ -1108,10 +1128,12 @@ std::vector<double> RimWellLogRftCurve::measuredDepthValues()
|
||||
RifReaderRftInterface* reader = rftReader();
|
||||
if ( reader )
|
||||
{
|
||||
auto depthAddress = RifEclipseRftAddress::createSegmentAddress( m_wellName(),
|
||||
m_timeStep,
|
||||
RiaDefines::segmentStartDepthResultName(),
|
||||
segmentBranchId() );
|
||||
auto depthAddress =
|
||||
RifEclipseRftAddress::createBranchSegmentAddress( m_wellName(),
|
||||
m_timeStep,
|
||||
RiaDefines::segmentStartDepthResultName(),
|
||||
segmentBranchIndex(),
|
||||
m_segmentBranchType() );
|
||||
|
||||
reader->values( depthAddress, &values );
|
||||
|
||||
@@ -1236,7 +1258,7 @@ bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector<
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimWellLogRftCurve::segmentBranchId() const
|
||||
int RimWellLogRftCurve::segmentBranchIndex() const
|
||||
{
|
||||
return m_segmentBranchId();
|
||||
return m_segmentBranchIndex();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,8 @@ public:
|
||||
void setTimeStep( const QDateTime& dateTime );
|
||||
QDateTime timeStep() const;
|
||||
|
||||
void setSegmentBranchId( int branchId );
|
||||
void setSegmentBranchIndex( int branchIndex );
|
||||
void setSegmentBranchType( RiaDefines::RftBranchType branchType );
|
||||
|
||||
void setEclipseResultCase( RimEclipseResultCase* eclipseResultCase );
|
||||
RimEclipseResultCase* eclipseResultCase() const;
|
||||
@@ -130,7 +131,7 @@ private:
|
||||
bool deriveMeasuredDepthFromObservedData( const std::vector<double>& tvDepthValues,
|
||||
std::vector<double>& derivedMDValues );
|
||||
|
||||
int segmentBranchId() const;
|
||||
int segmentBranchIndex() const;
|
||||
|
||||
private:
|
||||
caf::PdmPtrField<RimEclipseResultCase*> m_eclipseResultCase;
|
||||
@@ -144,8 +145,9 @@ private:
|
||||
|
||||
caf::PdmField<caf::AppEnum<RimWellLogRftCurve::RftDataType>> m_rftDataType;
|
||||
|
||||
caf::PdmField<QString> m_segmentResultName;
|
||||
caf::PdmField<int> m_segmentBranchId;
|
||||
caf::PdmField<QString> m_segmentResultName;
|
||||
caf::PdmField<int> m_segmentBranchIndex;
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_segmentBranchType;
|
||||
|
||||
std::map<size_t, size_t> m_idxInWellPathToIdxInRftFile;
|
||||
caf::PdmField<caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>> m_wellLogChannelName;
|
||||
|
||||
Reference in New Issue
Block a user