From 08f560a0586e55445b3ed5f67197c759ecb79d59 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Tue, 24 Mar 2020 14:40:24 +0100 Subject: [PATCH] #5657 Add combined Production and Injection visualization for Well Disks. --- .../ProjectDataModel/RimSimWellInView.cpp | 8 +- .../RimSimWellInViewCollection.cpp | 19 +++++ .../RimSimWellInViewCollection.h | 4 +- .../ProjectDataModel/RimWellDiskConfig.cpp | 82 ++++++++++++++++--- .../ProjectDataModel/RimWellDiskConfig.h | 27 ++++-- 5 files changed, 115 insertions(+), 25 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp b/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp index edda0b7224..d8f3981071 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp +++ b/ApplicationCode/ProjectDataModel/RimSimWellInView.cpp @@ -688,11 +688,11 @@ double RimSimWellInView::calculateInjectionProductionFractions( const RimWellDis } else { - m_isInjector = RimSimWellInViewTools::gridSummaryCaseForWell( this ); + m_isInjector = RimSimWellInViewTools::isInjector( this ); double oil = RimSimWellInViewTools::extractValueForTimeStep( summaryReader, name(), - wellDiskConfig.getOilProperty(), + wellDiskConfig.getOilProperty( m_isInjector ), currentDate, isOk ); if ( !( *isOk ) ) @@ -703,7 +703,7 @@ double RimSimWellInView::calculateInjectionProductionFractions( const RimWellDis double gas = RimSimWellInViewTools::extractValueForTimeStep( summaryReader, name(), - wellDiskConfig.getGasProperty(), + wellDiskConfig.getGasProperty( m_isInjector ), currentDate, isOk ) / 1000.0; @@ -715,7 +715,7 @@ double RimSimWellInView::calculateInjectionProductionFractions( const RimWellDis double water = RimSimWellInViewTools::extractValueForTimeStep( summaryReader, name(), - wellDiskConfig.getWaterProperty(), + wellDiskConfig.getWaterProperty( m_isInjector ), currentDate, isOk ); if ( !( *isOk ) ) diff --git a/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp b/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp index a20e5662e0..64ff775db0 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp +++ b/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.cpp @@ -144,6 +144,13 @@ void AppEnum::setUp() addItem( RimSimWellInViewCollection::INJECTION_RATES, "INJECTION_RATES", "Injection Rates" ); addItem( RimSimWellInViewCollection::CUMULATIVE_PRODUCTION_RATES, "CUMULATIVE_PRODUCTION_RATES", "Production Total" ); addItem( RimSimWellInViewCollection::CUMULATIVE_INJECTION_RATES, "CUMULATIVE_INJECTION_RATES", "Injection Total" ); + addItem( RimSimWellInViewCollection::PRODUCTION_INJECTION_RATES, + "PRODUCTION_INJECTION_RATES", + "Production/Injection Rates" ); + addItem( RimSimWellInViewCollection::CUMULATIVE_PRODUCTION_INJECTION_RATES, + "CUMULATIVE_PRODUCTION_INJECTION_RATES", + "Production/Injection Total" ); + setDefault( RimSimWellInViewCollection::PRODUCTION_RATES ); } } // namespace caf @@ -1104,6 +1111,18 @@ RimWellDiskConfig RimSimWellInViewCollection::getActiveWellDiskConfig() const wellDiskConfig.setGasProperty( "WGIT" ); wellDiskConfig.setWaterProperty( "WWIT" ); } + else if ( configType == PRODUCTION_INJECTION_RATES ) + { + wellDiskConfig.setOilProperty( "WOPR", "" ); + wellDiskConfig.setGasProperty( "WGPR", "WGIR" ); + wellDiskConfig.setWaterProperty( "WWPR", "WWIR" ); + } + else if ( configType == CUMULATIVE_PRODUCTION_INJECTION_RATES ) + { + wellDiskConfig.setOilProperty( "WOPT", "" ); + wellDiskConfig.setGasProperty( "WGPT", "WGIT" ); + wellDiskConfig.setWaterProperty( "WWPT", "WWIT" ); + } } else { diff --git a/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.h b/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.h index 926347dd9e..2d6be1d007 100644 --- a/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.h +++ b/ApplicationCode/ProjectDataModel/RimSimWellInViewCollection.h @@ -105,7 +105,9 @@ public: PRODUCTION_RATES, INJECTION_RATES, CUMULATIVE_PRODUCTION_RATES, - CUMULATIVE_INJECTION_RATES + CUMULATIVE_INJECTION_RATES, + PRODUCTION_INJECTION_RATES, + CUMULATIVE_PRODUCTION_INJECTION_RATES }; typedef caf::AppEnum WellPipeColorsEnum; diff --git a/ApplicationCode/ProjectDataModel/RimWellDiskConfig.cpp b/ApplicationCode/ProjectDataModel/RimWellDiskConfig.cpp index c00edd03f7..12c8b80d52 100644 --- a/ApplicationCode/ProjectDataModel/RimWellDiskConfig.cpp +++ b/ApplicationCode/ProjectDataModel/RimWellDiskConfig.cpp @@ -23,6 +23,7 @@ //-------------------------------------------------------------------------------------------------- RimWellDiskConfig::RimWellDiskConfig() : m_isSingleProperty( false ) + , m_isCombinedProductionAndInjection( false ) , m_summaryCase( nullptr ) { } @@ -64,16 +65,24 @@ void RimWellDiskConfig::setSingleProperty( const std::string& singleProperty ) //-------------------------------------------------------------------------------------------------- void RimWellDiskConfig::setOilProperty( const std::string& oilProperty ) { - m_isSingleProperty = false; - m_oilProperty = oilProperty; + m_isSingleProperty = false; + m_isCombinedProductionAndInjection = false; + m_oilProperty = oilProperty; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::string RimWellDiskConfig::getOilProperty() const +std::string RimWellDiskConfig::getOilProperty( bool isInjector ) const { - return m_oilProperty; + if ( m_isCombinedProductionAndInjection && isInjector ) + { + return m_oilPropertyInjector; + } + else + { + return m_oilProperty; + } } //-------------------------------------------------------------------------------------------------- @@ -81,16 +90,24 @@ std::string RimWellDiskConfig::getOilProperty() const //-------------------------------------------------------------------------------------------------- void RimWellDiskConfig::setGasProperty( const std::string& gasProperty ) { - m_isSingleProperty = false; - m_gasProperty = gasProperty; + m_isSingleProperty = false; + m_isCombinedProductionAndInjection = false; + m_gasProperty = gasProperty; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::string RimWellDiskConfig::getGasProperty() const +std::string RimWellDiskConfig::getGasProperty( bool isInjector ) const { - return m_gasProperty; + if ( m_isCombinedProductionAndInjection && isInjector ) + { + return m_gasPropertyInjector; + } + else + { + return m_gasProperty; + } } //-------------------------------------------------------------------------------------------------- @@ -98,16 +115,57 @@ std::string RimWellDiskConfig::getGasProperty() const //-------------------------------------------------------------------------------------------------- void RimWellDiskConfig::setWaterProperty( const std::string& waterProperty ) { - m_isSingleProperty = false; - m_waterProperty = waterProperty; + m_isSingleProperty = false; + m_isCombinedProductionAndInjection = false; + m_waterProperty = waterProperty; } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -std::string RimWellDiskConfig::getWaterProperty() const +std::string RimWellDiskConfig::getWaterProperty( bool isInjector ) const { - return m_waterProperty; + if ( m_isCombinedProductionAndInjection && isInjector ) + { + return m_waterPropertyInjector; + } + else + { + return m_waterProperty; + } +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellDiskConfig::setOilProperty( const std::string& oilPropertyProducer, const std::string& oilPropertyInjector ) +{ + m_isCombinedProductionAndInjection = true; + m_isSingleProperty = false; + m_oilProperty = oilPropertyProducer; + m_oilPropertyInjector = oilPropertyInjector; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellDiskConfig::setGasProperty( const std::string& gasPropertyProducer, const std::string& gasPropertyInjector ) +{ + m_isCombinedProductionAndInjection = true; + m_isSingleProperty = false; + m_gasProperty = gasPropertyProducer; + m_gasPropertyInjector = gasPropertyInjector; +} + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RimWellDiskConfig::setWaterProperty( const std::string& waterPropertyProducer, const std::string& waterPropertyInjector ) +{ + m_isCombinedProductionAndInjection = true; + m_isSingleProperty = false; + m_waterProperty = waterPropertyProducer; + m_waterPropertyInjector = waterPropertyInjector; } //-------------------------------------------------------------------------------------------------- diff --git a/ApplicationCode/ProjectDataModel/RimWellDiskConfig.h b/ApplicationCode/ProjectDataModel/RimWellDiskConfig.h index 86cf9ae7df..16787a9af5 100644 --- a/ApplicationCode/ProjectDataModel/RimWellDiskConfig.h +++ b/ApplicationCode/ProjectDataModel/RimWellDiskConfig.h @@ -37,22 +37,33 @@ public: void setSingleProperty( const std::string& singleProperty ); void setOilProperty( const std::string& oilProperty ); - std::string getOilProperty() const; + std::string getOilProperty( bool isInjector ) const; void setGasProperty( const std::string& gasProperty ); - std::string getGasProperty() const; + std::string getGasProperty( bool isInjector ) const; void setWaterProperty( const std::string& waterProperty ); - std::string getWaterProperty() const; + std::string getWaterProperty( bool isInjector ) const; + + void setOilProperty( const std::string& oilPropertyProducer, const std::string& oilPropertyInjector ); + void setGasProperty( const std::string& gasPropertyProducer, const std::string& gasPropertyInjector ); + void setWaterProperty( const std::string& waterPropertyProducer, const std::string& waterPropertyInjector ); RimSummaryCase* sourceCase() const; void setSourceCase( RimSummaryCase* summaryCase ); private: - bool m_isSingleProperty; - std::string m_singleProperty; - std::string m_oilProperty; - std::string m_gasProperty; - std::string m_waterProperty; + bool m_isSingleProperty; + std::string m_singleProperty; + + bool m_isCombinedProductionAndInjection; + std::string m_oilProperty; + std::string m_gasProperty; + std::string m_waterProperty; + + std::string m_oilPropertyInjector; + std::string m_gasPropertyInjector; + std::string m_waterPropertyInjector; + RimSummaryCase* m_summaryCase; };