Fracture Model Plot: Improve method for getting data from other curves when calculating stress.

This commit is contained in:
Kristian Bendiksen 2020-07-06 19:16:49 +02:00
parent 3b662904e2
commit 3819420d23
2 changed files with 29 additions and 23 deletions

View File

@ -152,20 +152,23 @@ void RimFractureModelPlot::calculateLayers( std::vector<std::pair<double, double
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
double RimFractureModelPlot::computeValueAtDepth( const std::vector<double>& values, double RimFractureModelPlot::findValueAtTopOfLayer( const std::vector<double>& values,
std::vector<std::pair<double, double>>& layerBoundaryDepths, const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
double depth ) size_t layerNo )
{ {
for ( size_t i = 0; i < layerBoundaryDepths.size(); i++ ) int index = layerBoundaryIndexes[layerNo].first;
{ return values.at( index );
if ( layerBoundaryDepths[i].first <= depth && layerBoundaryDepths[i].second >= depth )
{
return values[i];
}
} }
RiaLogging::error( QString( "Failed to compute value at depth: %1" ).arg( depth ) ); //--------------------------------------------------------------------------------------------------
return std::numeric_limits<double>::infinity(); ///
//--------------------------------------------------------------------------------------------------
double RimFractureModelPlot::findValueAtBottomOfLayer( const std::vector<double>& values,
const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
size_t layerNo )
{
int index = layerBoundaryIndexes[layerNo].second;
return values.at( index );
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@ -357,11 +360,11 @@ bool RimFractureModelPlot::calculateStressWithGradients( std::vector<double>& st
double depthBottomOfZone = layerBoundaryDepths[i].second; double depthBottomOfZone = layerBoundaryDepths[i].second;
// Data from curves at the top zone depth // Data from curves at the top zone depth
double k0 = computeValueAtDepth( k0Data, layerBoundaryDepths, depthTopOfZone ); double k0 = findValueAtTopOfLayer( k0Data, layerBoundaryIndexes, i );
double biot = computeValueAtDepth( biotData, layerBoundaryDepths, depthTopOfZone ); double biot = findValueAtTopOfLayer( biotData, layerBoundaryIndexes, i );
double poissonsRatio = computeValueAtDepth( poissonsRatioData, layerBoundaryDepths, depthTopOfZone ); double poissonsRatio = findValueAtTopOfLayer( poissonsRatioData, layerBoundaryIndexes, i );
double initialPressure = computeValueAtDepth( initialPressureData, layerBoundaryDepths, depthTopOfZone ); double initialPressure = findValueAtTopOfLayer( initialPressureData, layerBoundaryIndexes, i );
double timeStepPressure = computeValueAtDepth( timeStepPressureData, layerBoundaryDepths, depthTopOfZone ); double timeStepPressure = findValueAtTopOfLayer( timeStepPressureData, layerBoundaryIndexes, i );
// Vertical stress // Vertical stress
// Use difference between reference depth and depth of top of zone // Use difference between reference depth and depth of top of zone
@ -387,8 +390,8 @@ bool RimFractureModelPlot::calculateStressWithGradients( std::vector<double>& st
if ( i == layerBoundaryDepths.size() - 1 ) if ( i == layerBoundaryDepths.size() - 1 )
{ {
// Use the bottom of the last layer to compute gradient for last layer // Use the bottom of the last layer to compute gradient for last layer
double bottomInitialPressure = double bottomInitialPressure = findValueAtBottomOfLayer( initialPressureData, layerBoundaryIndexes, i );
computeValueAtDepth( initialPressureData, layerBoundaryDepths, depthBottomOfZone );
double bottomDepthDiff = depthBottomOfZone - stressDepthRef; double bottomDepthDiff = depthBottomOfZone - stressDepthRef;
double bottomSv = verticalStressRef + verticalStressGradientRef * bottomDepthDiff; double bottomSv = verticalStressRef + verticalStressGradientRef * bottomDepthDiff;
stressForGradients.push_back( bottomSv ); stressForGradients.push_back( bottomSv );
@ -407,7 +410,7 @@ bool RimFractureModelPlot::calculateStressWithGradients( std::vector<double>& st
double diffStress = stressForGradients[i + 1] - stressForGradients[i]; double diffStress = stressForGradients[i + 1] - stressForGradients[i];
double diffPressure = pressureForGradients[i + 1] - pressureForGradients[i]; double diffPressure = pressureForGradients[i + 1] - pressureForGradients[i];
double diffDepth = depthForGradients[i + 1] - depthForGradients[i]; double diffDepth = depthForGradients[i + 1] - depthForGradients[i];
double k0 = computeValueAtDepth( k0Data, layerBoundaryDepths, depthForGradients[i] ); double k0 = findValueAtTopOfLayer( k0Data, layerBoundaryIndexes, i );
double gradient = ( diffStress * k0 + diffPressure * ( 1.0 - k0 ) ) / diffDepth; double gradient = ( diffStress * k0 + diffPressure * ( 1.0 - k0 ) ) / diffDepth;
stressGradients.push_back( RiaEclipseUnitTools::barPerMeterToPsiPerFeet( gradient ) ); stressGradients.push_back( RiaEclipseUnitTools::barPerMeterToPsiPerFeet( gradient ) );
} }

View File

@ -84,9 +84,12 @@ protected:
RimWellLogExtractionCurve* findCurveByProperty( RiaDefines::CurveProperty curveProperty ) const; RimWellLogExtractionCurve* findCurveByProperty( RiaDefines::CurveProperty curveProperty ) const;
bool calculateStressWithGradients( std::vector<double>& stress, std::vector<double>& stressGradients ) const; bool calculateStressWithGradients( std::vector<double>& stress, std::vector<double>& stressGradients ) const;
static double computeValueAtDepth( const std::vector<double>& values, static double findValueAtTopOfLayer( const std::vector<double>& values,
std::vector<std::pair<double, double>>& layerBoundaryDepths, const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
double depth ); size_t layerNo );
static double findValueAtBottomOfLayer( const std::vector<double>& values,
const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
size_t layerNo );
static void computeAverageByLayer( const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes, static void computeAverageByLayer( const std::vector<std::pair<size_t, size_t>>& layerBoundaryIndexes,
const std::vector<double>& inputVector, const std::vector<double>& inputVector,
std::vector<double>& result ); std::vector<double>& result );