From 9795ae1920b55cbb0e198e22bee0e8c206179e6d Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 20 Sep 2023 12:52:17 +0200 Subject: [PATCH 1/4] StimPlanModel: Extrapolate pressure table to cover extraction range. --- .../RimStimPlanModelPressureCalculator.cpp | 30 +++++++++++++++++-- .../RimStimPlanModelPressureCalculator.h | 4 ++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index 1692c35ac0..e3503e32b4 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -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& values, std::vector& measuredDepthValues, - std::vector& tvDepthValues ) const + std::vector& 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::infinity() ); + needsExtrapolation = true; + } + + if ( maximumTvd > tvDepthValues.back() ) + { + tvDepthValues.push_back( maximumTvd ); + values.push_back( std::numeric_limits::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& mdValuesOfWellPath = wellPathGeometry->measuredDepths(); const std::vector& tvdValuesOfWellPath = wellPathGeometry->trueVerticalDepths(); diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h index 21636a07fd..5ef276478d 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.h @@ -64,7 +64,9 @@ class RimStimPlanModelPressureCalculator : public RimStimPlanModelWellLogCalcula const RimStimPlanModel* stimPlanModel, std::vector& values, std::vector& measuredDepthValues, - std::vector& tvDepthValues ) const; + std::vector& tvDepthValues, + double minimumTvd, + double maximumTvd ) const; bool interpolateInitialPressureByEquilibrationRegion( RiaDefines::CurveProperty curveProperty, const RimStimPlanModel* stimPlanModel, From c21f79a44bf7808cde3a702c307479fe66a59c38 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 20 Sep 2023 12:56:26 +0200 Subject: [PATCH 2/4] StimPlanModel: Fix log level failing pressure interp. message. --- .../StimPlanModel/RimStimPlanModelPressureCalculator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index e3503e32b4..3af3d4047c 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -207,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. @@ -226,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 ) From 18886d36ce53aec395c3a04614112cdf38e60e56 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 20 Sep 2023 12:59:53 +0200 Subject: [PATCH 3/4] StimPlanModel: Make useEqlNumForPressureInterpolation scriptable. --- .../StimPlanModel/RimStimPlanModelTemplate.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp index 6f232226ed..e197946bd1 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp @@ -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" ); From 955bd59341e33bfed18027659550eb08942615f4 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Wed, 20 Sep 2023 14:07:50 +0200 Subject: [PATCH 4/4] Set version to 2023.06.1-dev.09 --- ResInsightVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index b7447c340e..f649cdd119 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -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")