#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 committed 2025-12-09 12:41:35 +01:00
1 parent 6e1ba530c4
commit dc89bf8de8
6 files changed
+93 -10

No files matched your search

@@ -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 );
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------