mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7339 StimPlanModel: handle facies without pressure depletion.
This commit is contained in:
parent
ad0e07a540
commit
3e43ca2b65
@ -20,6 +20,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.h
|
||||
)
|
||||
|
||||
set (SOURCE_GROUP_SOURCE_FILES
|
||||
@ -41,6 +42,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesInitialPressureConfig.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES
|
||||
|
@ -0,0 +1,122 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 - Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RimFaciesInitialPressureConfig.h"
|
||||
|
||||
#include "cafPdmUiCheckBoxEditor.h"
|
||||
#include "cafPdmUiLineEditor.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimFaciesInitialPressureConfig, "FaciesInitialPressureConfig" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaciesInitialPressureConfig::RimFaciesInitialPressureConfig()
|
||||
: changed( this )
|
||||
{
|
||||
m_isChecked.uiCapability()->setUiHidden( false );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_faciesName, "FaciesName", "Name", "", "", "" );
|
||||
m_faciesName.uiCapability()->setUiReadOnly( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_faciesValue, "FaciesValue", "Value", "", "", "" );
|
||||
m_faciesValue.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitField( &m_fraction, "Fraction", 1.0, "Fraction", "", "", "" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimFaciesInitialPressureConfig::~RimFaciesInitialPressureConfig()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesInitialPressureConfig::setEnabled( bool enable )
|
||||
{
|
||||
m_isChecked = enable;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimFaciesInitialPressureConfig::isEnabled() const
|
||||
{
|
||||
return m_isChecked;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesInitialPressureConfig::setFaciesName( const QString& name )
|
||||
{
|
||||
m_faciesName = name;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const QString& RimFaciesInitialPressureConfig::faciesName() const
|
||||
{
|
||||
return m_faciesName();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesInitialPressureConfig::setFaciesValue( int faciesValue )
|
||||
{
|
||||
m_faciesValue = faciesValue;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
int RimFaciesInitialPressureConfig::faciesValue() const
|
||||
{
|
||||
return m_faciesValue();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesInitialPressureConfig::setFraction( double fraction )
|
||||
{
|
||||
m_fraction = fraction;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RimFaciesInitialPressureConfig::fraction() const
|
||||
{
|
||||
return m_fraction;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimFaciesInitialPressureConfig::fieldChangedByUi( const caf::PdmFieldHandle* changedField,
|
||||
const QVariant& oldValue,
|
||||
const QVariant& newValue )
|
||||
{
|
||||
changed.send();
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2021 - Equinor ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimCheckableObject.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimFaciesInitialPressureConfig : public RimCheckableObject
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimFaciesInitialPressureConfig();
|
||||
~RimFaciesInitialPressureConfig() override;
|
||||
|
||||
caf::Signal<> changed;
|
||||
|
||||
void setEnabled( bool enable );
|
||||
bool isEnabled() const;
|
||||
|
||||
void setFaciesName( const QString& name );
|
||||
const QString& faciesName() const;
|
||||
|
||||
void setFaciesValue( int faciesValue );
|
||||
int faciesValue() const;
|
||||
|
||||
void setFraction( double fraction );
|
||||
double fraction() const;
|
||||
|
||||
private:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_faciesName;
|
||||
caf::PdmField<int> m_faciesValue;
|
||||
caf::PdmField<double> m_fraction;
|
||||
};
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "RimStimPlanModel.h"
|
||||
#include "RimStimPlanModelCalculator.h"
|
||||
#include "RimStimPlanModelTemplate.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
@ -99,14 +100,15 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C
|
||||
// Get depth from the static eclipse case
|
||||
std::vector<double> staticTvDepthValues;
|
||||
std::vector<double> staticMeasuredDepthValues;
|
||||
std::vector<double> faciesValues;
|
||||
|
||||
{
|
||||
std::vector<double> dummyValues;
|
||||
double dummyRkbDiff;
|
||||
if ( !RimStimPlanModelWellLogCalculator::extractValuesForProperty( RiaDefines::CurveProperty::POROSITY_UNSCALED,
|
||||
if ( !RimStimPlanModelWellLogCalculator::extractValuesForProperty( RiaDefines::CurveProperty::FACIES,
|
||||
stimPlanModel,
|
||||
timeStep,
|
||||
dummyValues,
|
||||
faciesValues,
|
||||
staticMeasuredDepthValues,
|
||||
staticTvDepthValues,
|
||||
dummyRkbDiff ) )
|
||||
@ -134,12 +136,12 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C
|
||||
double prevEndIndex = 0;
|
||||
for ( size_t i = 0; i < staticTvDepthValues.size(); i++ )
|
||||
{
|
||||
double tvd = staticTvDepthValues[i];
|
||||
double md = staticMeasuredDepthValues[i];
|
||||
double tvd = staticTvDepthValues[i];
|
||||
double md = staticMeasuredDepthValues[i];
|
||||
double value = std::numeric_limits<double>::infinity();
|
||||
|
||||
// Find value before and after this depth in the static data
|
||||
auto [startIndex, endIndex] = findIndex( md, measuredDepthValues );
|
||||
double value = std::numeric_limits<double>::infinity();
|
||||
|
||||
if ( startIndex < values.size() && endIndex < values.size() )
|
||||
{
|
||||
@ -191,5 +193,42 @@ bool RimStimPlanModelPressureCalculator::extractValuesForProperty( RiaDefines::C
|
||||
values = results;
|
||||
}
|
||||
|
||||
// Filter out the facies which does not have pressure depletion.
|
||||
std::map<int, double> faciesWithInitialPressure = stimPlanModel->stimPlanModelTemplate()->faciesWithInitialPressure();
|
||||
|
||||
if ( curveProperty == RiaDefines::CurveProperty::PRESSURE && !faciesWithInitialPressure.empty() )
|
||||
{
|
||||
std::vector<double> initialPressureValues;
|
||||
std::vector<double> initialPressureMeasuredDepthValues;
|
||||
std::vector<double> initialPressureTvDepthValues;
|
||||
|
||||
if ( !stimPlanModel->calculator()->extractCurveData( RiaDefines::CurveProperty::INITIAL_PRESSURE,
|
||||
timeStep,
|
||||
initialPressureValues,
|
||||
initialPressureMeasuredDepthValues,
|
||||
initialPressureTvDepthValues,
|
||||
rkbDiff ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( size_t i = 0; i < faciesValues.size(); i++ )
|
||||
{
|
||||
// Use the values from initial pressure curve
|
||||
int faciesValue = static_cast<int>( faciesValues[i] );
|
||||
double currentPressure = values[i];
|
||||
double initialPressure = initialPressureValues[i];
|
||||
auto faciesConfig = faciesWithInitialPressure.find( faciesValue );
|
||||
if ( faciesConfig != faciesWithInitialPressure.end() && !std::isinf( currentPressure ) &&
|
||||
!std::isinf( initialPressure ) )
|
||||
{
|
||||
double fraction = faciesConfig->second;
|
||||
double value = initialPressure - ( initialPressure - currentPressure ) * ( 1.0 - fraction );
|
||||
|
||||
values[i] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -30,9 +30,11 @@
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimElasticProperties.h"
|
||||
#include "RimEllipseFractureTemplate.h"
|
||||
#include "RimFaciesInitialPressureConfig.h"
|
||||
#include "RimFaciesProperties.h"
|
||||
#include "RimNonNetLayers.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimStimPlanModel.h"
|
||||
#include "RimStimPlanModelPlot.h"
|
||||
#include "RimTools.h"
|
||||
|
||||
@ -41,7 +43,9 @@
|
||||
#include "cafPdmObjectScriptingCapability.h"
|
||||
#include "cafPdmUiDoubleValueEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTableViewEditor.h"
|
||||
#include "cafPdmUiToolButtonEditor.h"
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
@ -153,6 +157,16 @@ RimStimPlanModelTemplate::RimStimPlanModelTemplate()
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_faciesInitialPressureConfigs,
|
||||
"FaciesInitialPressureConfigs",
|
||||
"FaciesInitialPressureConfigs",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
m_faciesInitialPressureConfigs.uiCapability()->setUiEditorTypeName( caf::PdmUiTableViewEditor::uiEditorTypeName() );
|
||||
m_faciesInitialPressureConfigs.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::TOP );
|
||||
m_faciesInitialPressureConfigs.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
|
||||
CAF_PDM_InitScriptableFieldNoDefault( &m_elasticProperties, "ElasticProperties", "Elastic Properties", "", "", "" );
|
||||
m_elasticProperties.uiCapability()->setUiHidden( true );
|
||||
m_elasticProperties.uiCapability()->setUiTreeHidden( true );
|
||||
@ -280,6 +294,10 @@ void RimStimPlanModelTemplate::defineUiOrdering( QString uiConfigName, caf::PdmU
|
||||
underburdenGroup->add( &m_underburdenPorosity );
|
||||
underburdenGroup->add( &m_underburdenPermeability );
|
||||
underburdenGroup->add( &m_underburdenFluidDensity );
|
||||
|
||||
caf::PdmUiOrdering* faciesInitialPressureGroup = uiOrdering.addNewGroup( "Facies With Initial Pressure" );
|
||||
faciesInitialPressureGroup->add( &m_faciesInitialPressureConfigs );
|
||||
uiOrdering.skipRemainingFields( true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -364,6 +382,28 @@ void RimStimPlanModelTemplate::setFaciesProperties( RimFaciesProperties* faciesP
|
||||
|
||||
if ( m_faciesProperties )
|
||||
{
|
||||
RimColorLegend* faciesColors = m_faciesProperties->colorLegend();
|
||||
if ( faciesColors )
|
||||
{
|
||||
for ( RimColorLegendItem* item : faciesColors->colorLegendItems() )
|
||||
{
|
||||
bool exists = std::find_if( m_faciesInitialPressureConfigs.begin(),
|
||||
m_faciesInitialPressureConfigs.end(),
|
||||
[item]( const auto& c ) {
|
||||
return c->faciesValue() == item->categoryValue();
|
||||
} ) != m_faciesInitialPressureConfigs.end();
|
||||
if ( !exists )
|
||||
{
|
||||
RimFaciesInitialPressureConfig* fipConfig = new RimFaciesInitialPressureConfig;
|
||||
fipConfig->setFaciesName( item->categoryName() );
|
||||
fipConfig->setFaciesValue( item->categoryValue() );
|
||||
m_faciesInitialPressureConfigs.push_back( fipConfig );
|
||||
|
||||
fipConfig->changed.connect( this, &RimStimPlanModelTemplate::faciesPropertiesChanged );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_faciesProperties->changed.connect( this, &RimStimPlanModelTemplate::faciesPropertiesChanged );
|
||||
RimEclipseCase* eclipseCase = getEclipseCase();
|
||||
if ( !eclipseCase ) return;
|
||||
@ -415,6 +455,11 @@ void RimStimPlanModelTemplate::initAfterRead()
|
||||
m_faciesProperties->setEclipseCase( eclipseCase );
|
||||
}
|
||||
|
||||
for ( auto& fipConfig : m_faciesInitialPressureConfigs.childObjects() )
|
||||
{
|
||||
fipConfig->changed.connect( this, &RimStimPlanModelTemplate::faciesPropertiesChanged );
|
||||
}
|
||||
|
||||
if ( m_nonNetLayers )
|
||||
{
|
||||
m_nonNetLayers->setEclipseCase( eclipseCase );
|
||||
@ -705,3 +750,17 @@ RimEclipseCase* RimStimPlanModelTemplate::staticEclipseCase() const
|
||||
{
|
||||
return m_staticEclipseCase;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::map<int, double> RimStimPlanModelTemplate::faciesWithInitialPressure() const
|
||||
{
|
||||
std::map<int, double> valueFractionMap;
|
||||
for ( const RimFaciesInitialPressureConfig* c : m_faciesInitialPressureConfigs.childObjects() )
|
||||
{
|
||||
if ( c->isEnabled() ) valueFractionMap[c->faciesValue()] = c->fraction();
|
||||
}
|
||||
|
||||
return valueFractionMap;
|
||||
}
|
||||
|
@ -20,19 +20,24 @@
|
||||
|
||||
#include "RiaStimPlanModelDefines.h"
|
||||
|
||||
#include "RimFaciesInitialPressureConfig.h"
|
||||
#include "RimNamedObject.h"
|
||||
|
||||
#include "cafPdmChildArrayField.h"
|
||||
#include "cafPdmChildField.h"
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
#include "cafPdmProxyValueField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
#include <map>
|
||||
|
||||
class RimEclipseCase;
|
||||
class RimElasticProperties;
|
||||
class RigEclipseCaseData;
|
||||
class RimFaciesProperties;
|
||||
class RimNonNetLayers;
|
||||
class RimFaciesInitialPressureConfig;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -90,6 +95,8 @@ public:
|
||||
int timeStep() const;
|
||||
RimEclipseCase* staticEclipseCase() const;
|
||||
|
||||
std::map<int, double> faciesWithInitialPressure() const;
|
||||
|
||||
void loadDataAndUpdate();
|
||||
|
||||
void setElasticProperties( RimElasticProperties* elasticProperties );
|
||||
@ -149,4 +156,6 @@ private:
|
||||
caf::PdmChildField<RimElasticProperties*> m_elasticProperties;
|
||||
caf::PdmChildField<RimFaciesProperties*> m_faciesProperties;
|
||||
caf::PdmChildField<RimNonNetLayers*> m_nonNetLayers;
|
||||
|
||||
caf::PdmChildArrayField<RimFaciesInitialPressureConfig*> m_faciesInitialPressureConfigs;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user