#6854 Fix asserts/crashes when layer extraction fails.

This commit is contained in:
Kristian Bendiksen 2020-10-28 13:33:56 +01:00
parent 935a2d11d7
commit 3e291e0c6b
4 changed files with 62 additions and 13 deletions

View File

@ -102,9 +102,19 @@ bool RimFractureModelElasticPropertyCalculator::calculate( RiaDefines::CurveProp
return false;
}
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(),
fractureModel->thicknessDirectionWellPath()->wellPathGeometry(),
"fracture model" );
if ( !fractureModel->thicknessDirectionWellPath() )
{
return false;
}
RigWellPath* wellPathGeometry = fractureModel->thicknessDirectionWellPath()->wellPathGeometry();
if ( !wellPathGeometry )
{
RiaLogging::error( "No well path geometry found for layer data exctration." );
return false;
}
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), wellPathGeometry, "fracture model" );
measuredDepthValues = eclExtractor.cellIntersectionMDs();
tvDepthValues = eclExtractor.cellIntersectionTVDs();
@ -161,6 +171,13 @@ bool RimFractureModelElasticPropertyCalculator::calculate( RiaDefines::CurveProp
std::vector<double> faciesValues =
m_fractureModelCalculator->extractValues( RiaDefines::CurveProperty::FACIES, timeStep );
if ( faciesValues.empty() )
{
RiaLogging::error( QString( "No facies values found." ) );
return false;
}
std::vector<double> poroValues =
m_fractureModelCalculator->extractValues( RiaDefines::CurveProperty::POROSITY, timeStep );

View File

@ -74,9 +74,19 @@ bool RimFractureModelLayerCalculator::calculate( RiaDefines::CurveProperty curve
return false;
}
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(),
fractureModel->thicknessDirectionWellPath()->wellPathGeometry(),
"fracture model" );
if ( !fractureModel->thicknessDirectionWellPath() )
{
return false;
}
RigWellPath* wellPathGeometry = fractureModel->thicknessDirectionWellPath()->wellPathGeometry();
if ( !wellPathGeometry )
{
RiaLogging::error( "No well path geometry found for layer data exctration." );
return false;
}
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), wellPathGeometry, "fracture model" );
rkbDiff = eclExtractor.wellPathGeometry()->rkbDiff();

View File

@ -19,6 +19,7 @@
#include "RiaDefines.h"
#include "RiaFractureModelDefines.h"
#include "RiaLogging.h"
#include "RigEclipseCaseData.h"
#include "RigEclipseWellLogExtractor.h"
@ -70,6 +71,18 @@ bool RimFractureModelStressCalculator::calculate( RiaDefines::CurveProperty curv
return false;
}
if ( !fractureModel->thicknessDirectionWellPath() )
{
return false;
}
RigWellPath* wellPathGeometry = fractureModel->thicknessDirectionWellPath()->wellPathGeometry();
if ( !wellPathGeometry )
{
RiaLogging::error( "No well path geometry found for stress data exctration." );
return false;
}
std::vector<double> tvDepthInFeet = m_fractureModelCalculator->calculateTrueVerticalDepth();
for ( double f : tvDepthInFeet )
{
@ -99,7 +112,6 @@ bool RimFractureModelStressCalculator::calculate( RiaDefines::CurveProperty curv
if ( eclipseCase )
{
RigWellPath* wellPathGeometry = fractureModel->thicknessDirectionWellPath()->wellPathGeometry();
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), wellPathGeometry, "fracture model" );
rkbDiff = wellPathGeometry->rkbDiff();

View File

@ -85,15 +85,19 @@ bool RimFractureModelWellLogCalculator::calculate( RiaDefines::CurveProperty cur
return false;
}
// TODO: improve this..
if ( curveProperty == RiaDefines::CurveProperty::INITIAL_PRESSURE )
if ( !fractureModel->thicknessDirectionWellPath() )
{
timeStep = 0;
return false;
}
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(),
fractureModel->thicknessDirectionWellPath()->wellPathGeometry(),
"fracture model" );
RigWellPath* wellPathGeometry = fractureModel->thicknessDirectionWellPath()->wellPathGeometry();
if ( !wellPathGeometry )
{
RiaLogging::error( "No well path geometry found for well log exctration" );
return false;
}
RigEclipseWellLogExtractor eclExtractor( eclipseCase->eclipseCaseData(), wellPathGeometry, "fracture model" );
measuredDepthValues = eclExtractor.cellIntersectionMDs();
tvDepthValues = eclExtractor.cellIntersectionTVDs();
@ -107,6 +111,12 @@ bool RimFractureModelWellLogCalculator::calculate( RiaDefines::CurveProperty cur
eclipseResultDefinition.loadResult();
// TODO: improve this..
if ( curveProperty == RiaDefines::CurveProperty::INITIAL_PRESSURE )
{
timeStep = 0;
}
cvf::ref<RigResultAccessor> resAcc =
RigResultAccessorFactory::createFromResultDefinition( eclipseCase->eclipseCaseData(),
0,