mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Add support for mobile oil/gas/hc columns (#12129)
* Add support for calculating mobile oil/gas/hc columns in contour maps
This commit is contained in:
parent
037102196e
commit
8567841b87
@ -461,6 +461,22 @@ QString RiaResultNames::swat()
|
||||
return "SWAT";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::sowcr()
|
||||
{
|
||||
return "SOWCR";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RiaResultNames::sogcr()
|
||||
{
|
||||
return "SOGCR";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -87,6 +87,9 @@ QString soil();
|
||||
QString sgas();
|
||||
QString swat();
|
||||
|
||||
QString sowcr();
|
||||
QString sogcr();
|
||||
|
||||
// Well path derived results
|
||||
QString wbsAzimuthResult();
|
||||
QString wbsInclinationResult();
|
||||
|
@ -93,6 +93,7 @@ list(
|
||||
ReservoirDataModel/CMakeLists_files.cmake
|
||||
ReservoirDataModel/CMakeLists_filesNotToUnitTest.cmake
|
||||
ReservoirDataModel/Completions/CMakeLists_files.cmake
|
||||
ReservoirDataModel/ContourMap/CMakeLists_files.cmake
|
||||
ReservoirDataModel/ResultAccessors/CMakeLists_files.cmake
|
||||
ReservoirDataModel/ResultCalculators/CMakeLists_files.cmake
|
||||
ReservoirDataModel/Well/CMakeLists_files.cmake
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "RicContourMapPickEventHandler.h"
|
||||
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
|
||||
#include "ContourMap/RimContourMapProjection.h"
|
||||
#include "ContourMap/RimEclipseContourMapView.h"
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
#include "RicExportContourMapToTextFeature.h"
|
||||
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
#include "RigPolygonTools.h"
|
||||
|
||||
#include "ContourMap/RimContourMapProjection.h"
|
||||
|
@ -24,7 +24,7 @@
|
||||
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
|
||||
#include "ContourMap/RimContourMapProjection.h"
|
||||
#include "ContourMap/RimEclipseContourMapView.h"
|
||||
|
@ -21,8 +21,8 @@
|
||||
#include "RiaColorTools.h"
|
||||
#include "RiaFontCache.h"
|
||||
|
||||
#include "RigContourMapGrid.h"
|
||||
#include "RigContourPolygonsTools.h"
|
||||
#include "ContourMap/RigContourMapGrid.h"
|
||||
#include "ContourMap/RigContourPolygonsTools.h"
|
||||
|
||||
#include "RivMeshLinesSourceInfo.h"
|
||||
#include "RivPartPriority.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RigContourPolygonsTools.h"
|
||||
#include "ContourMap/RigContourPolygonsTools.h"
|
||||
|
||||
#include "RiaNumberFormat.h"
|
||||
|
||||
|
@ -18,10 +18,11 @@
|
||||
|
||||
#include "RimContourMapProjection.h"
|
||||
|
||||
#include "RigContourMapCalculator.h"
|
||||
#include "RigContourMapGrid.h"
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "RigContourMapTrianglesGenerator.h"
|
||||
#include "ContourMap//RigFloodingSettings.h"
|
||||
#include "ContourMap/RigContourMapCalculator.h"
|
||||
#include "ContourMap/RigContourMapGrid.h"
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
#include "ContourMap/RigContourMapTrianglesGenerator.h"
|
||||
|
||||
#include "RimCase.h"
|
||||
#include "RimGridView.h"
|
||||
@ -47,6 +48,10 @@ void RimContourMapProjection::ResultAggregation::setUp()
|
||||
addItem( RigContourMapCalculator::GAS_COLUMN, "GAS_COLUMN", "Gas Column" );
|
||||
addItem( RigContourMapCalculator::HYDROCARBON_COLUMN, "HC_COLUMN", "Hydrocarbon Column" );
|
||||
|
||||
addItem( RigContourMapCalculator::MOBILE_OIL_COLUMN, "MOBILE_OIL_COLUMN", "Mobile Oil Column" );
|
||||
addItem( RigContourMapCalculator::MOBILE_GAS_COLUMN, "MOBILE_GAS_COLUMN", "Mobile Gas Column" );
|
||||
addItem( RigContourMapCalculator::MOBILE_HYDROCARBON_COLUMN, "MOBILE_HC_COLUMN", "Mobile Hydrocarbon Column" );
|
||||
|
||||
addItem( RigContourMapCalculator::MEAN, "MEAN_VALUE", "Arithmetic Mean" );
|
||||
addItem( RigContourMapCalculator::HARMONIC_MEAN, "HARM_VALUE", "Harmonic Mean" );
|
||||
addItem( RigContourMapCalculator::GEOMETRIC_MEAN, "GEOM_VALUE", "Geometric Mean" );
|
||||
@ -59,6 +64,15 @@ void RimContourMapProjection::ResultAggregation::setUp()
|
||||
|
||||
setDefault( RigContourMapCalculator::MEAN );
|
||||
}
|
||||
|
||||
template <>
|
||||
void RimContourMapProjection::FloodingType::setUp()
|
||||
{
|
||||
addItem( RigFloodingSettings::FloodingType::WATER_FLOODING, "WATER_FLOODING", "Water Flooding (SOWCR)" );
|
||||
addItem( RigFloodingSettings::FloodingType::GAS_FLOODING, "GAS_FLOODING", "Gas Flooding (SOGCR)" );
|
||||
addItem( RigFloodingSettings::FloodingType::USER_DEFINED, "USER_DEFINED", "User Defined Value" );
|
||||
}
|
||||
|
||||
} // namespace caf
|
||||
|
||||
CAF_PDM_ABSTRACT_SOURCE_INIT( RimContourMapProjection, "RimContourMapProjection" );
|
||||
@ -80,6 +94,16 @@ RimContourMapProjection::RimContourMapProjection()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_resultAggregation, "ResultAggregation", "Result Aggregation" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_oilFloodingType, "OilFloodingType", "Residual Oil Given By" );
|
||||
m_oilFloodingType.setValue( RigFloodingSettings::FloodingType::WATER_FLOODING );
|
||||
CAF_PDM_InitField( &m_userDefinedFloodingOil, "UserDefinedFloodingOil", 0.0, "" );
|
||||
m_userDefinedFloodingOil.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_gasFloodingType, "GasFloodingType", "Residual Oil-in-Gas Given By" );
|
||||
m_gasFloodingType.setValue( RigFloodingSettings::FloodingType::GAS_FLOODING );
|
||||
CAF_PDM_InitField( &m_userDefinedFloodingGas, "UserDefinedFloodingGas", 0.0, "" );
|
||||
m_userDefinedFloodingGas.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitField( &m_showContourLines, "ContourLines", true, "Show Contour Lines" );
|
||||
CAF_PDM_InitField( &m_showContourLabels, "ContourLabels", true, "Show Contour Labels" );
|
||||
CAF_PDM_InitField( &m_smoothContourLines, "SmoothContourLines", true, "Smooth Contour Lines" );
|
||||
@ -507,7 +531,8 @@ double RimContourMapProjection::gridEdgeOffset() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimContourMapProjection::fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue )
|
||||
{
|
||||
if ( changedField == &m_resultAggregation )
|
||||
if ( ( changedField == &m_resultAggregation ) || ( changedField == &m_oilFloodingType ) || ( changedField == &m_gasFloodingType ) ||
|
||||
( changedField == &m_userDefinedFloodingOil ) || ( changedField == &m_userDefinedFloodingGas ) )
|
||||
{
|
||||
ResultAggregation previousAggregation = static_cast<RigContourMapCalculator::ResultAggregationType>( oldValue.toInt() );
|
||||
if ( RigContourMapCalculator::isStraightSummationResult( previousAggregation ) != isStraightSummationResult() )
|
||||
@ -535,6 +560,26 @@ void RimContourMapProjection::fieldChangedByUi( const caf::PdmFieldHandle* chang
|
||||
baseView()->scheduleCreateDisplayModelAndRedraw();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QList<caf::PdmOptionItemInfo> RimContourMapProjection::calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions )
|
||||
{
|
||||
QList<caf::PdmOptionItemInfo> options;
|
||||
|
||||
if ( &m_gasFloodingType == fieldNeedingOptions )
|
||||
{
|
||||
options.push_back(
|
||||
caf::PdmOptionItemInfo( caf::AppEnum<RigFloodingSettings::FloodingType>::uiText( RigFloodingSettings::FloodingType::GAS_FLOODING ),
|
||||
RigFloodingSettings::FloodingType::GAS_FLOODING ) );
|
||||
options.push_back(
|
||||
caf::PdmOptionItemInfo( caf::AppEnum<RigFloodingSettings::FloodingType>::uiText( RigFloodingSettings::FloodingType::USER_DEFINED ),
|
||||
RigFloodingSettings::FloodingType::USER_DEFINED ) );
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -549,6 +594,15 @@ void RimContourMapProjection::defineEditorAttribute( const caf::PdmFieldHandle*
|
||||
myAttr->m_sliderTickCount = 20;
|
||||
}
|
||||
}
|
||||
else if ( ( &m_userDefinedFloodingOil == field ) || ( &m_userDefinedFloodingGas == field ) )
|
||||
{
|
||||
if ( auto myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute ) )
|
||||
{
|
||||
myAttr->m_minimum = 0.0;
|
||||
myAttr->m_maximum = 1.0;
|
||||
myAttr->m_sliderTickCount = 20;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -558,6 +612,27 @@ void RimContourMapProjection::defineUiOrdering( QString uiConfigName, caf::PdmUi
|
||||
{
|
||||
caf::PdmUiGroup* mainGroup = uiOrdering.addNewGroup( "Projection Settings" );
|
||||
mainGroup->add( &m_resultAggregation );
|
||||
|
||||
if ( RigContourMapCalculator::isMobileColumnResult( m_resultAggregation() ) )
|
||||
{
|
||||
if ( m_resultAggregation() != RigContourMapCalculator::MOBILE_GAS_COLUMN )
|
||||
{
|
||||
mainGroup->add( &m_oilFloodingType );
|
||||
if ( m_oilFloodingType() == RigFloodingSettings::FloodingType::USER_DEFINED )
|
||||
{
|
||||
mainGroup->add( &m_userDefinedFloodingOil );
|
||||
}
|
||||
}
|
||||
if ( m_resultAggregation() != RigContourMapCalculator::MOBILE_OIL_COLUMN )
|
||||
{
|
||||
mainGroup->add( &m_gasFloodingType );
|
||||
if ( m_gasFloodingType() == RigFloodingSettings::FloodingType::USER_DEFINED )
|
||||
{
|
||||
mainGroup->add( &m_userDefinedFloodingGas );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
legendConfig()->uiOrdering( "NumLevelsOnly", *mainGroup );
|
||||
mainGroup->add( &m_resolution );
|
||||
mainGroup->add( &m_showContourLines );
|
||||
|
@ -22,8 +22,9 @@
|
||||
#include "RimCheckableNamedObject.h"
|
||||
#include "RimIntersectionEnums.h"
|
||||
|
||||
#include "RigContourMapCalculator.h"
|
||||
#include "RigContourPolygonsTools.h"
|
||||
#include "ContourMap/RigContourMapCalculator.h"
|
||||
#include "ContourMap/RigContourPolygonsTools.h"
|
||||
#include "ContourMap/RigFloodingSettings.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmObject.h"
|
||||
@ -49,6 +50,7 @@ class RimContourMapProjection : public RimCheckableNamedObject
|
||||
public:
|
||||
using ResultAggregation = caf::AppEnum<RigContourMapCalculator::ResultAggregationType>;
|
||||
using ContourPolygons = std::vector<RigContourPolygonsTools::ContourPolygon>;
|
||||
using FloodingType = caf::AppEnum<RigFloodingSettings::FloodingType>;
|
||||
|
||||
RimContourMapProjection();
|
||||
~RimContourMapProjection() override;
|
||||
@ -128,6 +130,7 @@ protected:
|
||||
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
||||
void appendValueFilterGroup( caf::PdmUiOrdering& uiOrdering );
|
||||
|
||||
@ -149,6 +152,11 @@ protected:
|
||||
caf::PdmField<bool> m_showContourLabels;
|
||||
caf::PdmField<bool> m_smoothContourLines;
|
||||
|
||||
caf::PdmField<FloodingType> m_oilFloodingType;
|
||||
caf::PdmField<FloodingType> m_gasFloodingType;
|
||||
caf::PdmField<double> m_userDefinedFloodingGas;
|
||||
caf::PdmField<double> m_userDefinedFloodingOil;
|
||||
|
||||
cvf::Vec2d m_pickPoint;
|
||||
std::vector<ContourPolygons> m_contourPolygons;
|
||||
std::vector<double> m_contourLevelCumulativeAreas;
|
||||
|
@ -18,12 +18,12 @@
|
||||
|
||||
#include "RimEclipseContourMapProjection.h"
|
||||
|
||||
#include "ContourMap/RigContourMapCalculator.h"
|
||||
#include "ContourMap/RigContourMapGrid.h"
|
||||
#include "ContourMap/RigEclipseContourMapProjection.h"
|
||||
#include "RiaPorosityModel.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigContourMapCalculator.h"
|
||||
#include "RigContourMapGrid.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEclipseContourMapProjection.h"
|
||||
#include "RigEclipseResultAddress.h"
|
||||
#include "RigMainGrid.h"
|
||||
|
||||
@ -183,8 +183,10 @@ std::vector<double> RimEclipseContourMapProjection::generateResults( int timeSte
|
||||
cellColors->timeLapseBaseTimeStep(),
|
||||
cellColors->caseDiffIndex() );
|
||||
|
||||
RigFloodingSettings fl( m_oilFloodingType(), m_userDefinedFloodingOil(), m_gasFloodingType(), m_userDefinedFloodingGas() );
|
||||
|
||||
return dynamic_cast<RigEclipseContourMapProjection*>( m_contourMapProjection.get() )
|
||||
->generateResults( resAddr, m_resultAggregation(), timeStep );
|
||||
->generateResults( resAddr, m_resultAggregation(), timeStep, fl );
|
||||
}
|
||||
|
||||
return {};
|
||||
@ -205,8 +207,10 @@ void RimEclipseContourMapProjection::generateAndSaveResults( int timeStep )
|
||||
cellColors->timeLapseBaseTimeStep(),
|
||||
cellColors->caseDiffIndex() );
|
||||
|
||||
RigFloodingSettings fl( m_oilFloodingType(), m_userDefinedFloodingOil(), m_gasFloodingType(), m_userDefinedFloodingGas() );
|
||||
|
||||
dynamic_cast<RigEclipseContourMapProjection*>( m_contourMapProjection.get() )
|
||||
->generateAndSaveResults( resAddr, m_resultAggregation(), timeStep );
|
||||
->generateAndSaveResults( resAddr, m_resultAggregation(), timeStep, fl );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,11 +26,11 @@
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "ContourMap/RigContourMapCalculator.h"
|
||||
#include "ContourMap/RigContourMapGrid.h"
|
||||
#include "ContourMap/RigEclipseContourMapProjection.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigContourMapCalculator.h"
|
||||
#include "RigContourMapGrid.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigEclipseContourMapProjection.h"
|
||||
#include "RigEclipseResultAddress.h"
|
||||
#include "RigFormationNames.h"
|
||||
#include "RigMainGrid.h"
|
||||
@ -54,6 +54,7 @@
|
||||
#include "Riu3DMainWindowTools.h"
|
||||
|
||||
#include "cafCmdFeatureMenuBuilder.h"
|
||||
#include "cafPdmUiDoubleSliderEditor.h"
|
||||
#include "cafPdmUiPushButtonEditor.h"
|
||||
#include "cafPdmUiTreeSelectionEditor.h"
|
||||
#include "cafProgressInfo.h"
|
||||
@ -97,6 +98,16 @@ RimStatisticsContourMap::RimStatisticsContourMap()
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_resultAggregation, "ResultAggregation", "Result Aggregation" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_oilFloodingType, "OilFloodingType", "Residual Oil Given By" );
|
||||
m_oilFloodingType.setValue( RigFloodingSettings::FloodingType::WATER_FLOODING );
|
||||
CAF_PDM_InitField( &m_userDefinedFloodingOil, "UserDefinedFloodingOil", 0.0, "User Defined Value" );
|
||||
m_userDefinedFloodingOil.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_gasFloodingType, "GasFloodingType", "Residual Oil-in-Gas Given By" );
|
||||
m_gasFloodingType.setValue( RigFloodingSettings::FloodingType::GAS_FLOODING );
|
||||
CAF_PDM_InitField( &m_userDefinedFloodingGas, "UserDefinedFloodingGas", 0.0, "User Defined Value" );
|
||||
m_userDefinedFloodingGas.uiCapability()->setUiEditorTypeName( caf::PdmUiDoubleSliderEditor::uiEditorTypeName() );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_selectedTimeSteps, "SelectedTimeSteps", "Time Step Selection" );
|
||||
m_selectedTimeSteps.uiCapability()->setUiEditorTypeName( caf::PdmUiTreeSelectionEditor::uiEditorTypeName() );
|
||||
|
||||
@ -162,6 +173,27 @@ void RimStatisticsContourMap::defineUiOrdering( QString uiConfigName, caf::PdmUi
|
||||
auto genGrp = uiOrdering.addNewGroup( "General" );
|
||||
|
||||
genGrp->add( &m_resultAggregation );
|
||||
|
||||
if ( RigContourMapCalculator::isMobileColumnResult( m_resultAggregation() ) )
|
||||
{
|
||||
if ( m_resultAggregation() != RigContourMapCalculator::MOBILE_GAS_COLUMN )
|
||||
{
|
||||
genGrp->add( &m_oilFloodingType );
|
||||
if ( m_oilFloodingType() == RigFloodingSettings::FloodingType::USER_DEFINED )
|
||||
{
|
||||
genGrp->add( &m_userDefinedFloodingOil );
|
||||
}
|
||||
}
|
||||
if ( m_resultAggregation() != RigContourMapCalculator::MOBILE_OIL_COLUMN )
|
||||
{
|
||||
genGrp->add( &m_gasFloodingType );
|
||||
if ( m_gasFloodingType() == RigFloodingSettings::FloodingType::USER_DEFINED )
|
||||
{
|
||||
genGrp->add( &m_userDefinedFloodingGas );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
genGrp->add( &m_resolution );
|
||||
genGrp->add( &m_primaryCase );
|
||||
genGrp->add( &m_boundingBoxExpPercent );
|
||||
@ -363,6 +395,15 @@ QList<caf::PdmOptionItemInfo> RimStatisticsContourMap::calculateValueOptions( co
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ( &m_gasFloodingType == fieldNeedingOptions )
|
||||
{
|
||||
options.push_back(
|
||||
caf::PdmOptionItemInfo( caf::AppEnum<RigFloodingSettings::FloodingType>::uiText( RigFloodingSettings::FloodingType::GAS_FLOODING ),
|
||||
RigFloodingSettings::FloodingType::GAS_FLOODING ) );
|
||||
options.push_back(
|
||||
caf::PdmOptionItemInfo( caf::AppEnum<RigFloodingSettings::FloodingType>::uiText( RigFloodingSettings::FloodingType::USER_DEFINED ),
|
||||
RigFloodingSettings::FloodingType::USER_DEFINED ) );
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
@ -379,6 +420,16 @@ void RimStatisticsContourMap::defineEditorAttribute( const caf::PdmFieldHandle*
|
||||
attrib->m_buttonText = "Compute";
|
||||
}
|
||||
}
|
||||
else if ( ( &m_userDefinedFloodingOil == field ) || ( &m_userDefinedFloodingGas == field ) )
|
||||
{
|
||||
if ( auto myAttr = dynamic_cast<caf::PdmUiDoubleSliderEditorAttribute*>( attribute ) )
|
||||
{
|
||||
myAttr->m_minimum = 0.0;
|
||||
myAttr->m_maximum = 1.0;
|
||||
myAttr->m_sliderTickCount = 20;
|
||||
myAttr->m_delaySliderUpdateUntilRelease = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -472,6 +523,7 @@ void RimStatisticsContourMap::computeStatistics()
|
||||
if ( ensemble->cases().empty() ) return;
|
||||
if ( eclipseCase() == nullptr ) return;
|
||||
|
||||
RigFloodingSettings floodSettings( m_oilFloodingType(), m_userDefinedFloodingOil(), m_gasFloodingType(), m_userDefinedFloodingGas() );
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation = m_resultAggregation();
|
||||
|
||||
cvf::BoundingBox gridBoundingBox = eclipseCase()->activeCellsBoundingBox();
|
||||
@ -526,14 +578,14 @@ void RimStatisticsContourMap::computeStatistics()
|
||||
for ( auto ts : selectedTimeSteps() )
|
||||
{
|
||||
std::vector<double> result =
|
||||
contourMapProjection.generateResults( m_resultDefinition()->eclipseResultAddress(), resultAggregation, ts );
|
||||
contourMapProjection.generateResults( m_resultDefinition()->eclipseResultAddress(), resultAggregation, ts, floodSettings );
|
||||
timestep_results[ts].push_back( result );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::vector<double> result =
|
||||
contourMapProjection.generateResults( m_resultDefinition()->eclipseResultAddress(), resultAggregation, 0 );
|
||||
contourMapProjection.generateResults( m_resultDefinition()->eclipseResultAddress(), resultAggregation, 0, floodSettings );
|
||||
timestep_results[0].push_back( result );
|
||||
}
|
||||
}
|
||||
|
@ -42,8 +42,6 @@ class RigPolyLinesData;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RimStatisticsContourMap : public RimNamedObject
|
||||
{
|
||||
@ -112,6 +110,11 @@ private:
|
||||
|
||||
caf::PdmField<caf::AppEnum<RimContourMapResolutionTools::SamplingResolution>> m_resolution;
|
||||
|
||||
caf::PdmField<caf::AppEnum<RigFloodingSettings::FloodingType>> m_oilFloodingType;
|
||||
caf::PdmField<caf::AppEnum<RigFloodingSettings::FloodingType>> m_gasFloodingType;
|
||||
caf::PdmField<double> m_userDefinedFloodingGas;
|
||||
caf::PdmField<double> m_userDefinedFloodingOil;
|
||||
|
||||
std::unique_ptr<RigContourMapGrid> m_contourMapGrid;
|
||||
std::map<size_t, std::map<StatisticsType, std::vector<double>>> m_timeResults;
|
||||
|
||||
|
@ -18,12 +18,12 @@
|
||||
|
||||
#include "RimStatisticsContourMapProjection.h"
|
||||
|
||||
#include "ContourMap/RigContourMapCalculator.h"
|
||||
#include "ContourMap/RigContourMapGrid.h"
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
#include "ContourMap/RigStatisticsContourMapProjection.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigContourMapCalculator.h"
|
||||
#include "RigContourMapGrid.h"
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigStatisticsContourMapProjection.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
|
@ -17,16 +17,16 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
#include "RimGeoMechContourMapProjection.h"
|
||||
|
||||
#include "RigContourMapCalculator.h"
|
||||
#include "RigContourMapGrid.h"
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "ContourMap/RigContourMapCalculator.h"
|
||||
#include "ContourMap/RigContourMapGrid.h"
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
#include "ContourMap/RigGeoMechContourMapProjection.h"
|
||||
#include "RigFemAddressDefines.h"
|
||||
#include "RigFemPart.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartGrid.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
#include "RigGeoMechCaseData.h"
|
||||
#include "RigGeoMechContourMapProjection.h"
|
||||
|
||||
#include "RimCellFilterCollection.h"
|
||||
#include "RimGeoMechCase.h"
|
||||
|
@ -26,9 +26,9 @@
|
||||
|
||||
#include "RicGridStatisticsDialog.h"
|
||||
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigFemPartCollection.h"
|
||||
#include "RigFemPartResultsCollection.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "RimHistogramCalculator.h"
|
||||
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "ContourMap/RigContourMapProjection.h"
|
||||
#include "RigEclipseMultiPropertyStatCalc.h"
|
||||
#include "RigEclipseNativeVisibleCellsStatCalc.h"
|
||||
#include "RigFemNativeVisibleCellsStatCalc.h"
|
||||
|
@ -13,9 +13,6 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapGrid.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourPolygonsTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigConvexHull.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseCaseData.h
|
||||
@ -83,12 +80,6 @@ set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigVisibleCategoriesCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWbsParameter.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWeightedMeanCalc.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapTrianglesGenerator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigGeoMechContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigStatisticsContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigPolygonTools.h
|
||||
)
|
||||
|
||||
@ -106,9 +97,6 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellFaceGeometryTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigCellGeometryTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapGrid.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourPolygonsTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigConvexHull.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigDeclineCurveCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseAllanFaultsStatCalc.cpp
|
||||
@ -173,14 +161,6 @@ set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigVisibleCategoriesCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWbsParameter.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigWeightedMeanCalc.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapGrid.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourPolygonsTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapTrianglesGenerator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigGeoMechContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigStatisticsContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigPolygonTools.cpp
|
||||
)
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
set(SOURCE_GROUP_HEADER_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapGrid.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourPolygonsTools.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapTrianglesGenerator.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigGeoMechContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigStatisticsContourMapProjection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigFloodingSettings.h
|
||||
)
|
||||
|
||||
set(SOURCE_GROUP_SOURCE_FILES
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapGrid.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourPolygonsTools.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapCalculator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigContourMapTrianglesGenerator.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigEclipseContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigGeoMechContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigStatisticsContourMapProjection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RigFloodingSettings.cpp
|
||||
)
|
||||
|
||||
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})
|
||||
list(APPEND CODE_SOURCE_FILES ${SOURCE_GROUP_SOURCE_FILES})
|
@ -61,6 +61,9 @@ double RigContourMapCalculator::calculateValueInMapCell( const RigContourMapProj
|
||||
case OIL_COLUMN:
|
||||
case GAS_COLUMN:
|
||||
case HYDROCARBON_COLUMN:
|
||||
case MOBILE_OIL_COLUMN:
|
||||
case MOBILE_GAS_COLUMN:
|
||||
case MOBILE_HYDROCARBON_COLUMN:
|
||||
return calculateSum( contourMapProjection, matchingCells, gridCellValues );
|
||||
default:
|
||||
{
|
||||
@ -435,7 +438,8 @@ std::vector<RigContourMapCalculator::CellIndexAndResult>
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigContourMapCalculator::isColumnResult( ResultAggregationType aggregationType )
|
||||
{
|
||||
return aggregationType == OIL_COLUMN || aggregationType == GAS_COLUMN || aggregationType == HYDROCARBON_COLUMN;
|
||||
return aggregationType == OIL_COLUMN || aggregationType == GAS_COLUMN || aggregationType == HYDROCARBON_COLUMN ||
|
||||
isMobileColumnResult( aggregationType );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -451,5 +455,13 @@ bool RigContourMapCalculator::isMeanResult( ResultAggregationType aggregationTyp
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigContourMapCalculator::isStraightSummationResult( ResultAggregationType aggregationType )
|
||||
{
|
||||
return aggregationType == OIL_COLUMN || aggregationType == GAS_COLUMN || aggregationType == HYDROCARBON_COLUMN || aggregationType == SUM;
|
||||
return isColumnResult( aggregationType ) || aggregationType == SUM;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigContourMapCalculator::isMobileColumnResult( ResultAggregationType aggregationType )
|
||||
{
|
||||
return aggregationType == MOBILE_OIL_COLUMN || aggregationType == MOBILE_GAS_COLUMN || aggregationType == MOBILE_HYDROCARBON_COLUMN;
|
||||
}
|
@ -50,7 +50,10 @@ public:
|
||||
SUM,
|
||||
OIL_COLUMN,
|
||||
GAS_COLUMN,
|
||||
HYDROCARBON_COLUMN
|
||||
HYDROCARBON_COLUMN,
|
||||
MOBILE_OIL_COLUMN,
|
||||
MOBILE_GAS_COLUMN,
|
||||
MOBILE_HYDROCARBON_COLUMN
|
||||
};
|
||||
|
||||
static std::vector<std::vector<std::pair<size_t, double>>>
|
||||
@ -81,6 +84,7 @@ public:
|
||||
static bool isColumnResult( ResultAggregationType aggregationType );
|
||||
static bool isMeanResult( ResultAggregationType aggregationType );
|
||||
static bool isStraightSummationResult( ResultAggregationType aggregationType );
|
||||
static bool isMobileColumnResult( ResultAggregationType aggregationType );
|
||||
|
||||
private:
|
||||
static double calculateTopValue( const RigContourMapProjection& contourMapProjection,
|
@ -60,10 +60,11 @@ RigEclipseContourMapProjection::~RigEclipseContourMapProjection()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseContourMapProjection::generateAndSaveResults( const RigEclipseResultAddress& resultAddress,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings )
|
||||
{
|
||||
std::tie( m_useActiveCellInfo, m_aggregatedResults ) =
|
||||
generateResults( *this, m_contourMapGrid, m_resultData, resultAddress, resultAggregation, timeStep );
|
||||
generateResults( *this, m_contourMapGrid, m_resultData, resultAddress, resultAggregation, timeStep, floodingSettings );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -71,10 +72,11 @@ void RigEclipseContourMapProjection::generateAndSaveResults( const RigEclipseRes
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigEclipseContourMapProjection::generateResults( const RigEclipseResultAddress& resultAddress,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep ) const
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings ) const
|
||||
{
|
||||
std::pair<bool, std::vector<double>> result =
|
||||
generateResults( *this, m_contourMapGrid, m_resultData, resultAddress, resultAggregation, timeStep );
|
||||
generateResults( *this, m_contourMapGrid, m_resultData, resultAddress, resultAggregation, timeStep, floodingSettings );
|
||||
return result.second;
|
||||
}
|
||||
|
||||
@ -87,7 +89,8 @@ std::pair<bool, std::vector<double>>
|
||||
RigCaseCellResultsData& resultData,
|
||||
const RigEclipseResultAddress& resultAddress,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings )
|
||||
{
|
||||
size_t nCells = contourMapProjection.numberOfCells();
|
||||
|
||||
@ -107,20 +110,17 @@ std::pair<bool, std::vector<double>>
|
||||
std::vector<double> gridResultValues;
|
||||
if ( RigContourMapCalculator::isColumnResult( resultAggregation ) )
|
||||
{
|
||||
resultData.ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "PORO" ) );
|
||||
resultData.ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "NTG" ) );
|
||||
resultData.ensureKnownResultLoaded( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "DZ" ) );
|
||||
if ( resultAggregation == RigContourMapCalculator::OIL_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN )
|
||||
bool missingResults = false;
|
||||
|
||||
for ( const auto& resAddr : neededResults( resultAggregation, floodingSettings ) )
|
||||
{
|
||||
resultData.ensureKnownResultLoaded(
|
||||
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ) );
|
||||
missingResults = missingResults || !resultData.ensureKnownResultLoaded( resAddr );
|
||||
}
|
||||
if ( resultAggregation == RigContourMapCalculator::GAS_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN )
|
||||
|
||||
if ( !missingResults )
|
||||
{
|
||||
resultData.ensureKnownResultLoaded(
|
||||
RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
|
||||
gridResultValues = calculateColumnResult( resultData, resultAggregation, timeStep, floodingSettings );
|
||||
}
|
||||
gridResultValues = calculateColumnResult( resultData, resultAggregation, timeStep );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -151,28 +151,14 @@ std::pair<bool, std::vector<double>>
|
||||
return { useActiveCellInfo, aggregatedResults };
|
||||
}
|
||||
|
||||
std::vector<double> RigEclipseContourMapProjection::calculateColumnResult( RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep ) const
|
||||
{
|
||||
return calculateColumnResult( m_resultData, resultAggregation, timeStep );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigEclipseContourMapProjection::calculateColumnResult( RigCaseCellResultsData& resultData,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep )
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings )
|
||||
{
|
||||
bool hasPoroResult = resultData.hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "PORO" ) );
|
||||
bool hasNtgResult = resultData.hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "NTG" ) );
|
||||
bool hasDzResult = resultData.hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "DZ" ) );
|
||||
|
||||
if ( !( hasPoroResult && hasNtgResult && hasDzResult ) )
|
||||
{
|
||||
return std::vector<double>();
|
||||
}
|
||||
|
||||
const std::vector<double>& poroResults =
|
||||
resultData.cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, "PORO" ), 0 );
|
||||
const std::vector<double>& ntgResults =
|
||||
@ -182,38 +168,42 @@ std::vector<double> RigEclipseContourMapProjection::calculateColumnResult( RigCa
|
||||
|
||||
CVF_ASSERT( poroResults.size() == ntgResults.size() && ntgResults.size() == dzResults.size() );
|
||||
|
||||
std::vector<double> resultValues( poroResults.size(), 0.0 );
|
||||
const auto nSamples = poroResults.size();
|
||||
|
||||
if ( resultAggregation == RigContourMapCalculator::OIL_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN )
|
||||
std::vector<double> residualOil = residualOilData( resultData, resultAggregation, floodingSettings, nSamples );
|
||||
std::vector<double> residualGas = residualGasData( resultData, resultAggregation, floodingSettings, nSamples );
|
||||
|
||||
std::vector<double> resultValues( nSamples, 0.0 );
|
||||
|
||||
if ( ( resultAggregation == RigContourMapCalculator::OIL_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN ) ||
|
||||
( resultAggregation == RigContourMapCalculator::MOBILE_OIL_COLUMN ||
|
||||
resultAggregation == RigContourMapCalculator::MOBILE_HYDROCARBON_COLUMN ) )
|
||||
{
|
||||
const std::vector<double>& soilResults =
|
||||
resultData.cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() ),
|
||||
timeStep );
|
||||
for ( size_t cellResultIdx = 0; cellResultIdx < resultValues.size(); ++cellResultIdx )
|
||||
for ( size_t n = 0; n < nSamples; n++ )
|
||||
{
|
||||
resultValues[cellResultIdx] = soilResults[cellResultIdx];
|
||||
resultValues[n] = std::max( soilResults[n] - residualOil[n], 0.0 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( resultAggregation == RigContourMapCalculator::GAS_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN )
|
||||
if ( ( resultAggregation == RigContourMapCalculator::GAS_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN ) ||
|
||||
( resultAggregation == RigContourMapCalculator::MOBILE_GAS_COLUMN ||
|
||||
resultAggregation == RigContourMapCalculator::MOBILE_HYDROCARBON_COLUMN ) )
|
||||
{
|
||||
bool hasGasResult =
|
||||
resultData.hasResultEntry( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ) );
|
||||
if ( hasGasResult )
|
||||
const std::vector<double>& sgasResults =
|
||||
resultData.cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ),
|
||||
timeStep );
|
||||
for ( size_t n = 0; n < nSamples; n++ )
|
||||
{
|
||||
const std::vector<double>& sgasResults =
|
||||
resultData.cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() ),
|
||||
timeStep );
|
||||
for ( size_t cellResultIdx = 0; cellResultIdx < resultValues.size(); ++cellResultIdx )
|
||||
{
|
||||
resultValues[cellResultIdx] += sgasResults[cellResultIdx];
|
||||
}
|
||||
resultValues[n] += std::max( sgasResults[n] - residualGas[n], 0.0 );
|
||||
}
|
||||
}
|
||||
|
||||
for ( size_t cellResultIdx = 0; cellResultIdx < resultValues.size(); ++cellResultIdx )
|
||||
for ( size_t n = 0; n < nSamples; n++ )
|
||||
{
|
||||
resultValues[cellResultIdx] *= poroResults[cellResultIdx] * ntgResults[cellResultIdx] * dzResults[cellResultIdx];
|
||||
resultValues[n] *= poroResults[n] * ntgResults[n] * dzResults[n];
|
||||
}
|
||||
|
||||
return resultValues;
|
||||
@ -330,3 +320,125 @@ std::vector<bool> RigEclipseContourMapProjection::getMapCellVisibility( int
|
||||
{
|
||||
return std::vector<bool>( numberOfCells(), true );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<RigEclipseResultAddress> RigEclipseContourMapProjection::neededResults( RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
RigFloodingSettings& floodingSettings )
|
||||
{
|
||||
std::set<RigEclipseResultAddress> results;
|
||||
|
||||
if ( RigContourMapCalculator::isColumnResult( resultAggregation ) )
|
||||
{
|
||||
results.emplace( RiaDefines::ResultCatType::STATIC_NATIVE, "PORO" );
|
||||
results.emplace( RiaDefines::ResultCatType::STATIC_NATIVE, "NTG" );
|
||||
results.emplace( RiaDefines::ResultCatType::STATIC_NATIVE, "DZ" );
|
||||
|
||||
if ( resultAggregation == RigContourMapCalculator::OIL_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN ||
|
||||
resultAggregation == RigContourMapCalculator::MOBILE_OIL_COLUMN ||
|
||||
resultAggregation == RigContourMapCalculator::MOBILE_HYDROCARBON_COLUMN )
|
||||
{
|
||||
results.emplace( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::soil() );
|
||||
}
|
||||
if ( resultAggregation == RigContourMapCalculator::GAS_COLUMN || resultAggregation == RigContourMapCalculator::HYDROCARBON_COLUMN ||
|
||||
resultAggregation == RigContourMapCalculator::MOBILE_GAS_COLUMN ||
|
||||
resultAggregation == RigContourMapCalculator::MOBILE_HYDROCARBON_COLUMN )
|
||||
{
|
||||
results.emplace( RiaDefines::ResultCatType::DYNAMIC_NATIVE, RiaResultNames::sgas() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( RigContourMapCalculator::isMobileColumnResult( resultAggregation ) )
|
||||
{
|
||||
if ( ( resultAggregation == RigContourMapCalculator::ResultAggregationType::MOBILE_OIL_COLUMN ) ||
|
||||
( resultAggregation == RigContourMapCalculator::ResultAggregationType::MOBILE_HYDROCARBON_COLUMN ) )
|
||||
{
|
||||
if ( floodingSettings.oilFlooding() == RigFloodingSettings::FloodingType::WATER_FLOODING )
|
||||
{
|
||||
results.emplace( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::sowcr() );
|
||||
}
|
||||
else if ( floodingSettings.oilFlooding() == RigFloodingSettings::FloodingType::GAS_FLOODING )
|
||||
{
|
||||
results.emplace( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::sogcr() );
|
||||
}
|
||||
}
|
||||
if ( ( resultAggregation == RigContourMapCalculator::ResultAggregationType::MOBILE_GAS_COLUMN ) ||
|
||||
( resultAggregation == RigContourMapCalculator::ResultAggregationType::MOBILE_HYDROCARBON_COLUMN ) )
|
||||
{
|
||||
if ( floodingSettings.gasFlooding() == RigFloodingSettings::FloodingType::WATER_FLOODING )
|
||||
{
|
||||
results.emplace( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::sowcr() );
|
||||
}
|
||||
else if ( floodingSettings.gasFlooding() == RigFloodingSettings::FloodingType::GAS_FLOODING )
|
||||
{
|
||||
results.emplace( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::sogcr() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
std::vector<double> RigEclipseContourMapProjection::residualOilData( RigCaseCellResultsData& resultData,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
RigFloodingSettings& floodingSettings,
|
||||
size_t nSamples )
|
||||
{
|
||||
std::vector<double> residualOil;
|
||||
|
||||
if ( ( resultAggregation == RigContourMapCalculator::MOBILE_OIL_COLUMN ) ||
|
||||
( resultAggregation == RigContourMapCalculator::MOBILE_HYDROCARBON_COLUMN ) )
|
||||
{
|
||||
if ( floodingSettings.oilFlooding() == RigFloodingSettings::FloodingType::GAS_FLOODING )
|
||||
{
|
||||
residualOil =
|
||||
resultData.cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::sogcr() ), 0 );
|
||||
}
|
||||
else if ( floodingSettings.oilFlooding() == RigFloodingSettings::FloodingType::WATER_FLOODING )
|
||||
{
|
||||
residualOil =
|
||||
resultData.cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::sowcr() ), 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
residualOil.resize( nSamples, floodingSettings.oilUserDefFlooding() );
|
||||
}
|
||||
}
|
||||
|
||||
if ( residualOil.empty() ) residualOil.resize( nSamples, 0.0 );
|
||||
|
||||
return residualOil;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<double> RigEclipseContourMapProjection::residualGasData( RigCaseCellResultsData& resultData,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
RigFloodingSettings& floodingSettings,
|
||||
size_t nSamples )
|
||||
{
|
||||
std::vector<double> residualGas;
|
||||
|
||||
if ( ( resultAggregation == RigContourMapCalculator::MOBILE_GAS_COLUMN ) ||
|
||||
( resultAggregation == RigContourMapCalculator::MOBILE_HYDROCARBON_COLUMN ) )
|
||||
{
|
||||
if ( floodingSettings.gasFlooding() == RigFloodingSettings::FloodingType::GAS_FLOODING )
|
||||
{
|
||||
residualGas =
|
||||
resultData.cellScalarResults( RigEclipseResultAddress( RiaDefines::ResultCatType::STATIC_NATIVE, RiaResultNames::sogcr() ), 0 );
|
||||
}
|
||||
else if ( floodingSettings.gasFlooding() == RigFloodingSettings::FloodingType::USER_DEFINED )
|
||||
{
|
||||
residualGas.resize( nSamples, floodingSettings.gasUserDefFlooding() );
|
||||
}
|
||||
}
|
||||
if ( residualGas.empty() ) residualGas.resize( nSamples, 0.0 );
|
||||
|
||||
return residualGas;
|
||||
}
|
@ -20,16 +20,19 @@
|
||||
|
||||
#include "RigContourMapCalculator.h"
|
||||
#include "RigContourMapProjection.h"
|
||||
#include "RigEclipseResultAddress.h"
|
||||
#include "RigFloodingSettings.h"
|
||||
|
||||
#include "cvfBoundingBox.h"
|
||||
|
||||
#include <set>
|
||||
|
||||
class RigActiveCellInfo;
|
||||
class RigMainGrid;
|
||||
class RigContourMapGrid;
|
||||
class RigResultAccessor;
|
||||
class RigEclipseCaseData;
|
||||
class RigCaseCellResultsData;
|
||||
class RigEclipseResultAddress;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
@ -45,18 +48,21 @@ public:
|
||||
|
||||
void generateAndSaveResults( const RigEclipseResultAddress& resultAddress,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep );
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings );
|
||||
|
||||
std::vector<double> generateResults( const RigEclipseResultAddress& resultAddress,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep ) const;
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings ) const;
|
||||
|
||||
static std::pair<bool, std::vector<double>> generateResults( const RigEclipseContourMapProjection& contourMapProjection,
|
||||
const RigContourMapGrid& contourMapGrid,
|
||||
RigCaseCellResultsData& resultData,
|
||||
const RigEclipseResultAddress& resultAddress,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep );
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings );
|
||||
|
||||
std::vector<bool> getMapCellVisibility( int viewStepIndex, RigContourMapCalculator::ResultAggregationType resultAggregation ) override;
|
||||
|
||||
@ -71,12 +77,23 @@ protected:
|
||||
double getParameterWeightForCell( size_t cellResultIdx, const std::vector<double>& parameterWeights ) const override;
|
||||
size_t gridResultIndex( size_t globalCellIdx ) const override;
|
||||
|
||||
// Eclipse implementation specific data generation methods
|
||||
std::vector<double> calculateColumnResult( RigContourMapCalculator::ResultAggregationType resultAggregation, int timeStep ) const;
|
||||
|
||||
static std::vector<double> calculateColumnResult( RigCaseCellResultsData& resultData,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
int timeStep );
|
||||
int timeStep,
|
||||
RigFloodingSettings& floodingSettings );
|
||||
|
||||
static std::set<RigEclipseResultAddress> neededResults( RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
RigFloodingSettings& floodingSettings );
|
||||
|
||||
static std::vector<double> residualOilData( RigCaseCellResultsData& resultData,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
RigFloodingSettings& floodingSettings,
|
||||
size_t nSamples );
|
||||
|
||||
static std::vector<double> residualGasData( RigCaseCellResultsData& resultData,
|
||||
RigContourMapCalculator::ResultAggregationType resultAggregation,
|
||||
RigFloodingSettings& floodingSettings,
|
||||
size_t nSamples );
|
||||
|
||||
protected:
|
||||
RigEclipseCaseData& m_eclipseCaseData;
|
@ -0,0 +1,88 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2025 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 "RigFloodingSettings.h"
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFloodingSettings::RigFloodingSettings( FloodingType oilFloodingType,
|
||||
double userDefFloodingOil,
|
||||
FloodingType gasFloodingType,
|
||||
double userDefFloodingGas )
|
||||
{
|
||||
m_gasFloodingType = gasFloodingType;
|
||||
m_oilFloodingType = oilFloodingType;
|
||||
m_userDefFloodingGas = userDefFloodingGas;
|
||||
m_userDefFloodingOil = userDefFloodingOil;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFloodingSettings::~RigFloodingSettings()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFloodingSettings::FloodingType RigFloodingSettings::oilFlooding() const
|
||||
{
|
||||
return m_oilFloodingType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigFloodingSettings::FloodingType RigFloodingSettings::gasFlooding() const
|
||||
{
|
||||
return m_gasFloodingType;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFloodingSettings::oilUserDefFlooding() const
|
||||
{
|
||||
return m_userDefFloodingOil;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigFloodingSettings::gasUserDefFlooding() const
|
||||
{
|
||||
return m_userDefFloodingGas;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFloodingSettings::needsSogcr() const
|
||||
{
|
||||
return ( m_gasFloodingType == FloodingType::GAS_FLOODING ) || ( m_oilFloodingType == FloodingType::GAS_FLOODING );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigFloodingSettings::needsSowcr() const
|
||||
{
|
||||
return ( m_gasFloodingType == FloodingType::WATER_FLOODING ) || ( m_oilFloodingType == FloodingType::WATER_FLOODING );
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2025 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
|
||||
|
||||
class RigFloodingSettings
|
||||
{
|
||||
public:
|
||||
enum class FloodingType
|
||||
{
|
||||
WATER_FLOODING,
|
||||
GAS_FLOODING,
|
||||
USER_DEFINED
|
||||
};
|
||||
|
||||
public:
|
||||
RigFloodingSettings( FloodingType oilFloodingType, double userDefFloodingOil, FloodingType gasFloodingType, double userDefFloodingGas );
|
||||
~RigFloodingSettings();
|
||||
|
||||
FloodingType oilFlooding() const;
|
||||
FloodingType gasFlooding() const;
|
||||
double oilUserDefFlooding() const;
|
||||
double gasUserDefFlooding() const;
|
||||
|
||||
bool needsSogcr() const;
|
||||
bool needsSowcr() const;
|
||||
|
||||
protected:
|
||||
FloodingType m_oilFloodingType;
|
||||
double m_userDefFloodingOil;
|
||||
|
||||
FloodingType m_gasFloodingType;
|
||||
double m_userDefFloodingGas;
|
||||
};
|
Loading…
Reference in New Issue
Block a user