mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2063 Added support for showing RelPerm plot curves without end-point scaling
This commit is contained in:
@@ -624,19 +624,24 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
|
|||||||
curveIdentNameArr.push_back(std::make_pair(RelPermCurve::PCOG, "PCOG")); satFuncRequests.push_back(pcgo);
|
curveIdentNameArr.push_back(std::make_pair(RelPermCurve::PCOG, "PCOG")); satFuncRequests.push_back(pcgo);
|
||||||
curveIdentNameArr.push_back(std::make_pair(RelPermCurve::PCOW, "PCOW")); satFuncRequests.push_back(pcow);
|
curveIdentNameArr.push_back(std::make_pair(RelPermCurve::PCOW, "PCOW")); satFuncRequests.push_back(pcow);
|
||||||
|
|
||||||
const bool useEPS = true;
|
// Calculate and return curves both with and without endpoint scaling and tag them accordingly
|
||||||
std::vector<Opm::FlowDiagnostics::Graph> graphArr = m_opmFlowDiagStaticData->m_eclSaturationFunc->getSatFuncCurve(satFuncRequests, static_cast<int>(activeCellIndex), useEPS);
|
// Must use two calls to achieve this
|
||||||
|
const std::array<RelPermCurve::EpsMode, 2> epsModeArr = { RelPermCurve::EPS_ON , RelPermCurve::EPS_OFF };
|
||||||
for (size_t i = 0; i < graphArr.size(); i++)
|
for (RelPermCurve::EpsMode epsMode : epsModeArr)
|
||||||
{
|
{
|
||||||
const RelPermCurve::Ident curveIdent = curveIdentNameArr[i].first;
|
const bool useEps = epsMode == RelPermCurve::EPS_ON ? true : false;
|
||||||
const std::string curveName = curveIdentNameArr[i].second;
|
std::vector<Opm::FlowDiagnostics::Graph> graphArr = m_opmFlowDiagStaticData->m_eclSaturationFunc->getSatFuncCurve(satFuncRequests, static_cast<int>(activeCellIndex), useEps);
|
||||||
const Opm::FlowDiagnostics::Graph& srcGraph = graphArr[i];
|
for (size_t i = 0; i < graphArr.size(); i++)
|
||||||
if (srcGraph.first.size() > 0)
|
|
||||||
{
|
{
|
||||||
const std::vector<double>& xVals = srcGraph.first;
|
const RelPermCurve::Ident curveIdent = curveIdentNameArr[i].first;
|
||||||
const std::vector<double>& yVals = srcGraph.second;
|
const std::string curveName = curveIdentNameArr[i].second;
|
||||||
retCurveArr.push_back({ curveIdent, curveName, xVals, yVals});
|
const Opm::FlowDiagnostics::Graph& srcGraph = graphArr[i];
|
||||||
|
if (srcGraph.first.size() > 0)
|
||||||
|
{
|
||||||
|
const std::vector<double>& xVals = srcGraph.first;
|
||||||
|
const std::vector<double>& yVals = srcGraph.second;
|
||||||
|
retCurveArr.push_back({ curveIdent, curveName, epsMode, xVals, yVals });
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,9 +78,11 @@ public:
|
|||||||
struct RelPermCurve
|
struct RelPermCurve
|
||||||
{
|
{
|
||||||
enum Ident { KRW, KRG, KROW, KROG, PCOW, PCOG };
|
enum Ident { KRW, KRG, KROW, KROG, PCOW, PCOG };
|
||||||
|
enum EpsMode { EPS_ON, EPS_OFF };
|
||||||
|
|
||||||
Ident ident;
|
Ident ident;
|
||||||
std::string name;
|
std::string name;
|
||||||
|
EpsMode epsMode;
|
||||||
std::vector<double> xVals;
|
std::vector<double> xVals;
|
||||||
std::vector<double> yVals;
|
std::vector<double> yVals;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -100,8 +100,11 @@ RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel(QDockWidget*
|
|||||||
groupBoxLayout->addWidget(checkButtonList[i]);
|
groupBoxLayout->addWidget(checkButtonList[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_showUnscaledCheckBox = new QCheckBox("Show Unscaled");
|
||||||
|
|
||||||
QVBoxLayout* leftLayout = new QVBoxLayout;
|
QVBoxLayout* leftLayout = new QVBoxLayout;
|
||||||
leftLayout->addWidget(groupBox);
|
leftLayout->addWidget(groupBox);
|
||||||
|
leftLayout->addWidget(m_showUnscaledCheckBox);
|
||||||
leftLayout->addStretch(1);
|
leftLayout->addStretch(1);
|
||||||
|
|
||||||
QHBoxLayout* mainLayout = new QHBoxLayout();
|
QHBoxLayout* mainLayout = new QHBoxLayout();
|
||||||
@@ -111,6 +114,7 @@ RiuRelativePermeabilityPlotPanel::RiuRelativePermeabilityPlotPanel(QDockWidget*
|
|||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
connect(m_selectedCurvesButtonGroup, SIGNAL(buttonClicked(int)), SLOT(slotButtonInButtonGroupClicked(int)));
|
connect(m_selectedCurvesButtonGroup, SIGNAL(buttonClicked(int)), SLOT(slotButtonInButtonGroupClicked(int)));
|
||||||
|
connect(m_showUnscaledCheckBox, SIGNAL(stateChanged(int)), SLOT(slotUnscaledCheckBoxStateChanged(int)));
|
||||||
|
|
||||||
plotUiSelectedCurves();
|
plotUiSelectedCurves();
|
||||||
}
|
}
|
||||||
@@ -193,14 +197,21 @@ void RiuRelativePermeabilityPlotPanel::clearPlot()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuRelativePermeabilityPlotPanel::plotUiSelectedCurves()
|
void RiuRelativePermeabilityPlotPanel::plotUiSelectedCurves()
|
||||||
{
|
{
|
||||||
// Determine which curves to actually plot based on selection in GUI
|
|
||||||
std::vector<RigFlowDiagSolverInterface::RelPermCurve> selectedCurves;
|
std::vector<RigFlowDiagSolverInterface::RelPermCurve> selectedCurves;
|
||||||
|
|
||||||
|
// Determine which curves to actually plot based on selection in GUI
|
||||||
|
const RigFlowDiagSolverInterface::RelPermCurve::EpsMode epsModeToShow = m_showUnscaledCheckBox->isChecked() ? RigFlowDiagSolverInterface::RelPermCurve::EPS_OFF : RigFlowDiagSolverInterface::RelPermCurve::EPS_ON;
|
||||||
|
|
||||||
for (size_t i = 0; i < m_allCurvesArr.size(); i++)
|
for (size_t i = 0; i < m_allCurvesArr.size(); i++)
|
||||||
{
|
{
|
||||||
const RigFlowDiagSolverInterface::RelPermCurve::Ident curveIdent = m_allCurvesArr[i].ident;
|
const RigFlowDiagSolverInterface::RelPermCurve::Ident curveIdent = m_allCurvesArr[i].ident;
|
||||||
if (m_selectedCurvesButtonGroup->button(curveIdent) && m_selectedCurvesButtonGroup->button(curveIdent)->isChecked())
|
const RigFlowDiagSolverInterface::RelPermCurve::EpsMode curveEpsMode = m_allCurvesArr[i].epsMode;
|
||||||
{
|
|
||||||
selectedCurves.push_back(m_allCurvesArr[i]);
|
if (curveEpsMode == epsModeToShow) {
|
||||||
|
if (m_selectedCurvesButtonGroup->button(curveIdent) && m_selectedCurvesButtonGroup->button(curveIdent)->isChecked())
|
||||||
|
{
|
||||||
|
selectedCurves.push_back(m_allCurvesArr[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,12 +297,12 @@ void RiuRelativePermeabilityPlotPanel::plotCurvesInQwt(const std::vector<RigFlow
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString title = "Relative Permeability";
|
QString titleStr = "Relative Permeability";
|
||||||
if (!cellReferenceText.isEmpty())
|
if (!cellReferenceText.isEmpty())
|
||||||
{
|
{
|
||||||
title += ", " + cellReferenceText;
|
titleStr += ", " + cellReferenceText;
|
||||||
}
|
}
|
||||||
plot->setTitle(title);
|
plot->setTitle(titleStr);
|
||||||
|
|
||||||
plot->setAxisTitle(QwtPlot::xBottom, "Saturation");
|
plot->setAxisTitle(QwtPlot::xBottom, "Saturation");
|
||||||
plot->setAxisTitle(QwtPlot::yLeft, "Kr");
|
plot->setAxisTitle(QwtPlot::yLeft, "Kr");
|
||||||
@@ -313,3 +324,12 @@ void RiuRelativePermeabilityPlotPanel::slotButtonInButtonGroupClicked(int)
|
|||||||
plotUiSelectedCurves();
|
plotUiSelectedCurves();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RiuRelativePermeabilityPlotPanel::slotUnscaledCheckBoxStateChanged(int)
|
||||||
|
{
|
||||||
|
plotUiSelectedCurves();
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
class QDockWidget;
|
class QDockWidget;
|
||||||
class QButtonGroup;
|
class QButtonGroup;
|
||||||
|
class QCheckBox;
|
||||||
class QwtPlot;
|
class QwtPlot;
|
||||||
|
|
||||||
|
|
||||||
@@ -50,6 +51,7 @@ private:
|
|||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slotButtonInButtonGroupClicked(int);
|
void slotButtonInButtonGroupClicked(int);
|
||||||
|
void slotUnscaledCheckBoxStateChanged(int);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<RigFlowDiagSolverInterface::RelPermCurve> m_allCurvesArr;
|
std::vector<RigFlowDiagSolverInterface::RelPermCurve> m_allCurvesArr;
|
||||||
@@ -58,5 +60,6 @@ private:
|
|||||||
QString m_cellReferenceText;
|
QString m_cellReferenceText;
|
||||||
QwtPlot* m_qwtPlot;
|
QwtPlot* m_qwtPlot;
|
||||||
QButtonGroup* m_selectedCurvesButtonGroup;
|
QButtonGroup* m_selectedCurvesButtonGroup;
|
||||||
|
QCheckBox* m_showUnscaledCheckBox;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user