#5219 Implement support for TVDRKB for well log depth

* Also show air gap in title when TVDRKB is selected and not otherwise
This commit is contained in:
Gaute Lindkvist 2020-01-08 10:31:01 +01:00
parent de68df122d
commit 10f749f356
33 changed files with 218 additions and 154 deletions

View File

@ -56,6 +56,7 @@ void caf::AppEnum<RiaDefines::DepthTypeEnum>::setUp()
addItem( RiaDefines::TRUE_VERTICAL_DEPTH, "TRUE_VERTICAL_DEPTH", "True Vertical Depth (MSL)" );
addItem( RiaDefines::PSEUDO_LENGTH, "PSEUDO_LENGTH", "Pseudo Length" );
addItem( RiaDefines::CONNECTION_NUMBER, "CONNECTION_NUMBER", "Connection Number" );
addItem( RiaDefines::TRUE_VERTICAL_DEPTH_RKB, "TRUE_VERTICAL_DEPTH_RKB", "True Vertical Depth (RKB)" );
setDefault( RiaDefines::MEASURED_DEPTH );
}

View File

@ -146,7 +146,8 @@ enum DepthTypeEnum
MEASURED_DEPTH,
TRUE_VERTICAL_DEPTH,
PSEUDO_LENGTH,
CONNECTION_NUMBER
CONNECTION_NUMBER,
TRUE_VERTICAL_DEPTH_RKB
};
// Defines relate to plotting

View File

@ -101,7 +101,7 @@ RimWellBoreStabilityPlot*
{
auto task = progInfo.task( "Updating all tracks", 5 );
plot->enableAllAutoNameTags( true );
plot->nameConfig()->setAutoNameTags( true, true, true, false, true );
plot->setMultiPlotTitleVisible( true );
plot->setLegendsVisible( true );
plot->setLegendsHorizontal( true );

View File

@ -290,7 +290,7 @@ void RimWellFlowRateCurve::updateStackedPlotData()
}
RigWellLogCurveData tempCurveData;
tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, displayUnit, false );
tempCurveData.setValuesAndDepths( allStackedValues, allDepthValues, depthType, 0.0, displayUnit, false );
depthValues = tempCurveData.depthPlotValues( depthType, displayUnit );
stackedValues = tempCurveData.xPlotValues();
@ -340,7 +340,7 @@ void RimWellFlowRateCurve::setFlowValuesPrDepthValue( const QString&
const std::vector<double>& depthValues,
const std::vector<double>& flowRates )
{
this->setValuesAndDepths( flowRates, depthValues, depthType, RiaDefines::UNIT_NONE, false );
this->setValuesAndDepths( flowRates, depthValues, depthType, 0.0, RiaDefines::UNIT_NONE, false );
m_curveAutoName = curveName;
}

View File

@ -1006,7 +1006,7 @@ void RimWellPltPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
plotLayoutGroup->setCollapsedByDefault( true );
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *plotLayoutGroup );
RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *plotLayoutGroup );
RimWellLogPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
}
}

View File

@ -979,7 +979,7 @@ void RimWellRftPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
plotLayoutGroup->setCollapsedByDefault( true );
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *plotLayoutGroup );
RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *plotLayoutGroup );
RimWellLogPlot::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
}
}

View File

@ -499,7 +499,7 @@ void RimGridCrossPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrderin
if ( isMdiWindow() )
{
RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, *generalGroup );
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *generalGroup );
}
else
{

View File

@ -227,7 +227,6 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vector<doubl
RimWellLogExtractionCurve::findAndLoadWbsParametersFromLasFiles( wellPath, geomExtractor.p() );
m_geomResultDefinition->loadResult();
geomExtractor->setRkbDiff( rkbDiff() );
geomExtractor->curveData( m_geomResultDefinition->resultAddress(), timeStep, values );
}
}

View File

@ -555,18 +555,18 @@ void RimMultiPlotWindow::fieldChangedByUi( const caf::PdmFieldHandle* changedFie
void RimMultiPlotWindow::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
uiOrderingForPlotLayout( uiConfigName, *titleAndLegendsGroup );
uiOrderingForMultiPlotLayout( uiConfigName, *titleAndLegendsGroup );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimMultiPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
void RimMultiPlotWindow::uiOrderingForMultiPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_showPlotWindowTitle );
uiOrdering.add( &m_plotWindowTitle );
uiOrdering.add( &m_showIndividualPlotTitles );
RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, uiOrdering );
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, uiOrdering );
uiOrdering.add( &m_columnCount );
uiOrdering.add( &m_rowsPerPage );
}

