#13303 Adds PCGW curve support to relative permeability plot

Extends the relative permeability plot to support PCGW curves, which are relevant in gas/water systems.

This involves:
- Adding PCGW curve styling to the plot's QSS themes.
- Modifying the plot panel to handle PCGW curves, including
  dynamically updating checkbox labels based on the available phases
  to reflect the correct PC* name (PCOG or PCGW).
This commit is contained in:
Magne Sjaastad
2025-12-09 12:41:35 +01:00
parent 6e1ba530c4
commit dc89bf8de8
6 changed files with 93 additions and 10 deletions
@@ -170,6 +170,11 @@ QwtPlot["RelPermPlot"]::curve["PCOG"] {
symbol-color: $senaryColor;
}
QwtPlot["RelPermPlot"]::curve["PCGW"] {
line-color: $senaryColor;
symbol-color: $senaryColor;
}
/* Imbibition curves - using similar colors but slightly differentiated */
QwtPlot["RelPermPlot"]::curve["IKRW"] {
line-color: $curveColorWater2;
@@ -201,6 +206,11 @@ QwtPlot["RelPermPlot"]::curve["IPCOG"] {
symbol-color: $senaryColor;
}
QwtPlot["RelPermPlot"]::curve["IPCGW"] {
line-color: $senaryColor;
symbol-color: $senaryColor;
}
QwtPlot["PvtPlot"]::lineMarker["*"] {
color: $textColor;
}
@@ -98,6 +98,11 @@ QwtPlot["RelPermPlot"]::curve["PCOG"] {
symbol-color: $senaryColor;
}
QwtPlot["RelPermPlot"]::curve["PCGW"] {
line-color: $senaryColor;
symbol-color: $senaryColor;
}
/* Imbibition curves - using similar colors but slightly differentiated */
QwtPlot["RelPermPlot"]::curve["IKRW"] {
line-color: $curveColorWater2;
@@ -129,6 +134,11 @@ QwtPlot["RelPermPlot"]::curve["IPCOG"] {
symbol-color: $senaryColor;
}
QwtPlot["RelPermPlot"]::curve["IPCGW"] {
line-color: $senaryColor;
symbol-color: $senaryColor;
}
QwtPlot["PvtPlot"]::lineMarker["*"] {
color: $textColor;
}
@@ -87,6 +87,11 @@ QwtPlot["RelPermPlot"]::curve["PCOG"] {
symbol-color: $senaryColor;
}
QwtPlot["RelPermPlot"]::curve["PCGW"] {
line-color: $senaryColor;
symbol-color: $senaryColor;
}
/* Imbibition curves - using similar colors but slightly differentiated */
QwtPlot["RelPermPlot"]::curve["IKRW"] {
line-color: $curveColorWater2;
@@ -118,6 +123,11 @@ QwtPlot["RelPermPlot"]::curve["IPCOG"] {
symbol-color: $senaryColor;
}
QwtPlot["RelPermPlot"]::curve["IPCGW"] {
line-color: $senaryColor;
symbol-color: $senaryColor;
}
QwtPlot["PvtPlot"]::lineMarker["*"] {
color: $textColor;
}
@@ -19,8 +19,10 @@
#include "RiuRelativePermeabilityPlotPanel.h"
#include "RiaCurveDataTools.h"
#include "RiaDefines.h"
#include "RiaEclipseUnitTools.h"
#include "RiaInterpolationTools.h"
#include "RiaPhaseTools.h"
#include "RiaPlotDefines.h"
#include "RiaResultNames.h"
@@ -264,7 +266,8 @@ void RiuRelativePermeabilityPlotPanel::setPlotData( RiaDefines::EclipseUnitSyste
double swat,
double sgas,
const QString& caseName,
const QString& cellReferenceText )
const QString& cellReferenceText,
const std::set<RiaDefines::PhaseType>& availablePhases )
{
// cvf::Trace::show("Set RelPerm plot data");
@@ -274,7 +277,9 @@ void RiuRelativePermeabilityPlotPanel::setPlotData( RiaDefines::EclipseUnitSyste
m_sgas = sgas;
m_caseName = caseName;
m_cellReferenceText = cellReferenceText;
m_availablePhases = availablePhases;
updateCheckboxTexts();
plotUiSelectedCurves();
}
@@ -313,7 +318,19 @@ void RiuRelativePermeabilityPlotPanel::clearPlot()
m_caseName.clear();
m_cellReferenceText.clear();
plotCurvesInQwt( m_unitSystem, m_allCurvesArr, m_swat, m_sgas, m_cellReferenceText, false, true, true, m_qwtPlot, &m_myPlotMarkers, false, false );
plotCurvesInQwt( m_unitSystem,
m_allCurvesArr,
m_swat,
m_sgas,
m_cellReferenceText,
false,
true,
true,
m_qwtPlot,
&m_myPlotMarkers,
false,
false,
m_availablePhases );
}
//--------------------------------------------------------------------------------------------------
@@ -353,7 +370,8 @@ void RiuRelativePermeabilityPlotPanel::plotUiSelectedCurves()
m_qwtPlot,
&m_myPlotMarkers,
m_showScaledCheckBox->isChecked(),
m_showUnscaledCheckBox->isChecked() );
m_showUnscaledCheckBox->isChecked(),
m_availablePhases );
}
//--------------------------------------------------------------------------------------------------
@@ -417,7 +435,8 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
bool showScaled,
bool showUnscaled )
bool showUnscaled,
const std::set<RiaDefines::PhaseType>& availablePhases )
{
bool skipUnscaledLegends = showScaled && showUnscaled;
@@ -454,13 +473,27 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt( RiaDefines::EclipseUnitS
plotOnWhichYAxis = RIGHT_YAXIS;
}
QwtPlotCurve* qwtCurve = new QwtPlotCurve( curve.name.c_str() );
// Determine display name for the curve
std::string displayName = curve.name;
if ( curve.ident == RigFlowDiagDefines::RelPermCurve::PCOG )
{
std::string preferredName;
if ( curve.curveSet == RigFlowDiagDefines::RelPermCurve::IMBIBITION )
{
preferredName += "I";
}
preferredName += RiaPhaseTools::getPreferredPcogName( availablePhases ).toStdString();
displayName = preferredName;
}
QwtPlotCurve* qwtCurve = new QwtPlotCurve( displayName.c_str() );
CVF_ASSERT( curve.saturationVals.size() == curve.yVals.size() );
qwtCurve->setSamples( curve.saturationVals.data(), curve.yVals.data(), static_cast<int>( curve.saturationVals.size() ) );
// Use the actual curve name which includes "I" prefix for imbibition curves
qwtCurve->setTitle( curve.name.c_str() );
// Use the display name which may be modified for GAS/WATER cases
qwtCurve->setTitle( displayName.c_str() );
qwtCurve->setStyle( QwtPlotCurve::Lines );
@@ -822,6 +855,19 @@ QString RiuRelativePermeabilityPlotPanel::asciiDataForUiSelectedCurves() const
return outTxt;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RiuRelativePermeabilityPlotPanel::updateCheckboxTexts()
{
// Update PCOG checkbox text to PCGW for GAS/WATER cases
if ( auto button = m_selectedCurvesButtonGroup->button( RigFlowDiagDefines::RelPermCurve::PCOG ) )
{
QString preferredName = RiaPhaseTools::getPreferredPcogName( m_availablePhases );
button->setText( preferredName );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@@ -20,6 +20,8 @@
#include "RiaDefines.h"
#include <set>
#include "RigFlowDiagDefines.h"
#include <QPointer>
@@ -56,7 +58,8 @@ public:
double swat,
double sgas,
const QString& caseName,
const QString& cellReferenceText );
const QString& cellReferenceText,
const std::set<RiaDefines::PhaseType>& availablePhases );
void enableImbibitionCurveSelection( bool enable );
@@ -84,7 +87,8 @@ private:
QwtPlot* plot,
std::vector<QwtPlotMarker*>* myPlotMarkers,
bool showScaled,
bool showUnscaled );
bool showUnscaled,
const std::set<RiaDefines::PhaseType>& availablePhases );
static QwtPlotCurve* getLegendCurve( QString title, bool scaled );
@@ -110,6 +114,7 @@ private:
std::vector<RigFlowDiagDefines::RelPermCurve> gatherUiSelectedCurves() const;
QString asciiDataForUiSelectedCurves() const;
void updateCheckboxTexts();
const QwtPlotCurve* closestCurveSample( const QPoint& cursorPosition, int* closestSampleIndex ) const;
void updateTrackerPlotMarkerAndLabelFromPicker();
@@ -132,6 +137,7 @@ private:
double m_sgas;
QString m_caseName;
QString m_cellReferenceText;
std::set<RiaDefines::PhaseType> m_availablePhases;
QPointer<RiuDockedQwtPlot> m_qwtPlot;
std::vector<QwtPlotMarker*> m_myPlotMarkers;
@@ -254,7 +254,8 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot( const RimEclips
const bool enableImbibitionCurveSelection = ( imbnumAccessor.notNull() && imbnumAccessor->cellScalar( gridLocalCellIndex ) > 0 );
m_targetPlotPanel->enableImbibitionCurveSelection( enableImbibitionCurveSelection );
m_targetPlotPanel->setPlotData( eclipseCaseData->unitsType(), relPermCurveArr, cellSWAT, cellSGAS, caseName, cellRefText );
const auto phases = eclipseCaseData->availablePhases();
m_targetPlotPanel->setPlotData( eclipseCaseData->unitsType(), relPermCurveArr, cellSWAT, cellSGAS, caseName, cellRefText, phases );
return true;
}