StimPlanModel: Extrapolate pressure table to cover extraction range.

This commit is contained in:
Kristian Bendiksen 2023-09-20 12:52:17 +02:00
parent 146412c600
commit ec6a13e1da
2 changed files with 31 additions and 3 deletions

View File

@ -153,7 +153,10 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C
if ( stimPlanModel->stimPlanModelTemplate()->usePressureTableForProperty( pressureCurveProperty ) )
{
if ( !extractPressureDataFromTable( pressureCurveProperty, stimPlanModel, values, measuredDepthValues, tvDepthValues ) )
CAF_ASSERT( !targetTvds.empty() );
double minTvd = targetTvds[0];
double maxTvd = targetTvds[targetTvds.size() - 1];
if ( !extractPressureDataFromTable( pressureCurveProperty, stimPlanModel, values, measuredDepthValues, tvDepthValues, minTvd, maxTvd ) )
{
RiaLogging::error( "Unable to extract pressure data from table" );
return false;
@ -321,7 +324,9 @@ bool RimStimPlanModelPressureCalculator::extractPressureDataFromTable( RiaDefine
const RimStimPlanModel* stimPlanModel,
std::vector<double>& values,
std::vector<double>& measuredDepthValues,
std::vector<double>& tvDepthValues ) const
std::vector<double>& tvDepthValues,
double minimumTvd,
double maximumTvd ) const
{
RimStimPlanModelTemplate* stimPlanModelTemplate = stimPlanModel->stimPlanModelTemplate();
if ( !stimPlanModelTemplate ) return false;
@ -357,6 +362,27 @@ bool RimStimPlanModelPressureCalculator::extractPressureDataFromTable( RiaDefine
tvDepthValues.push_back( item->depth() );
}
// Make sure the full range of the extraction is covered by the table
bool needsExtrapolation = false;
if ( minimumTvd < tvDepthValues.front() )
{
tvDepthValues.insert( tvDepthValues.begin(), minimumTvd );
values.insert( values.begin(), std::numeric_limits<double>::infinity() );
needsExtrapolation = true;
}
if ( maximumTvd > tvDepthValues.back() )
{
tvDepthValues.push_back( maximumTvd );
values.push_back( std::numeric_limits<double>::infinity() );
needsExtrapolation = true;
}
if ( needsExtrapolation )
{
RiaInterpolationTools::interpolateMissingValues( tvDepthValues, values );
}
// Interpolate MDs from the tvd data from the table and well path geometry
const std::vector<double>& mdValuesOfWellPath = wellPathGeometry->measuredDepths();
const std::vector<double>& tvdValuesOfWellPath = wellPathGeometry->trueVerticalDepths();

View File

@ -64,7 +64,9 @@ protected:
const RimStimPlanModel* stimPlanModel,
std::vector<double>& values,
std::vector<double>& measuredDepthValues,
std::vector<double>& tvDepthValues ) const;
std::vector<double>& tvDepthValues,
double minimumTvd,
double maximumTvd ) const;
bool interpolateInitialPressureByEquilibrationRegion( RiaDefines::CurveProperty curveProperty,
const RimStimPlanModel* stimPlanModel,