Skip to content

Commit

Permalink
#11069 RFT segment topology
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
magnesj committed Feb 14, 2024
1 parent 8fe385a commit f3cf772
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 26 deletions.
41 changes: 31 additions & 10 deletions ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,48 @@ QList<caf::PdmOptionItemInfo> RimRftTools::segmentBranchIndexOptions( RifReaderR
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<double> RimRftTools::seglenstValues( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& dateTime,
int segmentBranchIndex,
RiaDefines::RftBranchType segmentBranchType )
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;
}
16 changes: 11 additions & 5 deletions ApplicationLibCode/ProjectDataModel/WellLog/RimRftTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ class RimRftTools
const QDateTime& timeStep,
RiaDefines::RftBranchType branchType );

static std::vector<double> seglenstValues( RifReaderRftInterface* readerRft,
const QString& wellName,
const QDateTime& dateTime,
int segmentBranchIndex,
RiaDefines::RftBranchType segmentBranchType );
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,
RiaDefines::RftBranchType segmentBranchType );
};
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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" );
}

//--------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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() );
Expand All @@ -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 );
}
Expand All @@ -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 );
}
Expand Down
20 changes: 14 additions & 6 deletions ApplicationLibCode/ProjectDataModel/WellLog/RimRftTopologyCurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ class RimRftTopologyCurve : public RimWellLogCurve
ANNULUS
};

enum class SymbolLocationType
{
START,
MID,
END
};

public:
RimRftTopologyCurve();

Expand Down Expand Up @@ -77,12 +84,13 @@ class RimRftTopologyCurve : public RimWellLogCurve
void onLoadDataAndUpdate( bool updateParentPlot ) override;

private:
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
caf::PdmField<QDateTime> m_timeStep;
caf::PdmField<QString> m_wellName;
caf::PdmField<int> m_segmentBranchIndex;
caf::PdmField<caf::AppEnum<RiaDefines::RftBranchType>> m_segmentBranchType;
caf::PdmField<caf::AppEnum<RimRftTopologyCurve::CurveType>> m_curveType;
caf::PdmPtrField<RimSummaryCase*> m_summaryCase;
caf::PdmField<QDateTime> m_timeStep;
caf::PdmField<QString> m_wellName;
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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
}
Expand Down

0 comments on commit f3cf772

Please sign in to comment.