Specify part id for well extraction from geomech data (#10240)

* Specify part id for well extraction from geomech data
* Make sure we clear curve data if there isn't any valid input data
This commit is contained in:
jonjenssen
2023-05-12 08:13:56 +02:00
committed by GitHub
parent 5ee764af48
commit 1d43e1a948
14 changed files with 129 additions and 60 deletions

View File

@@ -71,6 +71,7 @@ Rim3dWellLogExtractionCurve::Rim3dWellLogExtractionCurve()
m_case = nullptr;
CAF_PDM_InitField( &m_timeStep, "CurveTimeStep", -1, "Time Step" );
CAF_PDM_InitField( &m_geomPartId, "GeomPartId", 0, "Part Id" );
CAF_PDM_InitFieldNoDefault( &m_eclipseResultDefinition, "CurveEclipseResult", "" );
m_eclipseResultDefinition.uiCapability()->setUiTreeHidden( true );
@@ -208,7 +209,8 @@ void Rim3dWellLogExtractionCurve::curveValuesAndMdsAtTimeStep( std::vector<doubl
RimGeoMechCase* geomCase = dynamic_cast<RimGeoMechCase*>( m_case() );
if ( geomCase )
{
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor = RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, geomCase );
cvf::ref<RigGeoMechWellLogExtractor> geomExtractor =
RiaExtractionTools::findOrCreateWellLogExtractor( wellPath, geomCase, m_geomPartId );
if ( geomExtractor.notNull() )
{
@@ -439,7 +441,7 @@ void Rim3dWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* c
this->resetMinMaxValues();
this->updateConnectedEditors();
}
else if ( changedField == &m_timeStep )
else if ( ( changedField == &m_timeStep ) || ( changedField == &m_geomPartId ) )
{
this->resetMinMaxValues();
this->updateConnectedEditors();
@@ -491,6 +493,7 @@ void Rim3dWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::P
}
else if ( geomCase )
{
curveDataGroup->add( &m_geomPartId );
m_geomResultDefinition->uiOrdering( uiConfigName, *curveDataGroup );
}

View File

@@ -72,6 +72,7 @@ private:
private:
caf::PdmPtrField<RimCase*> m_case;
caf::PdmField<int> m_timeStep;
caf::PdmField<int> m_geomPartId;
caf::PdmChildField<RimEclipseResultDefinition*> m_eclipseResultDefinition;
caf::PdmChildField<RimGeoMechResultDefinition*> m_geomResultDefinition;

View File

@@ -131,6 +131,7 @@ RimWellLogExtractionCurve::RimWellLogExtractionCurve()
m_geomResultDefinition->setAddWellPathDerivedResults( true );
CAF_PDM_InitField( &m_timeStep, "CurveTimeStep", 0, "Time Step" );
CAF_PDM_InitField( &m_geomPartId, "GeomPartId", 0, "Part Id" );
// Add some space before name to indicate these belong to the Auto Name field
CAF_PDM_InitField( &m_addCaseNameToCurveName, "AddCaseNameToCurveName", true, " Case Name" );
@@ -308,30 +309,17 @@ void RimWellLogExtractionCurve::fieldChangedByUi( const caf::PdmFieldHandle* cha
if ( m_wellPath == m_refWellPath ) m_refWellPath = nullptr;
this->loadDataAndUpdate( true );
}
else if ( changedField == &m_refWellPath )
else if ( ( changedField == &m_refWellPath ) || ( changedField == &m_timeStep ) || ( changedField == &m_trajectoryType ) ||
( changedField == &m_geomPartId ) )
{
this->loadDataAndUpdate( true );
}
else if ( changedField == &m_simWellName )
else if ( ( changedField == &m_branchDetection ) || ( changedField == &m_branchIndex ) || ( changedField == &m_simWellName ) )
{
clearGeneratedSimWellPaths();
this->loadDataAndUpdate( true );
}
else if ( changedField == &m_trajectoryType )
{
this->loadDataAndUpdate( true );
}
else if ( changedField == &m_branchDetection || changedField == &m_branchIndex )
{
clearGeneratedSimWellPaths();
this->loadDataAndUpdate( true );
}
else if ( changedField == &m_timeStep )
{
this->loadDataAndUpdate( true );
}
if ( changedField == &m_addCaseNameToCurveName || changedField == &m_addPropertyToCurveName ||
changedField == &m_addWellNameToCurveName || changedField == &m_addTimestepToCurveName || changedField == &m_addDateToCurveName )
@@ -513,6 +501,10 @@ void RimWellLogExtractionCurve::extractData( bool* isUsin
curveData.xUnits );
}
}
else
{
clearCurveData();
}
}
//--------------------------------------------------------------------------------------------------
@@ -638,18 +630,26 @@ RimWellLogExtractionCurve::WellLogExtractionCurveData
if ( caseData && wellPathGeometry )
{
std::string errorIdName = ( m_wellPath->name() + " " + geoMechCase->caseUserDescription() ).toStdString();
wellExtractor = new RigGeoMechWellLogExtractor( caseData, wellPathGeometry, errorIdName );
wellExtractor = new RigGeoMechWellLogExtractor( caseData, m_geomPartId, wellPathGeometry, errorIdName );
// make sure the resampling of the well path is done before the extraction of the curve data
wellExtractor->resampleIntersections( maxDistanceBetweenCurvePoints.value() );
if ( wellExtractor->valid() )
{
// make sure the resampling of the well path is done before the extraction of the curve data
wellExtractor->resampleIntersections( maxDistanceBetweenCurvePoints.value() );
}
else
{
return curveData;
}
}
}
else
{
wellExtractor = wellLogCollection->findOrCreateExtractor( m_wellPath, geoMechCase );
wellExtractor = wellLogCollection->findOrCreateExtractor( m_wellPath, geoMechCase, m_geomPartId );
}
cvf::ref<RigGeoMechWellLogExtractor> refWellExtractor = wellLogCollection->findOrCreateExtractor( m_refWellPath, geoMechCase );
cvf::ref<RigGeoMechWellLogExtractor> refWellExtractor =
wellLogCollection->findOrCreateExtractor( m_refWellPath, geoMechCase, m_geomPartId );
auto [timeStepIdx, frameIdx] = geoMechCase->geoMechData()->femPartResults()->stepListIndexToTimeStepAndDataFrameIndex( m_timeStep );
@@ -1062,6 +1062,7 @@ void RimWellLogExtractionCurve::defineUiOrdering( QString uiConfigName, caf::Pdm
}
else if ( geomCase )
{
curveDataGroup->add( &m_geomPartId );
curveDataGroup->add( &m_wellPath );
curveDataGroup->add( &m_refWellPath );
RimWellLogCurve::defineUiOrdering( uiConfigName, uiOrdering );
@@ -1394,6 +1395,22 @@ void RimWellLogExtractionCurve::setGeoMechResultAddress( const RigFemResultAddre
m_geomResultDefinition->setResultAddress( resAddr );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimWellLogExtractionCurve::setGeoMechPart( int partId )
{
m_geomPartId = partId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
int RimWellLogExtractionCurve::geoMechPart() const
{
return m_geomPartId;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------

View File

@@ -87,6 +87,8 @@ public:
void setEclipseResultCategory( RiaDefines::ResultCatType catType );
void setGeoMechResultAddress( const RigFemResultAddress& resAddr );
void setGeoMechPart( int partId );
int geoMechPart() const;
void setTrajectoryType( TrajectoryType trajectoryType );
void setWellName( QString wellName );
@@ -136,6 +138,7 @@ protected:
caf::PdmChildField<RimEclipseResultDefinition*> m_eclipseResultDefinition;
caf::PdmChildField<RimGeoMechResultDefinition*> m_geomResultDefinition;
caf::PdmField<int> m_timeStep;
caf::PdmField<int> m_geomPartId;
caf::PdmField<bool> m_addCaseNameToCurveName;
caf::PdmField<bool> m_addPropertyToCurveName;

View File

@@ -114,7 +114,7 @@ RigEclipseWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( Rim
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RigGeoMechWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geoMechCase )
RigGeoMechWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int partId )
{
if ( !( wellPath && geoMechCase ) ) return nullptr;
@@ -124,17 +124,22 @@ RigGeoMechWellLogExtractor* RimWellLogPlotCollection::findOrCreateExtractor( Rim
for ( size_t exIdx = 0; exIdx < m_geomExtractors.size(); ++exIdx )
{
if ( m_geomExtractors[exIdx]->caseData() == caseData && m_geomExtractors[exIdx]->wellPathGeometry() == wellPathGeometry )
if ( ( m_geomExtractors[exIdx]->caseData() == caseData ) && ( m_geomExtractors[exIdx]->wellPathGeometry() == wellPathGeometry ) &&
( m_geomExtractors[exIdx]->partId() == partId ) )
{
return m_geomExtractors[exIdx].p();
}
}
std::string errorIdName = ( wellPath->name() + " " + geoMechCase->caseUserDescription() ).toStdString();
cvf::ref<RigGeoMechWellLogExtractor> extractor = new RigGeoMechWellLogExtractor( caseData, wellPathGeometry, errorIdName );
m_geomExtractors.push_back( extractor.p() );
cvf::ref<RigGeoMechWellLogExtractor> extractor = new RigGeoMechWellLogExtractor( caseData, partId, wellPathGeometry, errorIdName );
if ( extractor->valid() )
{
m_geomExtractors.push_back( extractor.p() );
return extractor.p();
}
return extractor.p();
return nullptr;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -56,7 +56,7 @@ public:
const RigEclipseCaseData* eclCaseData );
RigEclipseWellLogExtractor* findOrCreateExtractor( RimWellPath* wellPath, RimEclipseCase* eclCase );
RigGeoMechWellLogExtractor* findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geoMechCase );
RigGeoMechWellLogExtractor* findOrCreateExtractor( RimWellPath* wellPath, RimGeoMechCase* geoMechCase, int partId = 0 );
std::vector<RimWellLogPlot*> wellLogPlots() const;