View File

@ -118,7 +118,7 @@ protected:
const QVariant& newValue ) override;
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
void uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForMultiPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;

View File

@ -235,7 +235,7 @@ QList<caf::PdmOptionItemInfo> RimPlotWindow::calculateValueOptions( const caf::P
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimPlotWindow::uiOrderingForLegendSettings( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
void RimPlotWindow::uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
uiOrdering.add( &m_showPlotLegends );
uiOrdering.add( &m_plotLegendsHorizontal );

View File

@ -71,7 +71,7 @@ protected:
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions,
bool* useOptionsOnly ) override;
void uiOrderingForLegendSettings( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForPlotLayout( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
private:
virtual void doUpdateLayout() {}

View File

@ -82,7 +82,7 @@ RimWellBoreStabilityPlot::RimWellBoreStabilityPlot()
"FG in shale = K0_FG * (OBG0-PP0)\nK0_FG = (FG-PP)/(OBG-PP)",
"" );
CAF_PDM_InitField( &m_userDefinedPPShale, "UserPPShale", 1.05, "User Defined Pore Pressure, Shale [bar]", "", "", "" );
CAF_PDM_InitField( &m_userDefinedPPShale, "UserPPShale", 1.05, "Multiplier of hydrostatic PP", "", "", "" );
CAF_PDM_InitField( &m_userDefinedPoissionRatio,
"UserPoissionRatio",
@ -226,10 +226,14 @@ void RimWellBoreStabilityPlot::defineUiOrdering( QString uiConfigName, caf::PdmU
parameterSources->add( &m_userDefinedK0FG );
}
caf::PdmUiGroup* titleLegendAndAxisGroup = uiOrdering.addNewGroup( "Title, Legend and Axis" );
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *titleLegendAndAxisGroup );
RimWellLogPlot::uiOrderingForLegendSettings( uiConfigName, *titleLegendAndAxisGroup );
uiOrderingForDepthAxis( uiConfigName, *titleLegendAndAxisGroup );
caf::PdmUiGroup* depthGroup = uiOrdering.addNewGroup( "Depth Axis" );
RimWellLogPlot::uiOrderingForDepthAxis( uiConfigName, *depthGroup );
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" );
RimWellLogPlot::uiOrderingForAutoName( uiConfigName, *titleGroup );
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
uiOrdering.skipRemainingFields( true );
}
@ -252,7 +256,8 @@ QList<caf::PdmOptionItemInfo>
std::vector<ParameterSource> sources = supportedSources( parameter );
for ( int i = 0; i < (int)sources.size(); ++i )
{
if ( parameter.exclusiveOptions() || i == (int)sources.size() - 1 )
if ( parameter.exclusiveOptions() || i == (int)sources.size() - 1 ||
sources[i] == RigWbsParameter::HYDROSTATIC )
{
options.push_back( caf::PdmOptionItemInfo( ParameterSourceEnum::uiText( sources[i] ), sources[i] ) );
}

View File

@ -109,12 +109,13 @@ bool RimWellLogCurve::yValueRangeInData( double* minimumValue, double* maximumVa
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setValuesAndDepths( const std::vector<double>& xValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
{
m_curveData->setValuesAndDepths( xValues, measuredDepths, depthType, depthUnit, isExtractionCurve );
m_curveData->setValuesAndDepths( xValues, depths, depthType, rkbDiff, depthUnit, isExtractionCurve );
calculateCurveDataXRange();
}
@ -123,25 +124,27 @@ void RimWellLogCurve::setValuesAndDepths( const std::vector<double>& xValues,
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setValuesAndDepths( const std::vector<double>& xValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
{
m_curveData->setValuesAndDepths( xValues, depths, depthUnit, isExtractionCurve );
m_curveData->setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve );
calculateCurveDataXRange();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogCurve::setValuesWithTVD( const std::vector<double>& xValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& tvDepths,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
void RimWellLogCurve::setValuesWithMdAndTVD( const std::vector<double>& xValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& tvdMSL,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
{
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> depths = {{RiaDefines::MEASURED_DEPTH, measuredDepths},
{RiaDefines::TRUE_VERTICAL_DEPTH, tvDepths}};
setValuesAndDepths( xValues, depths, depthUnit, isExtractionCurve );
{RiaDefines::TRUE_VERTICAL_DEPTH, tvdMSL}};
setValuesAndDepths( xValues, depths, rkbDiff, depthUnit, isExtractionCurve );
}
//--------------------------------------------------------------------------------------------------

View File

@ -45,15 +45,18 @@ public:
void setValuesAndDepths( const std::vector<double>& xValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );
void setValuesWithTVD( const std::vector<double>& xValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& tvDepths,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );
void setValuesWithMdAndTVD( const std::vector<double>& xValues,
const std::vector<double>& measuredDepths,
const std::vector<double>& tvDepths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );
void setValuesAndDepths( const std::vector<double>& xValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );

View File

@ -344,7 +344,7 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
RiaDefines::DepthTypeEnum depthType = wellLogPlot->depthType();
RiaDefines::DepthUnitType displayUnit = wellLogPlot->depthUnit();
if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
isUsingPseudoLength = false;
}
@ -447,6 +447,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
std::vector<double> values;
std::vector<double> measuredDepthValues;
std::vector<double> tvDepthValues;
double rkbDiff = 0.0;
RiaDefines::DepthUnitType depthUnit = RiaDefines::UNIT_METER;
@ -454,6 +455,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
{
measuredDepthValues = eclExtractor->cellIntersectionMDs();
tvDepthValues = eclExtractor->cellIntersectionTVDs();
rkbDiff = eclExtractor->wellPathData()->rkbDiff();
m_eclipseResultDefinition->loadResult();
@ -480,6 +482,7 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
{
measuredDepthValues = geomExtractor->cellIntersectionMDs();
tvDepthValues = geomExtractor->cellIntersectionTVDs();
rkbDiff = geomExtractor->wellPathData()->rkbDiff();
if ( measuredDepthValues.empty() )
{
@ -494,8 +497,6 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
wbsPlot->applyWbsParametersToExtractor( geomExtractor.p() );
}
geomExtractor->setRkbDiff( rkbDiff() );
m_geomResultDefinition->loadResult();
geomExtractor->curveData( m_geomResultDefinition->resultAddress(), m_timeStep, &values );
if ( performDataSmoothing )
@ -515,12 +516,18 @@ void RimWellLogExtractionCurve::extractData( bool* isUsingPseudoLength,
this->setValuesAndDepths( values,
measuredDepthValues,
RiaDefines::MEASURED_DEPTH,
0.0,
depthUnit,
!performDataSmoothing );
}
else
{
this->setValuesWithTVD( values, measuredDepthValues, tvDepthValues, depthUnit, !performDataSmoothing );
this->setValuesWithMdAndTVD( values,
measuredDepthValues,
tvDepthValues,
rkbDiff,
depthUnit,
!performDataSmoothing );
}
}
}
@ -1036,18 +1043,6 @@ QString RimWellLogExtractionCurve::caseName() const
return QString();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
double RimWellLogExtractionCurve::rkbDiff() const
{
if ( m_wellPath && m_wellPath->wellPathGeometry() )
{
return m_wellPath->wellPathGeometry()->rkbDiff();
}
return HUGE_VAL;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@ -71,7 +71,6 @@ public:
bool isEclipseCurve() const;
QString caseName() const;
double rkbDiff() const;
int currentTimeStep() const;
void setCurrentTimeStep( int timeStep );

View File

@ -89,7 +89,8 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
std::vector<double> values = wellLogFile->values( m_wellLogChannnelName );
std::vector<double> measuredDepthValues = wellLogFile->depthValues();
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH )
if ( wellLogPlot && ( wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH ||
wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) )
{
bool canUseTvd = false;
if ( wellLogFile->hasTvdChannel() )
@ -98,11 +99,12 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( values.size() == measuredDepthValues.size() && values.size() == tvdMslValues.size() )
{
this->setValuesWithTVD( values,
measuredDepthValues,
tvdMslValues,
wellLogFile->depthUnit(),
false );
this->setValuesWithMdAndTVD( values,
measuredDepthValues,
tvdMslValues,
m_wellPath->wellPathGeometry()->rkbDiff(),
wellLogFile->depthUnit(),
false );
canUseTvd = true;
}
}
@ -122,11 +124,12 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( values.size() == trueVerticalDepthValues.size() &&
values.size() == measuredDepthValues.size() )
{
this->setValuesWithTVD( values,
measuredDepthValues,
trueVerticalDepthValues,
wellLogFile->depthUnit(),
false );
this->setValuesWithMdAndTVD( values,
measuredDepthValues,
trueVerticalDepthValues,
m_wellPath->wellPathGeometry()->rkbDiff(),
wellLogFile->depthUnit(),
false );
canUseTvd = true;
}
}
@ -153,6 +156,7 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
this->setValuesAndDepths( values,
measuredDepthValues,
RiaDefines::MEASURED_DEPTH,
0.0,
wellLogFile->depthUnit(),
false );
}
@ -170,20 +174,16 @@ void RimWellLogFileCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
displayUnit = wellLogPlot->depthUnit();
}
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH &&
this->curveData()->availableDepthTypes().count( RiaDefines::TRUE_VERTICAL_DEPTH ) )
RiaDefines::DepthTypeEnum depthType = RiaDefines::MEASURED_DEPTH;
if ( wellLogPlot && this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) )
{
m_qwtPlotCurve
->setSamples( this->curveData()->xPlotValues().data(),
this->curveData()->depthPlotValues( RiaDefines::TRUE_VERTICAL_DEPTH, displayUnit ).data(),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
}
else
{
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
this->curveData()->depthPlotValues( RiaDefines::MEASURED_DEPTH, displayUnit ).data(),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
depthType = wellLogPlot->depthType();
}
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
this->curveData()->depthPlotValues( depthType, displayUnit ).data(),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
if ( updateParentPlot )

View File

@ -99,7 +99,9 @@ RimWellLogPlot::RimWellLogPlot()
m_nameConfig = new RimWellLogPlotNameConfig();
m_availableDepthUnits = {RiaDefines::UNIT_METER, RiaDefines::UNIT_FEET};
m_availableDepthTypes = {RiaDefines::MEASURED_DEPTH, RiaDefines::TRUE_VERTICAL_DEPTH};
m_availableDepthTypes = {RiaDefines::MEASURED_DEPTH,
RiaDefines::TRUE_VERTICAL_DEPTH,
RiaDefines::TRUE_VERTICAL_DEPTH_RKB};
m_minAvailableDepth = HUGE_VAL;
m_maxAvailableDepth = -HUGE_VAL;
@ -278,14 +280,6 @@ void RimWellLogPlot::visibleDepthRange( double* minimumDepth, double* maximumDep
*maximumDepth = m_maxVisibleDepth;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogPlot::enableAllAutoNameTags( bool enable )
{
m_nameConfig->enableAllAutoNameTags( enable );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -313,7 +307,6 @@ void RimWellLogPlot::uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrde
{
uiOrdering.add( &m_showPlotWindowTitle );
m_nameConfig->uiOrdering( uiConfigName, uiOrdering );
uiOrdering.add( &m_showIndividualPlotTitles );
}
//--------------------------------------------------------------------------------------------------
@ -579,7 +572,15 @@ void RimWellLogPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
}
else if ( changedField == &m_depthType )
{
m_isAutoScaleDepthEnabled = true;
m_isAutoScaleDepthEnabled = true;
bool isTVDRKB = m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB;
m_nameConfig->setAutoNameTags( m_nameConfig->addCaseName(),
m_nameConfig->addWellName(),
m_nameConfig->addTimeStep(),
isTVDRKB,
m_nameConfig->addWaterDepth() );
RimWellAllocationPlot* parentWellAllocation = nullptr;
this->firstAncestorOrThisOfType( parentWellAllocation );
if ( parentWellAllocation )
@ -613,10 +614,12 @@ void RimWellLogPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering&
caf::PdmUiGroup* gridGroup = uiOrdering.addNewGroup( "Depth Axis" );
uiOrderingForDepthAxis( uiConfigName, *gridGroup );
caf::PdmUiGroup* titleAndLegendsGroup = uiOrdering.addNewGroup( "Plot Layout" );
uiOrderingForAutoName( uiConfigName, *titleAndLegendsGroup );
RimPlotWindow::uiOrderingForLegendSettings( uiConfigName, *titleAndLegendsGroup );
titleAndLegendsGroup->add( &m_columnCount );
caf::PdmUiGroup* titleGroup = uiOrdering.addNewGroup( "Plot Title" );
uiOrderingForAutoName( uiConfigName, *titleGroup );
caf::PdmUiGroup* plotLayoutGroup = uiOrdering.addNewGroup( "Plot Layout" );
RimPlotWindow::uiOrderingForPlotLayout( uiConfigName, *plotLayoutGroup );
plotLayoutGroup->add( &m_columnCount );
uiOrdering.skipRemainingFields( true );
}
@ -741,6 +744,10 @@ QString RimWellLogPlot::depthAxisTitle() const
case RiaDefines::CONNECTION_NUMBER:
depthTitle = "Connection";
break;
case RiaDefines::TRUE_VERTICAL_DEPTH_RKB:
depthTitle = "TVDRKB";
break;
}
if ( m_depthType() == RiaDefines::CONNECTION_NUMBER ) return depthTitle;

View File

@ -86,8 +86,6 @@ public:
void availableDepthRange( double* minimumDepth, double* maximumDepth ) const;
void visibleDepthRange( double* minimumDepth, double* maximumDepth ) const;
void enableAllAutoNameTags( bool enable );
void uiOrderingForDepthAxis( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
void uiOrderingForAutoName( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );

View File

@ -33,11 +33,11 @@ RimWellLogPlotNameConfig::RimWellLogPlotNameConfig()
{
CAF_PDM_InitObject( "Well Log Plot Name Generator", "", "", "" );
CAF_PDM_InitField( &m_addCaseName, "AddCaseName", false, "Add Case Name", "", "", "" );
CAF_PDM_InitField( &m_addWellName, "AddWellName", false, "Add Well Name", "", "", "" );
CAF_PDM_InitField( &m_addTimestep, "AddTimeStep", false, "Add Time Step", "", "", "" );
CAF_PDM_InitField( &m_addAirGap, "AddAirGap", false, "Add Air Gap", "", "", "" );
CAF_PDM_InitField( &m_addWaterDepth, "AddWaterDepth", false, "Add Water Depth", "", "", "" );
CAF_PDM_InitField( &m_addCaseName, "AddCaseName", false, "Show Case Name", "", "", "" );
CAF_PDM_InitField( &m_addWellName, "AddWellName", false, "Show Well Name", "", "", "" );
CAF_PDM_InitField( &m_addTimestep, "AddTimeStep", false, "Show Time Step", "", "", "" );
CAF_PDM_InitField( &m_addAirGap, "AddAirGap", false, "Show Air Gap", "", "", "" );
CAF_PDM_InitField( &m_addWaterDepth, "AddWaterDepth", false, "Show Water Depth", "", "", "" );
}
//--------------------------------------------------------------------------------------------------

View File

@ -435,11 +435,21 @@ void RimWellLogRftCurve::onLoadDataAndUpdate( bool updateParentPlot )
measuredDepthVector = tvDepthVector;
}
this->setValuesWithTVD( values,
measuredDepthVector,
tvDepthVector,
RiaEclipseUnitTools::depthUnit( unitSystem ),
false );
RimProject* proj = RiaApplication::instance()->project();
RimWellPath* wellPath = proj->wellPathByName( m_wellName );
double rkbDiff = 0.0;
if ( wellPath )
{
rkbDiff = wellPath->wellPathGeometry()->rkbDiff();
}
this->setValuesWithMdAndTVD( values,
measuredDepthVector,
tvDepthVector,
rkbDiff,
RiaEclipseUnitTools::depthUnit( unitSystem ),
false );
RiaDefines::DepthUnitType displayUnit = RiaDefines::UNIT_METER;
if ( wellLogPlot )

View File

@ -795,7 +795,10 @@ QString RimWellLogTrack::asciiDataForPlotExport() const
else if ( depthType == RiaDefines::PSEUDO_LENGTH )
out += "PL ";
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
out += "TVD ";
out += "TVDMSL ";
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
out += "TVDRKB ";
for ( QString name : curveNames )
out += " \t" + name;
out += "\n";
@ -1925,8 +1928,9 @@ CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigEclipseWellLo
{
CurveSamplingPointData curveData;
curveData.md = extractor->cellIntersectionMDs();
curveData.tvd = extractor->cellIntersectionTVDs();
curveData.md = extractor->cellIntersectionMDs();
curveData.tvd = extractor->cellIntersectionTVDs();
curveData.rkbDiff = extractor->wellPathData()->rkbDiff();
extractor->curveData( resultAccessor, &curveData.data );
@ -1941,8 +1945,9 @@ CurveSamplingPointData RimWellLogTrack::curveSamplingPointData( RigGeoMechWellLo
{
CurveSamplingPointData curveData;
curveData.md = extractor->cellIntersectionMDs();
curveData.tvd = extractor->cellIntersectionTVDs();
curveData.md = extractor->cellIntersectionMDs();
curveData.tvd = extractor->cellIntersectionTVDs();
curveData.rkbDiff = extractor->wellPathData()->rkbDiff();
extractor->curveData( resultAddress, 0, &curveData.data );
return curveData;
@ -1981,9 +1986,16 @@ void RimWellLogTrack::findRegionNamesToPlot( const CurveSamplingPointData&
{
depthVector = curveData.md;
}
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
else if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH || depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
depthVector = curveData.tvd;
if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
for ( double& depthValue : depthVector )
{
depthValue += curveData.rkbDiff;
}
}
}
if ( depthVector.empty() ) return;
@ -2171,7 +2183,8 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
{
if ( m_formationWellPathForSourceWellPath == nullptr ) return;
if ( !( plot->depthType() == RiaDefines::MEASURED_DEPTH || plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH ) )
if ( !( plot->depthType() == RiaDefines::MEASURED_DEPTH || plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH ||
plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB ) )
{
return;
}
@ -2187,6 +2200,14 @@ void RimWellLogTrack::updateFormationNamesOnPlot()
m_showformationFluids(),
plot->depthType() );
if ( plot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
for ( double& depthValue : yValues )
{
depthValue += m_formationWellPathForSourceWellPath->wellPathGeometry()->rkbDiff();
}
}
m_annotationTool->attachWellPicks( m_plotWidget, formationNamesToPlot, yValues );
}
}

View File

@ -61,6 +61,8 @@ struct CurveSamplingPointData
std::vector<double> data;
std::vector<double> md;
std::vector<double> tvd;
double rkbDiff;
};
//==================================================================================================

View File

@ -110,12 +110,6 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
if ( values.size() == measuredDepthValues.size() )
{
this->setValuesAndDepths( values,
measuredDepthValues,
RiaDefines::MEASURED_DEPTH,
RiaDefines::UNIT_METER,
false );
RigWellPath* rigWellPath = m_wellPath->wellPathGeometry();
if ( rigWellPath )
{
@ -129,6 +123,16 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
this->setValuesAndDepths( values,
measuredDepthValues,
RiaDefines::TRUE_VERTICAL_DEPTH,
rigWellPath->rkbDiff(),
RiaDefines::UNIT_METER,
false );
}
else
{
this->setValuesAndDepths( values,
measuredDepthValues,
RiaDefines::MEASURED_DEPTH,
0.0,
RiaDefines::UNIT_METER,
false );
}
@ -148,22 +152,16 @@ void RimWellMeasurementCurve::onLoadDataAndUpdate( bool updateParentPlot )
{
displayUnit = wellLogPlot->depthUnit();
}
if ( wellLogPlot && wellLogPlot->depthType() == RiaDefines::TRUE_VERTICAL_DEPTH &&
this->curveData()->availableDepthTypes().count( RiaDefines::TRUE_VERTICAL_DEPTH ) )
RiaDefines::DepthTypeEnum depthType = RiaDefines::MEASURED_DEPTH;
if ( wellLogPlot && this->curveData()->availableDepthTypes().count( wellLogPlot->depthType() ) )
{
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
this->curveData()
->depthPlotValues( RiaDefines::TRUE_VERTICAL_DEPTH, displayUnit )
.data(),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
}
else
{
m_qwtPlotCurve
->setSamples( this->curveData()->xPlotValues().data(),
this->curveData()->depthPlotValues( RiaDefines::MEASURED_DEPTH, displayUnit ).data(),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
depthType = wellLogPlot->depthType();
}
m_qwtPlotCurve->setSamples( this->curveData()->xPlotValues().data(),
this->curveData()->depthPlotValues( depthType, displayUnit ).data(),
static_cast<int>( this->curveData()->xPlotValues().size() ) );
m_qwtPlotCurve->setLineSegmentStartStopIndices( this->curveData()->polylineStartStopIndices() );
}

View File

@ -98,7 +98,7 @@ void RigGeoMechWellLogExtractor::performCurveDataSmoothing( int
double trueVerticalDepth = -centroid.z();
double effectiveDepthMeters = trueVerticalDepth + m_rkbDiff;
double effectiveDepthMeters = trueVerticalDepth + wellPathData()->rkbDiff();
double hydroStaticPorePressureBar = pascalToBar( effectiveDepthMeters * UNIT_WEIGHT_OF_WATER );
interfaceShValuesDbl[i] = interfaceShValues[i] / hydroStaticPorePressureBar;
interfacePorePressuresDbl[i] = interfacePorePressures[i];
@ -691,14 +691,6 @@ const RigGeoMechCaseData* RigGeoMechWellLogExtractor::caseData()
return m_caseData.p();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigGeoMechWellLogExtractor::setRkbDiff( double rkbDiff )
{
m_rkbDiff = rkbDiff;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -1408,7 +1400,7 @@ double RigGeoMechWellLogExtractor::hydroStaticPorePressureForSegment( size_t int
{
cvf::Vec3f centroid = cellCentroid( intersectionIdx );
double trueVerticalDepth = -centroid.z();
double effectiveDepthMeters = trueVerticalDepth + m_rkbDiff;
double effectiveDepthMeters = trueVerticalDepth + wellPathData()->rkbDiff();
double hydroStaticPorePressurePascal = effectiveDepthMeters * UNIT_WEIGHT_OF_WATER;
double hydroStaticPorePressureBar = pascalToBar( hydroStaticPorePressurePascal );
return hydroStaticPorePressureBar;

View File

@ -67,7 +67,6 @@ public:
void curveData( const RigFemResultAddress& resAddr, int frameIndex, std::vector<double>* values );
const RigGeoMechCaseData* caseData();
void setRkbDiff( double rkbDiff );
void setWbsLasValues( const RigWbsParameter& parameter, const std::vector<std::pair<double, double>>& values );
void setWbsParametersSource( RigWbsParameter parameter, WbsParameterSource source );
@ -160,7 +159,6 @@ private:
private:
cvf::ref<RigGeoMechCaseData> m_caseData;
double m_rkbDiff;
std::map<RigWbsParameter, std::vector<std::pair<double, double>>> m_lasFileValues;

View File

@ -20,9 +20,11 @@
#include "RiaDefines.h"
#include "RigWellLogCurveData.h"
#include "RigWellPath.h"
#include "RimCase.h"
#include "RimWellLogCurve.h"
#include "RimWellLogExtractionCurve.h"
#include "RimWellPath.h"
#include "cafUtils.h"
@ -588,9 +590,9 @@ QString RigLasFileExporter::caseNameFromCurve( RimWellLogCurve* curve )
double RigLasFileExporter::rkbDiff( RimWellLogCurve* curve )
{
RimWellLogExtractionCurve* extractionCurve = dynamic_cast<RimWellLogExtractionCurve*>( curve );
if ( extractionCurve )
if ( extractionCurve && extractionCurve->wellPath() )
{
return extractionCurve->rkbDiff();
return extractionCurve->wellPath()->wellPathGeometry()->rkbDiff();
}
return HUGE_VAL;

View File

@ -48,6 +48,7 @@ RigWellLogCurveData::~RigWellLogCurveData() {}
void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
{
@ -56,6 +57,7 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues
m_xValues = xValues;
m_depths[depthType] = depths;
m_depthUnit = depthUnit;
m_rkbDiff = rkbDiff;
// Disable depth value filtering is intended to be used for
// extraction curve data
@ -69,6 +71,7 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues
//--------------------------------------------------------------------------------------------------
void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>& xValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve )
{
@ -80,6 +83,7 @@ void RigWellLogCurveData::setValuesAndDepths( const std::vector<double>&
m_xValues = xValues;
m_depths = depths;
m_depthUnit = depthUnit;
m_rkbDiff = rkbDiff;
// Disable depth value filtering is intended to be used for
// extraction curve data
@ -101,8 +105,20 @@ const std::vector<double>& RigWellLogCurveData::xValues() const
//--------------------------------------------------------------------------------------------------
std::vector<double> RigWellLogCurveData::depths( RiaDefines::DepthTypeEnum depthType ) const
{
auto it = m_depths.find( depthType );
return it != m_depths.end() ? it->second : std::vector<double>();
if ( depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB && m_rkbDiff != 0.0 )
{
std::vector<double> tvds = depths( RiaDefines::TRUE_VERTICAL_DEPTH );
for ( double& tvdValue : tvds )
{
tvdValue += m_rkbDiff;
}
return tvds;
}
else
{
auto it = m_depths.find( depthType );
return it != m_depths.end() ? it->second : std::vector<double>();
}
}
//--------------------------------------------------------------------------------------------------
@ -115,6 +131,10 @@ std::set<RiaDefines::DepthTypeEnum> RigWellLogCurveData::availableDepthTypes() c
for ( auto depthValuePair : m_depths )
{
depthTypes.insert( depthValuePair.first );
if ( depthValuePair.first == RiaDefines::TRUE_VERTICAL_DEPTH && m_rkbDiff != 0.0 )
{
depthTypes.insert( RiaDefines::TRUE_VERTICAL_DEPTH_RKB );
}
}
return depthTypes;
}
@ -171,13 +191,14 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
std::vector<double> xValues;
std::vector<double> measuredDepths;
bool isTvDepthsAvailable = false;
bool isTVDAvailable = false;
bool isTVDRKBAvailable = false;
std::vector<double> tvDepths;
auto mdIt = m_depths.find( RiaDefines::MEASURED_DEPTH );
auto tvdIt = m_depths.find( RiaDefines::TRUE_VERTICAL_DEPTH );
if ( tvdIt != m_depths.end() && !tvdIt->second.empty() ) isTvDepthsAvailable = true;
if ( tvdIt != m_depths.end() && !tvdIt->second.empty() ) isTVDAvailable = true;
if ( mdIt != m_depths.end() && !mdIt->second.empty() )
{
@ -193,7 +214,7 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
double segmentStartTvd = 0.0;
double segmentEndTvd = 0.0;
if ( isTvDepthsAvailable )
if ( isTVDAvailable )
{
segmentStartTvd = tvdIt->second[segmentStartIdx];
segmentEndTvd = tvdIt->second[segmentStartIdx + 1];
@ -208,7 +229,7 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
// The tvd calculation is a simplification. We should use the wellpath, as it might have a better
// resolution, and have a none-linear shape This is much simpler, and possibly accurate enough ?
if ( isTvDepthsAvailable )
if ( isTVDAvailable )
{
tvDepths.push_back( ( 1.0 - endWeight ) * segmentStartTvd + endWeight * segmentEndTvd );
}
@ -222,17 +243,18 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
cvf::ref<RigWellLogCurveData> reSampledData = new RigWellLogCurveData;
if ( isTvDepthsAvailable )
if ( isTVDAvailable )
{
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths =
{{RiaDefines::TRUE_VERTICAL_DEPTH, tvDepths}, {RiaDefines::MEASURED_DEPTH, measuredDepths}};
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_depthUnit, true );
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true );
}
else
{
reSampledData->setValuesAndDepths( xValues,
measuredDepths,
RiaDefines::MEASURED_DEPTH,
0.0,
m_depthUnit,
m_isExtractionCurve );
}

View File

@ -41,10 +41,12 @@ public:
void setValuesAndDepths( const std::vector<double>& xValues,
const std::vector<double>& depths,
RiaDefines::DepthTypeEnum depthType,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );
void setValuesAndDepths( const std::vector<double>& xValues,
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& depths,
double rkbDiff,
RiaDefines::DepthUnitType depthUnit,
bool isExtractionCurve );
@ -86,6 +88,7 @@ private:
std::vector<double> m_xValues;
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> m_depths;
bool m_isExtractionCurve;
double m_rkbDiff;
std::vector<std::pair<size_t, size_t>> m_intervalsOfContinousValidValues;

View File

@ -96,7 +96,7 @@ const std::vector<size_t>& RigWellLogExtractor::intersectedCellsGlobIdx()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
const RigWellPath* RigWellLogExtractor::wellPathData()
const RigWellPath* RigWellLogExtractor::wellPathData() const
{
return m_wellPath.p();
}

View File

@ -62,7 +62,7 @@ public:
const std::vector<double>& cellIntersectionTVDs();
const std::vector<size_t>& intersectedCellsGlobIdx();
const RigWellPath* wellPathData();
const RigWellPath* wellPathData() const;
std::vector<WellPathCellIntersectionInfo> cellIntersectionInfosAlongWellPath() const;

View File

@ -333,12 +333,17 @@ std::pair<double, double> RiuWellPathComponentPlotItem::depthsOfDepthType() cons
double startDepth = m_startMD;
double endDepth = m_endMD;
if ( m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH )
if ( m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH || m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
cvf::Vec3d startPoint = m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_startMD );
cvf::Vec3d endPoint = m_wellPath->wellPathGeometry()->interpolatedPointAlongWellPath( m_endMD );
startDepth = -startPoint.z();
endDepth = -endPoint.z();
if ( m_depthType == RiaDefines::TRUE_VERTICAL_DEPTH_RKB )
{
startDepth += m_wellPath->wellPathGeometry()->rkbDiff();
endDepth += m_wellPath->wellPathGeometry()->rkbDiff();
}
}
return std::make_pair( startDepth, endDepth );
}