mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Fault reactivation: Fix temperature extraction.
This commit is contained in:
@@ -111,6 +111,15 @@ double RimFaultReactivationDataAccessorTemperature::valueAtPosition( const cvf::
|
||||
|
||||
auto [value, pos] =
|
||||
RimFaultReactivationDataAccessorWellLogExtraction::calculateTemperature( intersections, values, position, m_seabedTemperature );
|
||||
if ( pos.isUndefined() )
|
||||
{
|
||||
auto cellIdx = m_mainGrid->findReservoirCellIndexFromPoint( position );
|
||||
if ( cellIdx != cvf::UNDEFINED_SIZE_T )
|
||||
{
|
||||
double tempFromEclipse = m_resultAccessor->cellScalar( cellIdx );
|
||||
if ( !std::isinf( tempFromEclipse ) ) return tempFromEclipse;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "RimGeoMechCase.h"
|
||||
#include "RimWellIADataAccess.h"
|
||||
|
||||
#include "cvfGeometryTools.h"
|
||||
#include "cvfVector3.h"
|
||||
|
||||
#include <cmath>
|
||||
@@ -83,7 +84,17 @@ std::pair<double, cvf::Vec3d>
|
||||
{
|
||||
// Fill in missing values
|
||||
fillInMissingValuesWithTopValue( intersections, values, seabedTemperature );
|
||||
return findValueAndPosition( intersections, values, position );
|
||||
auto [value, extractionPosition] = findValueAndPosition( intersections, values, position );
|
||||
|
||||
double minDistance = computeMinimumDistance( position, intersections );
|
||||
if ( minDistance < 1.0 )
|
||||
{
|
||||
return { value, extractionPosition };
|
||||
}
|
||||
else
|
||||
{
|
||||
return { value, cvf::Vec3d::UNDEFINED };
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -397,3 +408,22 @@ void RimFaultReactivationDataAccessorWellLogExtraction::insertOverburdenValues(
|
||||
values[i] = computeValueWithGradient( intersections, values, i, lastOverburdenIndex, -overburdenGradient );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFaultReactivationDataAccessorWellLogExtraction::computeMinimumDistance( const cvf::Vec3d& position,
|
||||
const std::vector<cvf::Vec3d>& positions )
|
||||
{
|
||||
double minDistance = std::numeric_limits<double>::max();
|
||||
for ( size_t i = 1; i < positions.size(); i++ )
|
||||
{
|
||||
cvf::Vec3d point1 = positions[i - 1];
|
||||
cvf::Vec3d point2 = positions[i - 0];
|
||||
|
||||
double candidateDistance = cvf::GeometryTools::linePointSquareDist( point1, point2, position );
|
||||
minDistance = std::min( candidateDistance, minDistance );
|
||||
}
|
||||
|
||||
return std::sqrt( minDistance );
|
||||
}
|
||||
|
||||
@@ -80,12 +80,13 @@ protected:
|
||||
static double computeGradient( double depth1, double value1, double depth2, double value2 );
|
||||
static std::vector<double> extractDepthValues( const std::vector<cvf::Vec3d>& intersections );
|
||||
|
||||
static void insertUnderburdenValues( const std::vector<cvf::Vec3d>& intersections,
|
||||
std::vector<double>& values,
|
||||
int firstUnderburdenIndex,
|
||||
double bottomValue );
|
||||
static void insertOverburdenValues( const std::vector<cvf::Vec3d>& intersections,
|
||||
std::vector<double>& values,
|
||||
int lastOverburdenIndex,
|
||||
double topValue );
|
||||
static void insertUnderburdenValues( const std::vector<cvf::Vec3d>& intersections,
|
||||
std::vector<double>& values,
|
||||
int firstUnderburdenIndex,
|
||||
double bottomValue );
|
||||
static void insertOverburdenValues( const std::vector<cvf::Vec3d>& intersections,
|
||||
std::vector<double>& values,
|
||||
int lastOverburdenIndex,
|
||||
double topValue );
|
||||
static double computeMinimumDistance( const cvf::Vec3d& position, const std::vector<cvf::Vec3d>& positions );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user