Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stimplan pressure table extrapolation #10632

Merged
merged 4 commits into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -204,7 +207,7 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C
if ( useEqlnumForPressureInterpolation &&
!interpolateInitialPressureByEquilibrationRegion( curveProperty, stimPlanModel, timeStep, measuredDepthValues, tvDepthValues, values ) )
{
RiaLogging::error( "Pressure interpolation by equilibration region failed." );
RiaLogging::warning( "Pressure interpolation by equilibration region failed." );
}

// Fill in regions where it was not possible top interpolate with equilibration regions.
Expand All @@ -223,7 +226,7 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C
initialPressureValues,
values ) )
{
RiaLogging::error( "Pressure interpolation by equilibration region failed." );
RiaLogging::warning( "Pressure interpolation by equilibration region failed." );
}
}
else if ( curveProperty == RiaDefines::CurveProperty::PRESSURE )
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ class RimStimPlanModelPressureCalculator : public RimStimPlanModelWellLogCalcula
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ RimStimPlanModelTemplate::RimStimPlanModelTemplate()

CAF_PDM_InitScriptableFieldNoDefault( &m_staticEclipseCase, "StaticEclipseCase", "Static Case" );

CAF_PDM_InitField( &m_useEqlnumForPressureInterpolation, "UseEqlNumForPressureInterpolation", true, "Use EQLNUM For Pressure Interpolation" );
CAF_PDM_InitScriptableField( &m_useEqlnumForPressureInterpolation,
"UseEqlNumForPressureInterpolation",
true,
"Use EQLNUM For Pressure Interpolation" );

CAF_PDM_InitScriptableField( &m_defaultPorosity, "DefaultPorosity", RiaDefines::defaultPorosity(), "Default Porosity" );
CAF_PDM_InitScriptableField( &m_defaultPermeability, "DefaultPermeability", RiaDefines::defaultPermeability(), "Default Permeability" );
Expand Down
2 changes: 1 addition & 1 deletion ResInsightVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev")
# Must be unique and increasing within one combination of major/minor/patch version
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
# Format of text must be ".xx"
set(RESINSIGHT_DEV_VERSION ".08")
set(RESINSIGHT_DEV_VERSION ".09")

# https://github.com/CRAVA/crava/tree/master/libs/nrlib
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
Expand Down