diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp index f9e58f695b..5fc217dd4f 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelPressureCalculator.cpp @@ -183,6 +183,7 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C values = results; } + bool useEqlnumForPressureInterpolation = stimPlanModel->stimPlanModelTemplate()->useEqlnumForPressureInterpolation(); if ( curveProperty == RiaDefines::CurveProperty::INITIAL_PRESSURE ) { auto hasMissingValues = []( const std::vector& vec ) { @@ -191,12 +192,12 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C if ( hasMissingValues( values ) ) { - if ( !interpolateInitialPressureByEquilibrationRegion( curveProperty, - stimPlanModel, - timeStep, - measuredDepthValues, - tvDepthValues, - values ) ) + if ( useEqlnumForPressureInterpolation && !interpolateInitialPressureByEquilibrationRegion( curveProperty, + stimPlanModel, + timeStep, + measuredDepthValues, + tvDepthValues, + values ) ) { RiaLogging::error( "Pressure interpolation by equilibration region failed." ); } @@ -210,7 +211,8 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C { std::vector initialPressureValues = values; values.clear(); - if ( !interpolatePressureDifferenceByEquilibrationRegion( curveProperty, + if ( useEqlnumForPressureInterpolation && + !interpolatePressureDifferenceByEquilibrationRegion( curveProperty, stimPlanModel, timeStep, measuredDepthValues, diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp index db77d61e6d..93036f9efa 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.cpp @@ -95,6 +95,14 @@ 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_defaultPorosity, "DefaultPorosity", RiaDefines::defaultPorosity(), @@ -312,6 +320,7 @@ void RimStimPlanModelTemplate::defineUiOrdering( QString uiConfigName, caf::PdmU pressureDataSourceGroup->add( &m_useTableForInitialPressure, { true, 2, 1 } ); pressureDataSourceGroup->add( &m_editPressureTable, { false, 1, 0 } ); pressureDataSourceGroup->add( &m_useTableForPressure ); + pressureDataSourceGroup->add( &m_useEqlnumForPressureInterpolation ); m_initialPressureEclipseCase.uiCapability()->setUiReadOnly( m_useTableForInitialPressure() ); caf::PdmUiOrdering* defaultsGroup = uiOrdering.addNewGroup( "Defaults" ); @@ -912,3 +921,11 @@ bool RimStimPlanModelTemplate::usePressureTableForProperty( RiaDefines::CurvePro else return false; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +bool RimStimPlanModelTemplate::useEqlnumForPressureInterpolation() const +{ + return m_useEqlnumForPressureInterpolation; +} diff --git a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h index 6190efb451..250947215a 100644 --- a/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h +++ b/ApplicationLibCode/ProjectDataModel/StimPlanModel/RimStimPlanModelTemplate.h @@ -118,6 +118,8 @@ public: bool usePressureTableForProperty( RiaDefines::CurveProperty curveProperty ) const; + bool useEqlnumForPressureInterpolation() const; + protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; @@ -148,6 +150,7 @@ private: caf::PdmPtrField m_initialPressureEclipseCase; caf::PdmField m_useTableForInitialPressure; caf::PdmField m_useTableForPressure; + caf::PdmField m_useEqlnumForPressureInterpolation; caf::PdmField m_editPressureTable; caf::PdmPtrField m_staticEclipseCase; caf::PdmField m_defaultPorosity;