#11069 RFT segment topology

The segment symbol is displayed once per segment. Previous code used segment start as symbol location. Add support for selecting the location for the segment indicator, either start, mid or end.

When reading segment property values, always use segment end as the curve is plotted using step left.
This commit is contained in:
Magne Sjaastad 2024-02-14 13:41:39 +01:00
parent a4c75bab1f
commit 44617ae105
5 changed files with 97 additions and 26 deletions

View File

@ -178,27 +178,48 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIndexOptions( RifReaderR
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimRftTools::seglenstValues( RifReaderRftInterface* readerRft,
std::vector<double> RimRftTools::segmentStartMdValues( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& dateTime,
int segmentBranchIndex,
RiaDefines::RftBranchType segmentBranchType )
{
std::vector<double> seglenstValues;
std::vector<double> values;
auto resultNameSeglenst = RifEclipseRftAddress::createBranchSegmentAddress( wellName,
dateTime,
RiaDefines::segmentStartDepthResultName(),
segmentBranchIndex,
segmentBranchType );
readerRft->values( resultNameSeglenst, &seglenstValues );
readerRft->values( resultNameSeglenst, &values );
if ( seglenstValues.size() > 2 )
if ( values.size() > 2 )
{
// Segment 1 has zero length, assign seglenst to the start value of segment 2
// Ref mail dated June 10, 2022, topic "SELENST fix"
seglenstValues[0] = seglenstValues[1];
values[0] = values[1];
}
return seglenstValues;
return values;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimRftTools::segmentEndMdValues( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& dateTime,
int segmentBranchIndex,
RiaDefines::RftBranchType segmentBranchType )
{
std::vector<double> values;
auto resultNameSeglenst = RifEclipseRftAddress::createBranchSegmentAddress( wellName,
dateTime,
RiaDefines::segmentEndDepthResultName(),
segmentBranchIndex,
segmentBranchType );
readerRft->values( resultNameSeglenst, &values );
return values;
}

View File

@ -46,7 +46,13 @@ public:
const QDateTime& timeStep,
RiaDefines::RftBranchType branchType );
static std::vector<double> seglenstValues( RifReaderRftInterface* readerRft,
static std::vector<double> segmentStartMdValues( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& dateTime,
int segmentBranchIndex,
RiaDefines::RftBranchType segmentBranchType );
static std::vector<double> segmentEndMdValues( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& dateTime,
int segmentBranchIndex,

View File

@ -48,6 +48,15 @@ void caf::AppEnum<RimRftTopologyCurve::CurveType>::setUp()
setDefault( RimRftTopologyCurve::CurveType::TUBING );
}
template <>
void caf::AppEnum<RimRftTopologyCurve::SymbolLocationType>::setUp()
{
addItem( RimRftTopologyCurve::SymbolLocationType::START, "START", "Start" );
addItem( RimRftTopologyCurve::SymbolLocationType::MID, "MID", "Midpoint" );
addItem( RimRftTopologyCurve::SymbolLocationType::END, "END", "End" );
setDefault( RimRftTopologyCurve::SymbolLocationType::END );
}
} // End namespace caf
@ -68,6 +77,7 @@ RimRftTopologyCurve::RimRftTopologyCurve()
CAF_PDM_InitFieldNoDefault( &m_segmentBranchType, "SegmentBranchType", "Completion" );
CAF_PDM_InitFieldNoDefault( &m_curveType, "CurveType", "Curve Type" );
CAF_PDM_InitFieldNoDefault( &m_symbolLocation, "SymbolLocation", "Symbol Location on Segment" );
}
//--------------------------------------------------------------------------------------------------
@ -221,6 +231,7 @@ void RimRftTopologyCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrde
curveDataGroup->add( &m_wellName );
curveDataGroup->add( &m_timeStep );
curveDataGroup->add( &m_curveType );
curveDataGroup->add( &m_symbolLocation );
curveDataGroup->add( &m_segmentBranchIndex );
curveDataGroup->add( &m_segmentBranchType );
@ -289,8 +300,32 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
std::vector<double> depths;
std::vector<double> propertyValues;
std::vector<double> seglenstValues =
RimRftTools::seglenstValues( rftReader, m_wellName, m_timeStep, -1, RiaDefines::RftBranchType::RFT_UNKNOWN );
std::vector<double> symbolLocationDepths;
if ( m_symbolLocation() == SymbolLocationType::START )
{
symbolLocationDepths =
RimRftTools::segmentStartMdValues( rftReader, m_wellName, m_timeStep, -1, RiaDefines::RftBranchType::RFT_UNKNOWN );
}
else if ( m_symbolLocation() == SymbolLocationType::MID )
{
symbolLocationDepths =
RimRftTools::segmentStartMdValues( rftReader, m_wellName, m_timeStep, -1, RiaDefines::RftBranchType::RFT_UNKNOWN );
auto endDepths =
RimRftTools::segmentEndMdValues( rftReader, m_wellName, m_timeStep, -1, RiaDefines::RftBranchType::RFT_UNKNOWN );
if ( symbolLocationDepths.size() == endDepths.size() )
{
for ( size_t i = 0; i < symbolLocationDepths.size(); ++i )
{
symbolLocationDepths[i] = ( symbolLocationDepths[i] + endDepths[i] ) / 2.0;
}
}
}
else if ( m_symbolLocation() == SymbolLocationType::END )
{
symbolLocationDepths =
RimRftTools::segmentEndMdValues( rftReader, m_wellName, m_timeStep, -1, RiaDefines::RftBranchType::RFT_UNKNOWN );
}
auto segment = rftReader->segmentForWell( m_wellName, m_timeStep );
auto segmentIndices = segment.segmentIndicesForBranchIndex( m_segmentBranchIndex(), m_segmentBranchType() );
@ -317,7 +352,7 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
for ( auto segmentIndex : packerSegmentIndices )
{
depths.push_back( seglenstValues[segmentIndex] );
depths.push_back( symbolLocationDepths[segmentIndex] );
propertyValues.push_back( curveValue );
}
@ -326,7 +361,7 @@ void RimRftTopologyCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
for ( auto segmentIndex : segmentIndices )
{
depths.push_back( seglenstValues[segmentIndex] );
depths.push_back( symbolLocationDepths[segmentIndex] );
propertyValues.push_back( curveValue );
}

View File

@ -44,6 +44,13 @@ public:
ANNULUS
};
enum class SymbolLocationType
{
START,
MID,
END
};
public:
RimRftTopologyCurve();
@ -83,6 +90,7 @@ private:
caf::PdmField<int> m_segmentBranchIndex;
caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_segmentBranchType;
caf::PdmField<caf::AppEnum<RimRftTopologyCurve::CurveType>> m_curveType;
caf::PdmField<caf::AppEnum<RimRftTopologyCurve::SymbolLocationType>> m_symbolLocation;
public:
void setAdditionalDataSources( const std::vector<RimPlotCurve*>& additionalDataSources );

View File

@ -1152,7 +1152,8 @@ std::vector<double> RimWellLogRftCurve::measuredDepthValues( QString& prefixText
{
prefixText = "SEGMENT/";
return RimRftTools::seglenstValues( reader, m_wellName(), m_timeStep, segmentBranchIndex(), m_segmentBranchType() );
// Always use segment end MD values for segment data, as the curve is plotted as step left
return RimRftTools::segmentEndMdValues( reader, m_wellName(), m_timeStep, segmentBranchIndex(), m_segmentBranchType() );
}
return {};
}