mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Import RFT segment data as well log curve (#8449)
Add reader for RFT data using opm-common Extend RFT curve with support for RFT segment data Adjustments related to horizontal well log plots 8581 Well Log Plot : Update of curve appearance does not update plot
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include "RiaEclipseUnitTools.h"
|
||||
#include "RiaQDateTimeTools.h"
|
||||
#include "RiaResultNames.h"
|
||||
#include "RiaRftDefines.h"
|
||||
#include "RiaSimWellBranchTools.h"
|
||||
|
||||
#include "RifEclipseRftAddress.h"
|
||||
@@ -69,27 +70,73 @@ namespace caf
|
||||
template <>
|
||||
void caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::setUp()
|
||||
{
|
||||
addItem( RifEclipseRftAddress::NONE, "NONE", "None" );
|
||||
addItem( RifEclipseRftAddress::TVD, "DEPTH", "Depth" );
|
||||
addItem( RifEclipseRftAddress::PRESSURE, "PRESSURE", "Pressure" );
|
||||
addItem( RifEclipseRftAddress::SWAT, RiaResultNames::swat(), "Water Saturation" );
|
||||
addItem( RifEclipseRftAddress::SOIL, RiaResultNames::soil(), "Oil Saturation" );
|
||||
addItem( RifEclipseRftAddress::SGAS, RiaResultNames::sgas(), "Gas Saturation" );
|
||||
addItem( RifEclipseRftAddress::WRAT, "WRAT", "Water Flow" );
|
||||
addItem( RifEclipseRftAddress::ORAT, "ORAT", "Oil Flow" );
|
||||
addItem( RifEclipseRftAddress::GRAT, "GRAT", "Gas flow" );
|
||||
addItem( RifEclipseRftAddress::MD, "MD", "Measured Depth" );
|
||||
addItem( RifEclipseRftAddress::PRESSURE_P10, "PRESSURE_P10", "P10: Pressure" );
|
||||
addItem( RifEclipseRftAddress::PRESSURE_P50, "PRESSURE_P50", "P50: Pressure" );
|
||||
addItem( RifEclipseRftAddress::PRESSURE_P90, "PRESSURE_P90", "P90: Pressure" );
|
||||
addItem( RifEclipseRftAddress::PRESSURE_MEAN, "PRESSURE_MEAN", "Mean: Pressure" );
|
||||
addItem( RifEclipseRftAddress::PRESSURE_ERROR, "PRESSURE_ERROR", "Error: Pressure" );
|
||||
setDefault( RifEclipseRftAddress::NONE );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::NONE, "NONE", "None" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::TVD, "DEPTH", "Depth" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::PRESSURE, "PRESSURE", "Pressure" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::SWAT, RiaResultNames::swat(), "Water Saturation" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::SOIL, RiaResultNames::soil(), "Oil Saturation" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::SGAS, RiaResultNames::sgas(), "Gas Saturation" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::WRAT, "WRAT", "Water Flow" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::ORAT, "ORAT", "Oil Flow" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::GRAT, "GRAT", "Gas flow" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::MD, "MD", "Measured Depth" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P10, "PRESSURE_P10", "P10: Pressure" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P50, "PRESSURE_P50", "P50: Pressure" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_P90, "PRESSURE_P90", "P90: Pressure" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_MEAN, "PRESSURE_MEAN", "Mean: Pressure" );
|
||||
addItem( RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR, "PRESSURE_ERROR", "Error: Pressure" );
|
||||
setDefault( RifEclipseRftAddress::RftWellLogChannelType::NONE );
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
namespace caf
|
||||
{
|
||||
template <>
|
||||
void caf::AppEnum<RimWellLogRftCurve::RftDataType>::setUp()
|
||||
{
|
||||
addItem( RimWellLogRftCurve::RftDataType::RFT_DATA, "RFT_DATA", "RFT" );
|
||||
addItem( RimWellLogRftCurve::RftDataType::RFT_SEGMENT_DATA, "RFT_SEGMENT_DATA", "RFT Segment" );
|
||||
setDefault( RimWellLogRftCurve::RftDataType::RFT_DATA );
|
||||
}
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimWellLogRftCurve, "WellLogRftCurve" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::PhaseType RimWellLogRftCurve::phaseType() const
|
||||
{
|
||||
if ( m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_DATA )
|
||||
{
|
||||
if ( m_wellLogChannelName() == RifEclipseRftAddress::RftWellLogChannelType::SWAT ||
|
||||
m_wellLogChannelName() == RifEclipseRftAddress::RftWellLogChannelType::WRAT )
|
||||
{
|
||||
return RiaDefines::PhaseType::WATER_PHASE;
|
||||
}
|
||||
|
||||
if ( m_wellLogChannelName() == RifEclipseRftAddress::RftWellLogChannelType::SGAS ||
|
||||
m_wellLogChannelName() == RifEclipseRftAddress::RftWellLogChannelType::GRAT )
|
||||
{
|
||||
return RiaDefines::PhaseType::GAS_PHASE;
|
||||
}
|
||||
|
||||
if ( m_wellLogChannelName() == RifEclipseRftAddress::RftWellLogChannelType::SOIL ||
|
||||
m_wellLogChannelName() == RifEclipseRftAddress::RftWellLogChannelType::ORAT )
|
||||
{
|
||||
return RiaDefines::PhaseType::OIL_PHASE;
|
||||
}
|
||||
}
|
||||
else if ( m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
if ( m_segmentResultName().startsWith( "SEGO" ) ) return RiaDefines::PhaseType::OIL_PHASE;
|
||||
if ( m_segmentResultName().startsWith( "SEGW" ) ) return RiaDefines::PhaseType::WATER_PHASE;
|
||||
if ( m_segmentResultName().startsWith( "SEGG" ) ) return RiaDefines::PhaseType::GAS_PHASE;
|
||||
}
|
||||
|
||||
return RiaDefines::PhaseType::PHASE_NOT_APPLICABLE;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -122,6 +169,10 @@ RimWellLogRftCurve::RimWellLogRftCurve()
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_wellLogChannelName, "WellLogChannelName", "Well Property" );
|
||||
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", RiaResultNames::undefinedResultName(), "Segment Branch" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -234,7 +285,7 @@ void RimWellLogRftCurve::setRftAddress( RifEclipseRftAddress address )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEclipseRftAddress RimWellLogRftCurve::rftAddress() const
|
||||
{
|
||||
return RifEclipseRftAddress( m_wellName, m_timeStep, m_wellLogChannelName() );
|
||||
return { m_wellName, m_timeStep, m_wellLogChannelName() };
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -259,12 +310,12 @@ void RimWellLogRftCurve::setDefaultAddress( QString wellName )
|
||||
|
||||
if ( !wellNameHasRftData )
|
||||
{
|
||||
m_wellLogChannelName = RifEclipseRftAddress::NONE;
|
||||
m_wellLogChannelName = RifEclipseRftAddress::RftWellLogChannelType::NONE;
|
||||
m_timeStep = QDateTime();
|
||||
return;
|
||||
}
|
||||
|
||||
m_wellLogChannelName = RifEclipseRftAddress::PRESSURE;
|
||||
m_wellLogChannelName = RifEclipseRftAddress::RftWellLogChannelType::PRESSURE;
|
||||
|
||||
std::set<QDateTime> timeSteps = reader->availableTimeSteps( m_wellName, m_wellLogChannelName() );
|
||||
if ( !timeSteps.empty() )
|
||||
@@ -282,7 +333,7 @@ void RimWellLogRftCurve::setDefaultAddress( QString wellName )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogRftCurve::updateWellChannelNameAndTimeStep()
|
||||
{
|
||||
if ( !m_timeStep().isValid() || m_wellLogChannelName() == RifEclipseRftAddress::NONE )
|
||||
if ( !m_timeStep().isValid() || m_wellLogChannelName() == RifEclipseRftAddress::RftWellLogChannelType::NONE )
|
||||
{
|
||||
setDefaultAddress( m_wellName );
|
||||
return;
|
||||
@@ -295,11 +346,11 @@ void RimWellLogRftCurve::updateWellChannelNameAndTimeStep()
|
||||
|
||||
if ( channelNames.empty() )
|
||||
{
|
||||
m_wellLogChannelName = RifEclipseRftAddress::NONE;
|
||||
m_wellLogChannelName = RifEclipseRftAddress::RftWellLogChannelType::NONE;
|
||||
}
|
||||
else if ( !channelNames.count( m_wellLogChannelName() ) )
|
||||
{
|
||||
m_wellLogChannelName = RifEclipseRftAddress::PRESSURE;
|
||||
m_wellLogChannelName = RifEclipseRftAddress::RftWellLogChannelType::PRESSURE;
|
||||
}
|
||||
|
||||
std::set<QDateTime> timeSteps = reader->availableTimeSteps( m_wellName, m_wellLogChannelName() );
|
||||
@@ -353,14 +404,26 @@ QString RimWellLogRftCurve::createCurveAutoName()
|
||||
{
|
||||
name.push_back( m_observedFmuRftData->name() );
|
||||
}
|
||||
if ( wellLogChannelUiName() !=
|
||||
caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::text( RifEclipseRftAddress::NONE ) )
|
||||
|
||||
if ( m_rftDataType() == RftDataType::RFT_DATA )
|
||||
{
|
||||
RifEclipseRftAddress::RftWellLogChannelType channelNameEnum =
|
||||
caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::fromText( wellLogChannelUiName() );
|
||||
QString channelName = caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::uiText( channelNameEnum );
|
||||
name.push_back( channelName );
|
||||
if ( wellLogChannelUiName() != caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::text(
|
||||
RifEclipseRftAddress::RftWellLogChannelType::NONE ) )
|
||||
{
|
||||
RifEclipseRftAddress::RftWellLogChannelType channelNameEnum =
|
||||
caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::fromText( wellLogChannelUiName() );
|
||||
QString channelName = caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::uiText( channelNameEnum );
|
||||
name.push_back( channelName );
|
||||
}
|
||||
}
|
||||
else if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
name.push_back( m_segmentResultName );
|
||||
|
||||
QString branchText = "Branch " + m_segmentBranchId();
|
||||
name.push_back( branchText );
|
||||
}
|
||||
|
||||
if ( !m_timeStep().isNull() )
|
||||
{
|
||||
name.push_back( m_timeStep().toString( RiaQDateTimeTools::dateFormatString() ) );
|
||||
@@ -376,7 +439,7 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
{
|
||||
this->RimPlotCurve::updateCurvePresentation( updateParentPlot );
|
||||
|
||||
DerivedMDSource derivedMDSource = NO_SOURCE;
|
||||
DerivedMDSource derivedMDSource = DerivedMDSource::NO_SOURCE;
|
||||
|
||||
if ( isCurveVisible() )
|
||||
{
|
||||
@@ -384,9 +447,9 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
firstAncestorOrThisOfType( wellLogPlot );
|
||||
CVF_ASSERT( wellLogPlot );
|
||||
|
||||
RimWellRftPlot* rftPlot = dynamic_cast<RimWellRftPlot*>( wellLogPlot );
|
||||
bool showErrorBarsInObservedData = rftPlot ? rftPlot->showErrorBarsForObservedData() : false;
|
||||
m_showErrorBars = showErrorBarsInObservedData;
|
||||
auto* rftPlot = dynamic_cast<RimWellRftPlot*>( wellLogPlot );
|
||||
bool showErrorBarsInObservedData = rftPlot ? rftPlot->showErrorBarsForObservedData() : false;
|
||||
m_showErrorBars = showErrorBarsInObservedData;
|
||||
|
||||
std::vector<double> measuredDepthVector = measuredDepthValues();
|
||||
std::vector<double> tvDepthVector = tvDepthValues();
|
||||
@@ -428,17 +491,17 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
{
|
||||
if ( deriveMeasuredDepthValuesFromWellPath( tvDepthVector, measuredDepthVector ) )
|
||||
{
|
||||
derivedMDSource = WELL_PATH;
|
||||
derivedMDSource = DerivedMDSource::WELL_PATH;
|
||||
}
|
||||
else if ( deriveMeasuredDepthFromObservedData( tvDepthVector, measuredDepthVector ) )
|
||||
{
|
||||
derivedMDSource = OBSERVED_DATA;
|
||||
derivedMDSource = DerivedMDSource::OBSERVED_DATA;
|
||||
}
|
||||
}
|
||||
|
||||
if ( tvDepthVector.size() != measuredDepthVector.size() )
|
||||
{
|
||||
derivedMDSource = NO_SOURCE;
|
||||
derivedMDSource = DerivedMDSource::NO_SOURCE;
|
||||
measuredDepthVector = tvDepthVector;
|
||||
}
|
||||
|
||||
@@ -470,22 +533,21 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
{
|
||||
m_plotCurve->setPerPointLabels( perPointLabels );
|
||||
|
||||
auto xValues = this->curveData()->propertyValuesByIntervals();
|
||||
auto yValues =
|
||||
this->curveData()->depthValuesByIntervals( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
|
||||
auto propertyValues = this->curveData()->propertyValues();
|
||||
auto depthValues = this->curveData()->depths( RiaDefines::DepthTypeEnum::MEASURED_DEPTH, displayUnit );
|
||||
bool useLogarithmicScale = false;
|
||||
|
||||
if ( !errors.empty() )
|
||||
{
|
||||
this->setSamplesFromXYErrorValues( xValues,
|
||||
yValues,
|
||||
this->setSamplesFromXYErrorValues( propertyValues,
|
||||
depthValues,
|
||||
errors,
|
||||
useLogarithmicScale,
|
||||
RiaCurveDataTools::ErrorAxis::ERROR_ALONG_X_AXIS );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plotCurve->setSamplesFromXValuesAndYValues( xValues, yValues, useLogarithmicScale );
|
||||
setPropertyAndDepthValuesToPlotCurve( propertyValues, depthValues );
|
||||
}
|
||||
|
||||
RimWellLogTrack* wellLogTrack;
|
||||
@@ -495,21 +557,25 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
RiuQwtPlotWidget* viewer = wellLogTrack->viewer();
|
||||
if ( viewer )
|
||||
{
|
||||
if ( derivedMDSource != NO_SOURCE )
|
||||
QString text;
|
||||
|
||||
if ( derivedMDSource != DerivedMDSource::NO_SOURCE )
|
||||
{
|
||||
if ( derivedMDSource == WELL_PATH )
|
||||
if ( derivedMDSource == DerivedMDSource::WELL_PATH )
|
||||
{
|
||||
viewer->setAxisTitleText( RiuPlotAxis::defaultLeft(), "WELL/" + wellLogPlot->depthAxisTitle() );
|
||||
text = "WELL/" + wellLogPlot->depthAxisTitle();
|
||||
}
|
||||
else
|
||||
{
|
||||
viewer->setAxisTitleText( RiuPlotAxis::defaultLeft(), "OBS/" + wellLogPlot->depthAxisTitle() );
|
||||
text = "OBS/" + wellLogPlot->depthAxisTitle();
|
||||
}
|
||||
}
|
||||
else // Standard depth title set from plot
|
||||
{
|
||||
viewer->setAxisTitleText( RiuPlotAxis::defaultLeft(), wellLogPlot->depthAxisTitle() );
|
||||
text = wellLogPlot->depthAxisTitle();
|
||||
}
|
||||
|
||||
viewer->setAxisTitleText( wellLogPlot->depthAxis(), text );
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -559,14 +625,23 @@ void RimWellLogRftCurve::defineUiOrdering( QString uiConfigName, caf::PdmUiOrder
|
||||
caf::PdmUiGroup* curveDataGroup = uiOrdering.addNewGroup( "Curve Data" );
|
||||
curveDataGroup->add( &m_eclipseResultCase );
|
||||
curveDataGroup->add( &m_wellName );
|
||||
|
||||
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromWellName( curveDataGroup,
|
||||
m_wellName,
|
||||
m_branchDetection,
|
||||
m_branchIndex );
|
||||
|
||||
curveDataGroup->add( &m_wellLogChannelName );
|
||||
curveDataGroup->add( &m_timeStep );
|
||||
curveDataGroup->add( &m_rftDataType );
|
||||
|
||||
if ( m_rftDataType() == RimWellLogRftCurve::RftDataType::RFT_DATA )
|
||||
{
|
||||
curveDataGroup->add( &m_wellLogChannelName );
|
||||
|
||||
RiaSimWellBranchTools::appendSimWellBranchFieldsIfRequiredFromWellName( curveDataGroup,
|
||||
m_wellName,
|
||||
m_branchDetection,
|
||||
m_branchIndex );
|
||||
}
|
||||
else
|
||||
{
|
||||
curveDataGroup->add( &m_segmentResultName );
|
||||
curveDataGroup->add( &m_segmentBranchId );
|
||||
}
|
||||
|
||||
caf::PdmUiGroup* stackingGroup = uiOrdering.addNewGroup( "Stacking" );
|
||||
RimStackablePlotCurve::stackingUiOrdering( *stackingGroup );
|
||||
@@ -591,7 +666,7 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions( const c
|
||||
|
||||
options = RimWellLogCurve::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
|
||||
|
||||
if ( options.size() > 0 ) return options;
|
||||
if ( !options.empty() ) return options;
|
||||
|
||||
if ( fieldNeedingOptions == &m_eclipseResultCase )
|
||||
{
|
||||
@@ -628,8 +703,8 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions( const c
|
||||
if ( options.empty() )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( caf::AppEnum<RifEclipseRftAddress::RftWellLogChannelType>::uiText(
|
||||
RifEclipseRftAddress::NONE ),
|
||||
RifEclipseRftAddress::NONE ) );
|
||||
RifEclipseRftAddress::RftWellLogChannelType::NONE ),
|
||||
RifEclipseRftAddress::RftWellLogChannelType::NONE ) );
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_timeStep )
|
||||
@@ -656,6 +731,49 @@ QList<caf::PdmOptionItemInfo> RimWellLogRftCurve::calculateValueOptions( const c
|
||||
|
||||
options = RiaSimWellBranchTools::valueOptionsForBranchIndexField( simulationWellBranches );
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_segmentResultName )
|
||||
{
|
||||
options.push_front(
|
||||
caf::PdmOptionItemInfo( RiaResultNames::undefinedResultName(), RiaResultNames::undefinedResultName() ) );
|
||||
|
||||
RifReaderRftInterface* reader = rftReader();
|
||||
if ( reader )
|
||||
{
|
||||
options.push_back( caf::PdmOptionItemInfo( RiaDefines::segmentNumberResultName(),
|
||||
RiaDefines::segmentNumberResultName() ) );
|
||||
|
||||
for ( const auto& resultAdr : reader->eclipseRftAddresses( m_wellName(), m_timeStep() ) )
|
||||
{
|
||||
if ( resultAdr.wellLogChannel() == RifEclipseRftAddress::RftWellLogChannelType::SEGMENT_VALUES )
|
||||
{
|
||||
options.push_back(
|
||||
caf::PdmOptionItemInfo( resultAdr.segmentResultName(), resultAdr.segmentResultName() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( fieldNeedingOptions == &m_segmentBranchId )
|
||||
{
|
||||
options.push_front( caf::PdmOptionItemInfo( RiaDefines::allBranches(), RiaDefines::allBranches() ) );
|
||||
|
||||
RifReaderRftInterface* reader = rftReader();
|
||||
if ( reader )
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
auto adr = RifEclipseRftAddress::createSegmentResult( m_wellName(),
|
||||
m_timeStep,
|
||||
RiaDefines::segmentBranchNumberResultName() );
|
||||
|
||||
reader->values( adr, &values );
|
||||
for ( const auto& v : values )
|
||||
{
|
||||
int intValue = v;
|
||||
auto txt = QString::number( intValue );
|
||||
options.push_back( caf::PdmOptionItemInfo( txt, txt ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
@@ -669,21 +787,23 @@ void RimWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
|
||||
{
|
||||
m_idxInWellPathToIdxInRftFile.clear();
|
||||
|
||||
bool loadData = false;
|
||||
|
||||
RimWellLogCurve::fieldChangedByUi( changedField, oldValue, newValue );
|
||||
if ( changedField == &m_eclipseResultCase )
|
||||
{
|
||||
m_timeStep = QDateTime();
|
||||
m_wellName = "";
|
||||
m_wellLogChannelName = RifEclipseRftAddress::NONE;
|
||||
m_wellLogChannelName = RifEclipseRftAddress::RftWellLogChannelType::NONE;
|
||||
|
||||
this->loadDataAndUpdate( true );
|
||||
loadData = true;
|
||||
}
|
||||
else if ( changedField == &m_wellName )
|
||||
{
|
||||
m_branchIndex = 0;
|
||||
|
||||
updateWellChannelNameAndTimeStep();
|
||||
this->loadDataAndUpdate( true );
|
||||
loadData = true;
|
||||
}
|
||||
else if ( changedField == &m_branchDetection || changedField == &m_branchIndex )
|
||||
{
|
||||
@@ -692,20 +812,23 @@ void RimWellLogRftCurve::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
|
||||
m_branchIndex = RiaSimWellBranchTools::clampBranchIndex( simWellName, m_branchIndex, m_branchDetection );
|
||||
|
||||
updateWellChannelNameAndTimeStep();
|
||||
this->loadDataAndUpdate( true );
|
||||
loadData = true;
|
||||
}
|
||||
else if ( changedField == &m_wellLogChannelName )
|
||||
{
|
||||
if ( m_wellLogChannelName == RifEclipseRftAddress::NONE )
|
||||
if ( m_wellLogChannelName == RifEclipseRftAddress::RftWellLogChannelType::NONE )
|
||||
{
|
||||
m_timeStep = QDateTime();
|
||||
}
|
||||
this->loadDataAndUpdate( true );
|
||||
loadData = true;
|
||||
}
|
||||
else if ( changedField == &m_timeStep )
|
||||
else if ( changedField == &m_timeStep || changedField == &m_segmentResultName ||
|
||||
changedField == &m_segmentBranchId || changedField == &m_rftDataType )
|
||||
{
|
||||
this->loadDataAndUpdate( true );
|
||||
loadData = true;
|
||||
}
|
||||
|
||||
if ( loadData ) this->loadDataAndUpdate( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -715,7 +838,7 @@ std::vector<QString> RimWellLogRftCurve::perPointLabels() const
|
||||
{
|
||||
if ( m_observedFmuRftData() )
|
||||
{
|
||||
RifEclipseRftAddress address( m_wellName(), m_timeStep, RifEclipseRftAddress::PRESSURE );
|
||||
RifEclipseRftAddress address( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::PRESSURE );
|
||||
return m_observedFmuRftData()->labels( address );
|
||||
}
|
||||
return {};
|
||||
@@ -730,18 +853,22 @@ RifReaderRftInterface* RimWellLogRftCurve::rftReader() const
|
||||
{
|
||||
return m_eclipseResultCase()->rftReader();
|
||||
}
|
||||
else if ( m_summaryCase() ) // Summary RFT curves have both summary and ensemble set. Prioritize summary for reader.
|
||||
|
||||
if ( m_summaryCase() ) // Summary RFT curves have both summary and ensemble set. Prioritize summary for reader.
|
||||
{
|
||||
return m_summaryCase()->rftReader();
|
||||
}
|
||||
else if ( m_ensemble() )
|
||||
|
||||
if ( m_ensemble() )
|
||||
{
|
||||
return m_ensemble()->rftStatisticsReader();
|
||||
}
|
||||
else if ( m_observedFmuRftData() )
|
||||
|
||||
if ( m_observedFmuRftData() )
|
||||
{
|
||||
return m_observedFmuRftData()->rftReader();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -770,7 +897,7 @@ RigEclipseWellLogExtractor* RimWellLogRftCurve::extractor()
|
||||
QString simWellName = RimWellPlotTools::simWellName( m_wellName );
|
||||
std::vector<const RigWellPath*> wellPaths =
|
||||
RiaSimWellBranchTools::simulationWellBranches( simWellName, m_branchDetection );
|
||||
if ( wellPaths.size() == 0 ) return nullptr;
|
||||
if ( wellPaths.empty() ) return nullptr;
|
||||
|
||||
m_branchIndex = RiaSimWellBranchTools::clampBranchIndex( simWellName, m_branchIndex, m_branchDetection );
|
||||
|
||||
@@ -809,12 +936,11 @@ bool RimWellLogRftCurve::createWellPathIdxToRftFileIdxMapping()
|
||||
globCellIndicesToIndexInWell[intersections[idx].globCellIndex] = idx;
|
||||
}
|
||||
|
||||
RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::TVD );
|
||||
RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD );
|
||||
std::vector<caf::VecIjk> rftIndices;
|
||||
RifReaderEclipseRft* eclipseRftReader = dynamic_cast<RifReaderEclipseRft*>( rftReader() );
|
||||
if ( !eclipseRftReader ) return false;
|
||||
if ( !rftReader() ) return false;
|
||||
|
||||
eclipseRftReader->cellIndices( depthAddress, &rftIndices );
|
||||
rftReader()->cellIndices( depthAddress, &rftIndices );
|
||||
|
||||
const RigMainGrid* mainGrid = eclExtractor->caseData()->mainGrid();
|
||||
|
||||
@@ -861,9 +987,9 @@ std::vector<size_t> RimWellLogRftCurve::sortedIndicesInRftFile()
|
||||
}
|
||||
|
||||
std::vector<size_t> indices;
|
||||
for ( auto it = m_idxInWellPathToIdxInRftFile.begin(); it != m_idxInWellPathToIdxInRftFile.end(); it++ )
|
||||
for ( auto& it : m_idxInWellPathToIdxInRftFile )
|
||||
{
|
||||
indices.push_back( it->second );
|
||||
indices.push_back( it.second );
|
||||
}
|
||||
|
||||
return indices;
|
||||
@@ -879,6 +1005,16 @@ std::vector<double> RimWellLogRftCurve::xValues()
|
||||
|
||||
if ( !reader ) return values;
|
||||
|
||||
if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
auto depthAddress = RifEclipseRftAddress::createSegmentResult( m_wellName(), m_timeStep, m_segmentResultName() );
|
||||
depthAddress.setSegmentBranchNumber( segmentBranchNumber() );
|
||||
|
||||
reader->values( depthAddress, &values );
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
RifEclipseRftAddress address( m_wellName(), m_timeStep, m_wellLogChannelName() );
|
||||
|
||||
reader->values( address, &values );
|
||||
@@ -899,10 +1035,8 @@ std::vector<double> RimWellLogRftCurve::xValues()
|
||||
|
||||
return valuesSorted;
|
||||
}
|
||||
else
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -913,11 +1047,14 @@ std::vector<double> RimWellLogRftCurve::errorValues()
|
||||
RifReaderRftInterface* reader = rftReader();
|
||||
std::vector<double> errorValues;
|
||||
|
||||
if ( reader )
|
||||
if ( reader && m_rftDataType() == RftDataType::RFT_DATA )
|
||||
{
|
||||
RifEclipseRftAddress errorAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::PRESSURE_ERROR );
|
||||
RifEclipseRftAddress errorAddress( m_wellName(),
|
||||
m_timeStep,
|
||||
RifEclipseRftAddress::RftWellLogChannelType::PRESSURE_ERROR );
|
||||
reader->values( errorAddress, &errorValues );
|
||||
}
|
||||
|
||||
return errorValues;
|
||||
}
|
||||
|
||||
@@ -931,7 +1068,17 @@ std::vector<double> RimWellLogRftCurve::tvDepthValues()
|
||||
|
||||
if ( !reader ) return values;
|
||||
|
||||
RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::TVD );
|
||||
if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
auto depthAddress =
|
||||
RifEclipseRftAddress::createSegmentResult( m_wellName(), m_timeStep, RiaDefines::segmentTvdDepthResultName() );
|
||||
depthAddress.setSegmentBranchNumber( segmentBranchNumber() );
|
||||
|
||||
reader->values( depthAddress, &values );
|
||||
return values;
|
||||
}
|
||||
|
||||
RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD );
|
||||
reader->values( depthAddress, &values );
|
||||
|
||||
bool wellPathExists = createWellPathIdxToRftFileIdxMapping();
|
||||
@@ -950,10 +1097,8 @@ std::vector<double> RimWellLogRftCurve::tvDepthValues()
|
||||
|
||||
return valuesSorted;
|
||||
}
|
||||
else
|
||||
{
|
||||
return values;
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -961,6 +1106,23 @@ std::vector<double> RimWellLogRftCurve::tvDepthValues()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RimWellLogRftCurve::measuredDepthValues()
|
||||
{
|
||||
if ( m_rftDataType() == RftDataType::RFT_SEGMENT_DATA )
|
||||
{
|
||||
std::vector<double> values;
|
||||
|
||||
RifReaderRftInterface* reader = rftReader();
|
||||
if ( reader )
|
||||
{
|
||||
auto depthAddress = RifEclipseRftAddress::createSegmentResult( m_wellName(),
|
||||
m_timeStep,
|
||||
RiaDefines::segmentStartDepthResultName() );
|
||||
depthAddress.setSegmentBranchNumber( segmentBranchNumber() );
|
||||
|
||||
reader->values( depthAddress, &values );
|
||||
}
|
||||
return values;
|
||||
}
|
||||
|
||||
if ( m_observedFmuRftData && !m_ensemble && !m_summaryCase )
|
||||
{
|
||||
RifReaderRftInterface* reader = rftReader();
|
||||
@@ -968,7 +1130,7 @@ std::vector<double> RimWellLogRftCurve::measuredDepthValues()
|
||||
|
||||
if ( !reader ) return values;
|
||||
|
||||
RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::MD );
|
||||
RifEclipseRftAddress depthAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::MD );
|
||||
reader->values( depthAddress, &values );
|
||||
return values;
|
||||
}
|
||||
@@ -1044,8 +1206,8 @@ bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector<
|
||||
std::vector<double> tvdValuesOfObservedData;
|
||||
std::vector<double> mdValuesOfObservedData;
|
||||
|
||||
RifEclipseRftAddress tvdAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::TVD );
|
||||
RifEclipseRftAddress mdAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::MD );
|
||||
RifEclipseRftAddress tvdAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::TVD );
|
||||
RifEclipseRftAddress mdAddress( m_wellName(), m_timeStep, RifEclipseRftAddress::RftWellLogChannelType::MD );
|
||||
|
||||
reader->values( tvdAddress, &tvdValuesOfObservedData );
|
||||
reader->values( mdAddress, &mdValuesOfObservedData );
|
||||
@@ -1062,3 +1224,18 @@ bool RimWellLogRftCurve::deriveMeasuredDepthFromObservedData( const std::vector<
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimWellLogRftCurve::segmentBranchNumber() const
|
||||
{
|
||||
if ( m_segmentBranchId() != RiaDefines::allBranches() )
|
||||
{
|
||||
QString text = m_segmentBranchId();
|
||||
auto intValue = text.toInt();
|
||||
return intValue;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user