mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#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:
parent
a4c75bab1f
commit
44617ae105
@ -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;
|
||||
}
|
||||
|
@ -46,9 +46,15 @@ public:
|
||||
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 );
|
||||
};
|
||||
|
@ -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 );
|
||||
}
|
||||
|
@ -44,6 +44,13 @@ public:
|
||||
ANNULUS
|
||||
};
|
||||
|
||||
enum class SymbolLocationType
|
||||
{
|
||||
START,
|
||||
MID,
|
||||
END
|
||||
};
|
||||
|
||||
public:
|
||||
RimRftTopologyCurve();
|
||||
|
||||
@ -77,12 +84,13 @@ protected:
|
||||
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 );
|
||||
|
@ -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 {};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user