2019-03-18 06:41:44 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2019- 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 "RimSaturationPressurePlot.h"
|
|
|
|
|
2019-03-19 08:26:31 -05:00
|
|
|
#include "RigCaseCellResultsData.h"
|
2019-03-19 03:28:00 -05:00
|
|
|
#include "RigEclipseCaseData.h"
|
|
|
|
#include "RigEquil.h"
|
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
#include "RimEclipseResultCase.h"
|
2019-03-19 03:28:00 -05:00
|
|
|
#include "RimEclipseResultDefinition.h"
|
2019-03-18 06:41:44 -05:00
|
|
|
#include "RimGridCrossPlotCurveSet.h"
|
|
|
|
#include "RimPlotAxisAnnotation.h"
|
|
|
|
#include "RimPlotAxisProperties.h"
|
|
|
|
|
2019-03-19 03:28:00 -05:00
|
|
|
#include "CellFilters/RimPlotCellPropertyFilter.h"
|
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
CAF_PDM_SOURCE_INIT(RimSaturationPressurePlot, "RimSaturationPressurePlot");
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimSaturationPressurePlot::RimSaturationPressurePlot()
|
|
|
|
{
|
|
|
|
CAF_PDM_InitObject("Saturation Pressure Plot", ":/SummaryXPlotLight16x16.png", "", "");
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-03-19 03:28:00 -05:00
|
|
|
void RimSaturationPressurePlot::assignCaseAndEquilibriumRegion(RiaDefines::PorosityModelType porosityType,
|
|
|
|
RimEclipseResultCase* eclipseResultCase,
|
|
|
|
int zeroBasedEquilRegionIndex)
|
2019-03-18 06:41:44 -05:00
|
|
|
{
|
2019-03-18 08:31:06 -05:00
|
|
|
nameConfig()->addDataSetNames = false;
|
2019-03-19 03:28:00 -05:00
|
|
|
|
|
|
|
QString caseName = eclipseResultCase->caseUserDescription();
|
|
|
|
QString plotTitle = QString("%1 - EQLNUM %2").arg(caseName).arg(zeroBasedEquilRegionIndex + 1);
|
2019-03-18 08:31:06 -05:00
|
|
|
|
|
|
|
nameConfig()->setCustomName(plotTitle);
|
|
|
|
|
2019-03-19 03:28:00 -05:00
|
|
|
auto equilData = eclipseResultCase->eclipseCaseData()->equilData();
|
|
|
|
auto eq = equilData[zeroBasedEquilRegionIndex];
|
|
|
|
|
|
|
|
double gasOilContactDepth = eq.gasOilContactDepth();
|
|
|
|
double waterOilContactDepth = eq.waterOilContactDepth();
|
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
{
|
2019-03-19 08:26:31 -05:00
|
|
|
// Blue PRESSURE curve with data for specified EQLNUM value
|
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
RimGridCrossPlotCurveSet* curveSet = createCurveSet();
|
2019-03-19 08:26:31 -05:00
|
|
|
curveSet->configureForPressureSaturationCurves(eclipseResultCase, "PRESSURE");
|
2019-03-18 08:31:06 -05:00
|
|
|
curveSet->setCustomColor(cvf::Color3::BLUE);
|
2019-03-19 03:28:00 -05:00
|
|
|
|
2019-03-19 08:26:31 -05:00
|
|
|
RimPlotCellPropertyFilter* cellFilter =
|
|
|
|
createEquilibriumRegionPropertyFilter(eclipseResultCase, zeroBasedEquilRegionIndex);
|
2019-03-19 03:28:00 -05:00
|
|
|
|
|
|
|
curveSet->addCellFilter(cellFilter);
|
2019-03-18 06:41:44 -05:00
|
|
|
}
|
2019-03-19 08:26:31 -05:00
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
{
|
2019-03-19 08:26:31 -05:00
|
|
|
// Red dew pressure (PDEW) curve with data for specified EQLNUM value, filtered on depth by gasOilContact
|
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
RimGridCrossPlotCurveSet* curveSet = createCurveSet();
|
2019-03-19 08:26:31 -05:00
|
|
|
curveSet->configureForPressureSaturationCurves(eclipseResultCase, "PDEW");
|
2019-03-18 08:31:06 -05:00
|
|
|
curveSet->setCustomColor(cvf::Color3::RED);
|
2019-03-19 03:28:00 -05:00
|
|
|
|
2019-03-19 08:26:31 -05:00
|
|
|
RimPlotCellPropertyFilter* cellFilter =
|
|
|
|
createEquilibriumRegionPropertyFilter(eclipseResultCase, zeroBasedEquilRegionIndex);
|
|
|
|
curveSet->addCellFilter(cellFilter);
|
2019-03-19 03:28:00 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
RigCaseCellResultsData* caseCellResultsData = eclipseResultCase->eclipseCaseData()->results(porosityType);
|
|
|
|
if (caseCellResultsData)
|
|
|
|
{
|
|
|
|
RigEclipseResultAddress depthResultAddress(RiaDefines::STATIC_NATIVE, "DEPTH");
|
|
|
|
|
|
|
|
double minDepth = 0.0;
|
|
|
|
double maxDepth = 0.0;
|
|
|
|
caseCellResultsData->minMaxCellScalarValues(depthResultAddress, minDepth, maxDepth);
|
|
|
|
|
|
|
|
maxDepth = gasOilContactDepth;
|
|
|
|
|
2019-03-19 08:26:31 -05:00
|
|
|
RimPlotCellPropertyFilter* depthCellFilter = createDepthPropertyFilter(eclipseResultCase, minDepth, maxDepth);
|
2019-03-19 03:28:00 -05:00
|
|
|
|
|
|
|
curveSet->addCellFilter(depthCellFilter);
|
|
|
|
}
|
|
|
|
}
|
2019-03-18 06:41:44 -05:00
|
|
|
}
|
2019-03-19 03:28:00 -05:00
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
{
|
2019-03-19 08:26:31 -05:00
|
|
|
// Green bubble point pressure (PBUB) curve with data for specified EQLNUM value, filtered on depth between gasOilContact
|
|
|
|
// and waterOilContactDepth
|
|
|
|
|
2019-03-18 06:41:44 -05:00
|
|
|
RimGridCrossPlotCurveSet* curveSet = createCurveSet();
|
2019-03-19 08:26:31 -05:00
|
|
|
curveSet->configureForPressureSaturationCurves(eclipseResultCase, "PBUB");
|
2019-03-18 08:31:06 -05:00
|
|
|
curveSet->setCustomColor(cvf::Color3::GREEN);
|
2019-03-19 03:28:00 -05:00
|
|
|
|
|
|
|
{
|
|
|
|
RimPlotCellPropertyFilter* cellFilter = new RimPlotCellPropertyFilter();
|
|
|
|
{
|
|
|
|
RimEclipseResultDefinition* resultDefinition = new RimEclipseResultDefinition();
|
|
|
|
resultDefinition->setEclipseCase(eclipseResultCase);
|
|
|
|
resultDefinition->setResultType(RiaDefines::STATIC_NATIVE);
|
|
|
|
resultDefinition->setResultVariable("EQLNUM");
|
|
|
|
|
|
|
|
cellFilter->setResultDefinition(resultDefinition);
|
|
|
|
}
|
|
|
|
|
|
|
|
cellFilter->setValueRange(zeroBasedEquilRegionIndex + 1, zeroBasedEquilRegionIndex + 1);
|
|
|
|
|
|
|
|
curveSet->addCellFilter(cellFilter);
|
|
|
|
}
|
2019-03-19 08:26:31 -05:00
|
|
|
|
2019-03-19 03:28:00 -05:00
|
|
|
{
|
|
|
|
RigCaseCellResultsData* caseCellResultsData = eclipseResultCase->eclipseCaseData()->results(porosityType);
|
|
|
|
if (caseCellResultsData)
|
|
|
|
{
|
|
|
|
RigEclipseResultAddress depthResultAddress(RiaDefines::STATIC_NATIVE, "DEPTH");
|
|
|
|
|
|
|
|
double minDepth = 0.0;
|
|
|
|
double maxDepth = 0.0;
|
|
|
|
caseCellResultsData->minMaxCellScalarValues(depthResultAddress, minDepth, maxDepth);
|
|
|
|
|
|
|
|
minDepth = gasOilContactDepth;
|
|
|
|
maxDepth = waterOilContactDepth;
|
|
|
|
|
2019-03-19 08:26:31 -05:00
|
|
|
RimPlotCellPropertyFilter* depthCellFilter = createDepthPropertyFilter(eclipseResultCase, minDepth, maxDepth);
|
2019-03-19 03:28:00 -05:00
|
|
|
|
|
|
|
curveSet->addCellFilter(depthCellFilter);
|
|
|
|
}
|
|
|
|
}
|
2019-03-18 06:41:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
RimPlotAxisProperties* yAxisProps = yAxisProperties();
|
|
|
|
|
|
|
|
yAxisProps->setInvertedAxis(true);
|
|
|
|
|
|
|
|
{
|
|
|
|
RimPlotAxisAnnotation* annotation = new RimPlotAxisAnnotation;
|
2019-03-19 03:28:00 -05:00
|
|
|
annotation->setEquilibriumData(
|
|
|
|
eclipseResultCase, zeroBasedEquilRegionIndex, RimPlotAxisAnnotation::PL_EQUIL_GAS_OIL_CONTACT);
|
2019-03-18 06:41:44 -05:00
|
|
|
|
|
|
|
yAxisProps->appendAnnotation(annotation);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
RimPlotAxisAnnotation* annotation = new RimPlotAxisAnnotation;
|
2019-03-19 03:28:00 -05:00
|
|
|
annotation->setEquilibriumData(
|
|
|
|
eclipseResultCase, zeroBasedEquilRegionIndex, RimPlotAxisAnnotation::PL_EQUIL_WATER_OIL_CONTACT);
|
2019-03-18 06:41:44 -05:00
|
|
|
|
|
|
|
yAxisProps->appendAnnotation(annotation);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
void RimSaturationPressurePlot::initAfterRead()
|
|
|
|
{
|
|
|
|
yAxisProperties()->showAnnotationObjectsInProjectTree();
|
|
|
|
|
|
|
|
RimGridCrossPlot::initAfterRead();
|
|
|
|
}
|
2019-03-19 08:26:31 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimPlotCellPropertyFilter*
|
|
|
|
RimSaturationPressurePlot::createEquilibriumRegionPropertyFilter(RimEclipseResultCase* eclipseResultCase,
|
|
|
|
int zeroBasedEquilRegionIndex)
|
|
|
|
{
|
|
|
|
RimPlotCellPropertyFilter* cellFilter = new RimPlotCellPropertyFilter();
|
|
|
|
|
|
|
|
RimEclipseResultDefinition* resultDefinition = new RimEclipseResultDefinition();
|
|
|
|
resultDefinition->setEclipseCase(eclipseResultCase);
|
|
|
|
resultDefinition->setResultType(RiaDefines::STATIC_NATIVE);
|
|
|
|
resultDefinition->setResultVariable("EQLNUM");
|
|
|
|
|
|
|
|
cellFilter->setResultDefinition(resultDefinition);
|
|
|
|
|
|
|
|
cellFilter->setValueRange(zeroBasedEquilRegionIndex + 1, zeroBasedEquilRegionIndex + 1);
|
|
|
|
|
|
|
|
return cellFilter;
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
RimPlotCellPropertyFilter* RimSaturationPressurePlot::createDepthPropertyFilter(RimEclipseResultCase* eclipseResultCase,
|
|
|
|
double minDepth,
|
|
|
|
double maxDepth)
|
|
|
|
{
|
|
|
|
RimPlotCellPropertyFilter* depthCellFilter = new RimPlotCellPropertyFilter();
|
|
|
|
|
|
|
|
RimEclipseResultDefinition* resultDefinition = new RimEclipseResultDefinition();
|
|
|
|
resultDefinition->setEclipseCase(eclipseResultCase);
|
|
|
|
resultDefinition->setResultType(RiaDefines::STATIC_NATIVE);
|
|
|
|
resultDefinition->setResultVariable("DEPTH");
|
|
|
|
|
|
|
|
depthCellFilter->setResultDefinition(resultDefinition);
|
|
|
|
|
|
|
|
depthCellFilter->setValueRange(minDepth, maxDepth);
|
|
|
|
|
|
|
|
return depthCellFilter;
|
|
|
|
}
|