From e8e376ddb9e946a4e65b06c1d662084629e34929 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 31 Jan 2024 22:44:10 +0100 Subject: [PATCH] Fault reactivation: use values from Eclipse grid for stress. No longer snapping to the fake well path along the border between the parts. --- ...tReactivationDataAccessorStressEclipse.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorStressEclipse.cpp b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorStressEclipse.cpp index 10aa41b8b8..9d6d608ec0 100644 --- a/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorStressEclipse.cpp +++ b/ApplicationLibCode/ProjectDataModel/Faults/RimFaultReactivationDataAccessorStressEclipse.cpp @@ -28,6 +28,7 @@ #include "RigEclipseWellLogExtractor.h" #include "RigFaultReactivationModel.h" #include "RigGriddedPart3d.h" +#include "RigMainGrid.h" #include "RigResultAccessorFactory.h" #include "RigWellPath.h" @@ -176,7 +177,7 @@ bool RimFaultReactivationDataAccessorStressEclipse::isPositionValid( const cvf:: RimFaultReactivation::GridPart gridPart ) const { auto [porBar, extractionPosition] = calculatePorBar( position, m_gradient, gridPart ); - return !std::isinf( porBar ) && extractionPosition != cvf::Vec3d::UNDEFINED; + return !std::isinf( porBar ); } //-------------------------------------------------------------------------------------------------- @@ -197,8 +198,20 @@ std::pair RimFaultReactivationDataAccessorStressEclipse::cal auto [values, intersections] = RimFaultReactivationDataAccessorWellLogExtraction::extractValuesAndIntersections( *m_resultAccessor.p(), *extractor.p(), *wellPath ); - auto [value, pos] = RimFaultReactivationDataAccessorWellLogExtraction::calculatePorBar( intersections, values, position, m_gradient ); - return { value, pos }; + auto [value, extractionPos] = + RimFaultReactivationDataAccessorWellLogExtraction::calculatePorBar( intersections, values, position, m_gradient ); + if ( extractionPos.isUndefined() ) + { + auto cellIdx = m_mainGrid->findReservoirCellIndexFromPoint( position ); + if ( cellIdx != cvf::UNDEFINED_SIZE_T ) + { + double valueFromEclipse = m_resultAccessor->cellScalar( cellIdx ); + if ( !std::isinf( valueFromEclipse ) ) return { valueFromEclipse, position }; + } + return { value, position }; + } + + return { value, extractionPos }; } return { std::numeric_limits::infinity(), cvf::Vec3d::UNDEFINED };