2019-09-05 05:24:45 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2019- Equinor ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#include "RimWellBoreStabilityPlot.h"
|
|
|
|
|
|
|
|
#include "RigFemPartResultsCollection.h"
|
|
|
|
#include "RigFemResultAddress.h"
|
|
|
|
#include "RigGeoMechCaseData.h"
|
|
|
|
|
|
|
|
#include "RimGeoMechCase.h"
|
|
|
|
#include "RimTools.h"
|
|
|
|
#include "RimWellLogCurveCommonDataSource.h"
|
|
|
|
#include "RimWellLogFile.h"
|
|
|
|
|
|
|
|
#include "cafPdmBase.h"
|
|
|
|
#include "cafPdmObject.h"
|
2019-11-06 03:07:56 -06:00
|
|
|
#include "cafPdmUiComboBoxEditor.h"
|
2019-09-05 05:24:45 -05:00
|
|
|
#include "cafPdmUiGroup.h"
|
|
|
|
|
2019-09-13 09:51:21 -05:00
|
|
|
CAF_PDM_SOURCE_INIT( RimWellBoreStabilityPlot, "WellBoreStabilityPlot" );
|
2019-09-05 05:24:45 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimWellBoreStabilityPlot::RimWellBoreStabilityPlot()
|
|
|
|
{
|
2019-09-13 09:51:21 -05:00
|
|
|
CAF_PDM_InitObject( "Well Bore Stability Plot", ":/WellLogPlot16x16.png", "", "" );
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_porePressureSource,
|
|
|
|
"PorePressureSource",
|
|
|
|
"Pore Pressure",
|
|
|
|
"",
|
|
|
|
"Data source for Pore Pressure",
|
|
|
|
"" );
|
2019-11-06 03:07:56 -06:00
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_porePressureShaleSource,
|
|
|
|
"PorePressureShaleSource",
|
|
|
|
"Shale Pore Pressure",
|
|
|
|
"",
|
|
|
|
"Data source for Pore Pressure in Shale",
|
|
|
|
"" );
|
|
|
|
|
2019-09-13 09:51:21 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_poissonRatioSource,
|
|
|
|
"PoissionRatioSource",
|
|
|
|
"Poisson Ratio",
|
|
|
|
"",
|
|
|
|
"Data source for Poisson Ratio",
|
|
|
|
"" );
|
2019-11-06 03:07:56 -06:00
|
|
|
|
2019-09-13 09:51:21 -05:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_ucsSource, "UcsSource", "Uniaxial Compressive Strength", "", "Data source for UCS", "" );
|
|
|
|
|
2019-11-06 03:07:56 -06:00
|
|
|
CAF_PDM_InitFieldNoDefault( &m_OBG0Source, "OBG0Source", "Initial Overburden Gradient", "", "Data source for OBG0", "" );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_DFSource, "DFSource", "Depletion Factor (DF)", "", "Data source for Depletion Factor", "" );
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_K0SHSource,
|
|
|
|
"K0SHSource",
|
|
|
|
"K0_SH",
|
|
|
|
"",
|
|
|
|
"SH in Shale (Matthews & Kelly) = K0_SH * (OBG0-PP0) + PP0 + DF * (PP-PP0)\nK0_SH = "
|
|
|
|
"(SH - PP)/(OBG-PP)",
|
|
|
|
"" );
|
|
|
|
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_FGShaleSource, "FGShaleSource", "FG in Shale Calculation", "", "", "" );
|
|
|
|
CAF_PDM_InitFieldNoDefault( &m_K0FGSource,
|
|
|
|
"K0FGSource",
|
|
|
|
"K0_FG",
|
|
|
|
"",
|
|
|
|
"FG in shale = K0_FG * (OBG0-PP0)\nK0_FG = (FG-PP)/(OBG-PP)",
|
|
|
|
"" );
|
|
|
|
|
2020-01-08 03:31:01 -06:00
|
|
|
CAF_PDM_InitField( &m_userDefinedPPShale, "UserPPShale", 1.05, "Multiplier of hydrostatic PP", "", "", "" );
|
2019-11-06 03:07:56 -06:00
|
|
|
|
2019-09-30 08:34:47 -05:00
|
|
|
CAF_PDM_InitField( &m_userDefinedPoissionRatio,
|
|
|
|
"UserPoissionRatio",
|
2019-11-06 03:07:56 -06:00
|
|
|
0.35,
|
|
|
|
"User Defined Poisson Ratio",
|
2019-09-30 08:34:47 -05:00
|
|
|
"",
|
2019-11-06 03:07:56 -06:00
|
|
|
"User Defined Poisson Ratio",
|
2019-09-30 08:34:47 -05:00
|
|
|
"" );
|
2019-09-05 05:24:45 -05:00
|
|
|
// Typical UCS: http://ceae.colorado.edu/~amadei/CVEN5768/PDF/NOTES8.pdf
|
|
|
|
// Typical UCS for Shale is 5 - 100 MPa -> 50 - 1000 bar.
|
2019-11-06 03:07:56 -06:00
|
|
|
CAF_PDM_InitField( &m_userDefinedUcs, "UserUcs", 100.0, "User Defined UCS [bar]", "", "User Defined UCS [bar]", "" );
|
|
|
|
|
|
|
|
// TODO: Get reasonable defaults from Lasse. For now all set to 1
|
|
|
|
CAF_PDM_InitField( &m_userDefinedDF, "UserDF", 0.7, "User Defined DF", "", "User Defined Depletion Factor", "" );
|
|
|
|
CAF_PDM_InitField( &m_userDefinedK0FG, "UserK0FG", 0.75, "User Defined K0_FG", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_userDefinedK0SH, "UserK0SH", 0.65, "User Defined K0_SH", "", "", "" );
|
|
|
|
CAF_PDM_InitField( &m_FGShaleMultiplier,
|
|
|
|
"FGMultiplier",
|
|
|
|
1.05,
|
|
|
|
"SH Multiplier for FG in Shale",
|
|
|
|
"",
|
|
|
|
"FG in Shale = Multiplier * SH",
|
|
|
|
"" );
|
2019-09-05 05:24:45 -05:00
|
|
|
|
2019-11-06 03:07:56 -06:00
|
|
|
m_parameterSourceFields = {{RigWbsParameter::PP_Sand(), &m_porePressureSource},
|
|
|
|
{RigWbsParameter::PP_Shale(), &m_porePressureShaleSource},
|
|
|
|
{RigWbsParameter::poissonRatio(), &m_poissonRatioSource},
|
|
|
|
{RigWbsParameter::UCS(), &m_ucsSource},
|
|
|
|
{RigWbsParameter::OBG0(), &m_OBG0Source},
|
|
|
|
{RigWbsParameter::DF(), &m_DFSource},
|
|
|
|
{RigWbsParameter::K0_FG(), &m_K0FGSource},
|
|
|
|
{RigWbsParameter::K0_SH(), &m_K0SHSource},
|
|
|
|
{RigWbsParameter::FG_Shale(), &m_FGShaleSource}};
|
|
|
|
|
|
|
|
m_userDefinedValueFields = {{RigWbsParameter::PP_Shale(), &m_userDefinedPPShale},
|
|
|
|
{RigWbsParameter::poissonRatio(), &m_userDefinedPoissionRatio},
|
|
|
|
{RigWbsParameter::UCS(), &m_userDefinedUcs},
|
|
|
|
{RigWbsParameter::DF(), &m_userDefinedDF},
|
|
|
|
{RigWbsParameter::K0_FG(), &m_userDefinedK0FG},
|
|
|
|
{RigWbsParameter::K0_SH(), &m_userDefinedK0SH},
|
|
|
|
{RigWbsParameter::FG_Shale(), &m_FGShaleMultiplier}};
|
|
|
|
|
|
|
|
for ( auto parameterFieldPair : m_parameterSourceFields )
|
|
|
|
{
|
|
|
|
auto sources = parameterFieldPair.first.sources();
|
|
|
|
if ( !sources.empty() )
|
|
|
|
{
|
|
|
|
setParameterSource( parameterFieldPair.first, sources.front() );
|
|
|
|
}
|
|
|
|
}
|
2019-11-26 01:45:17 -06:00
|
|
|
|
|
|
|
m_nameConfig->setCustomName( "Well Bore Stability" );
|
|
|
|
m_nameConfig->enableAllAutoNameTags( true );
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-06 03:07:56 -06:00
|
|
|
void RimWellBoreStabilityPlot::applyWbsParametersToExtractor( RigGeoMechWellLogExtractor* extractor )
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
for ( auto parameterSourcePair : m_parameterSourceFields )
|
|
|
|
{
|
|
|
|
extractor->setWbsParametersSource( parameterSourcePair.first, ( *parameterSourcePair.second )() );
|
|
|
|
}
|
|
|
|
for ( auto parameterUserDefinedValuePair : m_userDefinedValueFields )
|
|
|
|
{
|
|
|
|
extractor->setWbsUserDefinedValue( parameterUserDefinedValuePair.first,
|
|
|
|
( *parameterUserDefinedValuePair.second ) );
|
|
|
|
}
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-06 03:07:56 -06:00
|
|
|
RimWellBoreStabilityPlot::ParameterSource RimWellBoreStabilityPlot::parameterSource( const RigWbsParameter& parameter ) const
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
auto field = sourceField( parameter );
|
|
|
|
if ( field )
|
|
|
|
{
|
|
|
|
return ( *field )();
|
|
|
|
}
|
|
|
|
return RigWbsParameter::INVALID;
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-06 03:07:56 -06:00
|
|
|
double RimWellBoreStabilityPlot::userDefinedValue( const RigWbsParameter& parameter ) const
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
auto it = m_userDefinedValueFields.find( parameter );
|
|
|
|
if ( it != m_userDefinedValueFields.end() )
|
|
|
|
{
|
|
|
|
return *it->second;
|
|
|
|
}
|
|
|
|
return std::numeric_limits<double>::infinity();
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-06 03:07:56 -06:00
|
|
|
void RimWellBoreStabilityPlot::setParameterSource( const RigWbsParameter& parameter, ParameterSource source )
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
auto field = sourceField( parameter );
|
|
|
|
if ( field )
|
|
|
|
{
|
|
|
|
*field = source;
|
|
|
|
}
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-13 09:51:21 -05:00
|
|
|
void RimWellBoreStabilityPlot::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-10-11 08:54:19 -05:00
|
|
|
m_commonDataSource->uiOrdering( RimWellLogCurveCommonDataSource::smoothingUiOrderinglabel(), uiOrdering );
|
2019-09-25 04:59:31 -05:00
|
|
|
|
2019-09-13 09:51:21 -05:00
|
|
|
caf::PdmUiGroup* parameterSources = uiOrdering.addNewGroup( "Parameter Sources" );
|
|
|
|
parameterSources->add( &m_porePressureSource );
|
2019-11-06 03:07:56 -06:00
|
|
|
parameterSources->add( &m_porePressureShaleSource );
|
|
|
|
if ( m_porePressureShaleSource == RigWbsParameter::USER_DEFINED )
|
|
|
|
{
|
|
|
|
parameterSources->add( &m_userDefinedPPShale );
|
|
|
|
}
|
2019-09-13 09:51:21 -05:00
|
|
|
parameterSources->add( &m_poissonRatioSource );
|
2019-09-30 08:34:47 -05:00
|
|
|
parameterSources->add( &m_userDefinedPoissionRatio );
|
2019-09-13 09:51:21 -05:00
|
|
|
parameterSources->add( &m_ucsSource );
|
2019-09-30 08:34:47 -05:00
|
|
|
parameterSources->add( &m_userDefinedUcs );
|
2019-11-06 03:07:56 -06:00
|
|
|
parameterSources->add( &m_OBG0Source );
|
|
|
|
parameterSources->add( &m_DFSource );
|
|
|
|
parameterSources->add( &m_userDefinedDF );
|
|
|
|
parameterSources->add( &m_K0SHSource );
|
|
|
|
parameterSources->add( &m_userDefinedK0SH );
|
|
|
|
parameterSources->add( &m_FGShaleSource );
|
|
|
|
if ( m_FGShaleSource == RigWbsParameter::PROPORTIONAL_TO_SH )
|
|
|
|
{
|
|
|
|
parameterSources->add( &m_FGShaleMultiplier );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
parameterSources->add( &m_K0FGSource );
|
|
|
|
parameterSources->add( &m_userDefinedK0FG );
|
|
|
|
}
|
2019-09-25 04:59:31 -05:00
|
|
|
|
2020-01-08 03:31:01 -06:00
|
|
|
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 );
|
2019-09-25 04:59:31 -05:00
|
|
|
|
|
|
|
uiOrdering.skipRemainingFields( true );
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-13 09:51:21 -05:00
|
|
|
QList<caf::PdmOptionItemInfo>
|
|
|
|
RimWellBoreStabilityPlot::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly )
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-09-13 09:51:21 -05:00
|
|
|
QList<caf::PdmOptionItemInfo> options = RimWellLogPlot::calculateValueOptions( fieldNeedingOptions, useOptionsOnly );
|
2019-09-05 05:24:45 -05:00
|
|
|
|
2019-11-06 03:07:56 -06:00
|
|
|
std::set<RigWbsParameter> allParameters = RigWbsParameter::allParameters();
|
|
|
|
|
|
|
|
for ( const RigWbsParameter& parameter : allParameters )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
caf::PdmField<ParameterSourceEnum>* field = sourceField( parameter );
|
|
|
|
if ( field == fieldNeedingOptions )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
std::vector<ParameterSource> sources = supportedSources( parameter );
|
|
|
|
for ( int i = 0; i < (int)sources.size(); ++i )
|
|
|
|
{
|
2020-01-08 03:31:01 -06:00
|
|
|
if ( parameter.exclusiveOptions() || i == (int)sources.size() - 1 ||
|
|
|
|
sources[i] == RigWbsParameter::HYDROSTATIC )
|
2019-11-06 03:07:56 -06:00
|
|
|
{
|
|
|
|
options.push_back( caf::PdmOptionItemInfo( ParameterSourceEnum::uiText( sources[i] ), sources[i] ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
QStringList cumulativeSourceLabels;
|
|
|
|
for ( int j = i; j < (int)sources.size(); ++j )
|
|
|
|
{
|
|
|
|
int index = 1 + ( j - i );
|
|
|
|
cumulativeSourceLabels.push_back(
|
|
|
|
QString( "%1. %2" ).arg( index ).arg( ParameterSourceEnum::uiText( sources[j] ) ) );
|
|
|
|
}
|
|
|
|
options.push_back( caf::PdmOptionItemInfo( cumulativeSourceLabels.join( ", " ), sources[i] ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
2019-09-30 08:34:47 -05:00
|
|
|
}
|
|
|
|
}
|
2019-11-06 03:07:56 -06:00
|
|
|
|
2019-09-30 08:34:47 -05:00
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellBoreStabilityPlot::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
|
|
|
const QVariant& oldValue,
|
|
|
|
const QVariant& newValue )
|
|
|
|
{
|
|
|
|
RimWellLogPlot::fieldChangedByUi( changedField, oldValue, newValue );
|
|
|
|
|
2019-11-06 03:07:56 -06:00
|
|
|
if ( changedField == &m_porePressureSource || changedField == &m_porePressureShaleSource ||
|
|
|
|
changedField == &m_poissonRatioSource || changedField == &m_ucsSource || changedField == &m_OBG0Source ||
|
|
|
|
changedField == &m_DFSource || changedField == &m_K0FGSource || changedField == &m_K0SHSource ||
|
|
|
|
changedField == &m_FGShaleSource )
|
|
|
|
{
|
|
|
|
this->loadDataAndUpdate();
|
|
|
|
}
|
|
|
|
else if ( changedField == &m_userDefinedPPShale || changedField == &m_userDefinedPoissionRatio ||
|
|
|
|
changedField == &m_userDefinedUcs || changedField == &m_userDefinedDF ||
|
|
|
|
changedField == &m_userDefinedK0FG || changedField == &m_userDefinedK0SH ||
|
|
|
|
changedField == &m_FGShaleMultiplier )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
|
|
|
this->loadDataAndUpdate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-06 03:07:56 -06:00
|
|
|
void RimWellBoreStabilityPlot::assignValidSource( caf::PdmField<ParameterSourceEnum>* parameterSourceField,
|
|
|
|
const std::vector<ParameterSource>& validSources )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
CAF_ASSERT( parameterSourceField );
|
|
|
|
if ( std::find( validSources.begin(), validSources.end(), ( *parameterSourceField )() ) == validSources.end() )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
*parameterSourceField = validSources.front();
|
2019-09-30 08:34:47 -05:00
|
|
|
}
|
2019-11-06 03:07:56 -06:00
|
|
|
}
|
2019-09-30 08:34:47 -05:00
|
|
|
|
2019-11-06 03:07:56 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimWellBoreStabilityPlot::onLoadDataAndUpdate()
|
|
|
|
{
|
|
|
|
std::set<RigWbsParameter> allParameters = RigWbsParameter::allParameters();
|
2019-09-30 08:34:47 -05:00
|
|
|
|
2019-11-06 03:07:56 -06:00
|
|
|
for ( const RigWbsParameter& parameter : allParameters )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
caf::PdmField<ParameterSourceEnum>* field = sourceField( parameter );
|
|
|
|
if ( field )
|
|
|
|
{
|
|
|
|
assignValidSource( field, supportedSources( parameter ) );
|
|
|
|
}
|
2019-09-30 08:34:47 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
RimWellLogPlot::onLoadDataAndUpdate();
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellBoreStabilityPlot::hasLasFileWithChannel( const QString& channel ) const
|
|
|
|
{
|
|
|
|
RimWellPath* wellPath = m_commonDataSource->wellPathToApply();
|
|
|
|
if ( wellPath && !RimWellLogFile::findMdAndChannelValuesForWellPath( wellPath, channel ).empty() )
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
bool RimWellBoreStabilityPlot::hasElementPropertyEntry( const RigFemResultAddress& resAddr ) const
|
|
|
|
{
|
2019-09-05 05:24:45 -05:00
|
|
|
int timeStep = m_commonDataSource->timeStepToApply();
|
2019-09-30 08:34:47 -05:00
|
|
|
RimGeoMechCase* geoMechCase = dynamic_cast<RimGeoMechCase*>( m_commonDataSource->caseToApply() );
|
2019-09-05 05:24:45 -05:00
|
|
|
|
|
|
|
RigFemPartResultsCollection* femPartResults = nullptr;
|
2019-09-30 08:34:47 -05:00
|
|
|
if ( geoMechCase && timeStep > 0 )
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
|
|
|
femPartResults = geoMechCase->geoMechData()->femPartResults();
|
2019-09-30 08:34:47 -05:00
|
|
|
if ( femPartResults )
|
|
|
|
{
|
|
|
|
return !femPartResults->resultValues( resAddr, 0, timeStep ).empty();
|
|
|
|
}
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
2019-09-30 08:34:47 -05:00
|
|
|
return false;
|
|
|
|
}
|
2019-09-05 05:24:45 -05:00
|
|
|
|
2019-09-30 08:34:47 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-06 03:07:56 -06:00
|
|
|
caf::PdmField<RimWellBoreStabilityPlot::ParameterSourceEnum>*
|
|
|
|
RimWellBoreStabilityPlot::sourceField( const RigWbsParameter& parameter ) const
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
auto it = m_parameterSourceFields.find( parameter );
|
|
|
|
if ( it != m_parameterSourceFields.end() )
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
return it->second;
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
2019-11-06 03:07:56 -06:00
|
|
|
return nullptr;
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-11-06 03:07:56 -06:00
|
|
|
std::vector<RimWellBoreStabilityPlot::ParameterSource>
|
|
|
|
RimWellBoreStabilityPlot::supportedSources( const RigWbsParameter& parameter ) const
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
std::vector<RigGeoMechWellLogExtractor::WbsParameterSource> sources;
|
2019-09-05 05:24:45 -05:00
|
|
|
|
2019-11-06 03:07:56 -06:00
|
|
|
for ( auto source : parameter.sources() )
|
2019-09-05 05:24:45 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
if ( source == RigWbsParameter::LAS_FILE )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
if ( hasLasFileWithChannel( parameter.addressString( RigWbsParameter::LAS_FILE ) ) )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
sources.push_back( source );
|
2019-09-30 08:34:47 -05:00
|
|
|
}
|
|
|
|
}
|
2019-11-06 03:07:56 -06:00
|
|
|
else if ( source == RigWbsParameter::ELEMENT_PROPERTY_TABLE )
|
2019-09-30 08:34:47 -05:00
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
RigFemResultAddress resAddr = parameter.femAddress( RigWbsParameter::ELEMENT_PROPERTY_TABLE );
|
2019-09-30 08:34:47 -05:00
|
|
|
if ( hasElementPropertyEntry( resAddr ) )
|
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
sources.push_back( source );
|
2019-09-30 08:34:47 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-11-06 03:07:56 -06:00
|
|
|
sources.push_back( source );
|
2019-09-30 08:34:47 -05:00
|
|
|
}
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|
2019-09-30 08:34:47 -05:00
|
|
|
return sources;
|
2019-09-05 05:24:45 -05:00
|
|
|
}
|