mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Added calculation of PVT related dynamic properties and display of these in the PVT FVF and Viscosity plots as a point marker. Started using flow diagnostics library's output unit conversion for PVT curves to align output units with the case units. #1990
This commit is contained in:
@@ -132,12 +132,14 @@ void RiuPvtPlotPanel::setPlotDefaults(QwtPlot* plot)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPvtPlotPanel::setPlotData(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, double pressure)
|
||||
void RiuPvtPlotPanel::setPlotData(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, FvfDynProps fvfDynProps, ViscosityDynProps viscosityDynProps, double pressure)
|
||||
{
|
||||
//cvf::Trace::show("RiuPvtPlotPanel::setPlotData()");
|
||||
|
||||
m_allFvfCurvesArr = fvfCurveArr;
|
||||
m_allViscosityCurvesArr = viscosityCurveArr;
|
||||
m_fvfDynProps = fvfDynProps;
|
||||
m_viscosityDynProps = viscosityDynProps;
|
||||
m_pressure = pressure;
|
||||
|
||||
plotUiSelectedCurves();
|
||||
@@ -157,6 +159,8 @@ void RiuPvtPlotPanel::clearPlot()
|
||||
|
||||
m_allFvfCurvesArr.clear();
|
||||
m_allViscosityCurvesArr.clear();
|
||||
m_fvfDynProps = FvfDynProps();
|
||||
m_viscosityDynProps = ViscosityDynProps();
|
||||
m_pressure = HUGE_VAL;
|
||||
|
||||
plotUiSelectedCurves();
|
||||
@@ -199,19 +203,31 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
|
||||
}
|
||||
|
||||
QString phaseString = "";
|
||||
if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS) phaseString = "Gas ";
|
||||
else if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL) phaseString = "Oil ";
|
||||
double fvfPointMarkerYValue = HUGE_VAL;
|
||||
double viscosityPointMarkerYValue = HUGE_VAL;
|
||||
if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::GAS)
|
||||
{
|
||||
phaseString = "Gas ";
|
||||
fvfPointMarkerYValue = m_fvfDynProps.bg;
|
||||
viscosityPointMarkerYValue = m_viscosityDynProps.mu_g;
|
||||
}
|
||||
else if (phaseToPlot == RigFlowDiagSolverInterface::PvtCurve::OIL)
|
||||
{
|
||||
phaseString = "Oil ";
|
||||
fvfPointMarkerYValue = m_fvfDynProps.bo;
|
||||
viscosityPointMarkerYValue = m_viscosityDynProps.mu_o;
|
||||
}
|
||||
|
||||
{
|
||||
const QString plotTitle = phaseString + "Formation Volume Factor";
|
||||
const QString yAxisTitle = phaseString + "Formation Volume Factor";
|
||||
plotCurvesInQwt(selectedFvfCurves, m_pressure, plotTitle, yAxisTitle, m_fvfPlot, &m_fvfPlotMarkers);
|
||||
plotCurvesInQwt(selectedFvfCurves, m_pressure, fvfPointMarkerYValue, plotTitle, yAxisTitle, m_fvfPlot, &m_fvfPlotMarkers);
|
||||
}
|
||||
|
||||
{
|
||||
const QString plotTitle = phaseString + "Viscosity";
|
||||
const QString yAxisTitle = phaseString + "Viscosity";
|
||||
plotCurvesInQwt(selectedViscosityCurves, m_pressure, plotTitle, yAxisTitle, m_viscosityPlot, &m_viscosityPlotMarkers);
|
||||
plotCurvesInQwt(selectedViscosityCurves, m_pressure, viscosityPointMarkerYValue, plotTitle, yAxisTitle, m_viscosityPlot, &m_viscosityPlotMarkers);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +236,7 @@ void RiuPvtPlotPanel::plotUiSelectedCurves()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuPvtPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers)
|
||||
void RiuPvtPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, double pointMarkerYValue, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers)
|
||||
{
|
||||
plot->detachItems(QwtPlotItem::Rtti_PlotCurve);
|
||||
|
||||
@@ -268,7 +284,7 @@ void RiuPvtPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterfa
|
||||
QwtPlotMarker* lineMarker = new QwtPlotMarker;
|
||||
lineMarker->setXValue(pressure);
|
||||
lineMarker->setLineStyle(QwtPlotMarker::VLine);
|
||||
lineMarker->setLinePen(QPen(Qt::black, 1, Qt::DashLine));
|
||||
lineMarker->setLinePen(QPen(QColor(128,0,255), 1, Qt::DashLine));
|
||||
lineMarker->setLabel(QString("PRESSURE"));
|
||||
lineMarker->setLabelAlignment(Qt::AlignTop | Qt::AlignRight);
|
||||
lineMarker->setLabelOrientation(Qt::Vertical);
|
||||
@@ -276,6 +292,20 @@ void RiuPvtPlotPanel::plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterfa
|
||||
myPlotMarkers->push_back(lineMarker);
|
||||
}
|
||||
|
||||
if (pressure != HUGE_VAL && pointMarkerYValue != HUGE_VAL)
|
||||
{
|
||||
QwtPlotMarker* pointMarker = new QwtPlotMarker;
|
||||
pointMarker->setValue(pressure, pointMarkerYValue);
|
||||
|
||||
QwtSymbol* symbol = new QwtSymbol(QwtSymbol::Ellipse);
|
||||
symbol->setSize(13, 13);
|
||||
symbol->setPen(QPen(QColor(128, 128, 255), 2));
|
||||
symbol->setBrush(Qt::NoBrush);
|
||||
pointMarker->setSymbol(symbol);
|
||||
pointMarker->attach(plot);
|
||||
myPlotMarkers->push_back(pointMarker);
|
||||
}
|
||||
|
||||
plot->setTitle(plotTitle);
|
||||
|
||||
plot->setAxisTitle(QwtPlot::xBottom, "Pressure");
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#include <cmath>
|
||||
#include <memory>
|
||||
|
||||
class RiuPvtPlotUpdater;
|
||||
@@ -40,18 +41,31 @@ class RiuPvtPlotPanel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
struct FvfDynProps
|
||||
{
|
||||
double bo = HUGE_VAL;
|
||||
double bg = HUGE_VAL;
|
||||
};
|
||||
|
||||
struct ViscosityDynProps
|
||||
{
|
||||
double mu_o = HUGE_VAL;
|
||||
double mu_g = HUGE_VAL;
|
||||
};
|
||||
|
||||
public:
|
||||
RiuPvtPlotPanel(QDockWidget* parent);
|
||||
virtual ~RiuPvtPlotPanel();
|
||||
|
||||
void setPlotData(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, double pressure);
|
||||
void setPlotData(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& fvfCurveArr, const std::vector<RigFlowDiagSolverInterface::PvtCurve>& viscosityCurveArr, FvfDynProps fvfDynProps, ViscosityDynProps viscosityDynProps, double pressure);
|
||||
void clearPlot();
|
||||
RiuPvtPlotUpdater* plotUpdater();
|
||||
|
||||
private:
|
||||
void plotUiSelectedCurves();
|
||||
static void setPlotDefaults(QwtPlot* plot);
|
||||
static void plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
|
||||
static void plotCurvesInQwt(const std::vector<RigFlowDiagSolverInterface::PvtCurve>& curveArr, double pressure, double pointMarkerYValue, QString plotTitle, QString yAxisTitle, QwtPlot* plot, std::vector<QwtPlotMarker*>* myPlotMarkers);
|
||||
|
||||
private slots:
|
||||
void slotPhaseComboCurrentIndexChanged(int);
|
||||
@@ -59,6 +73,8 @@ private slots:
|
||||
private:
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allFvfCurvesArr;
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> m_allViscosityCurvesArr;
|
||||
FvfDynProps m_fvfDynProps;
|
||||
ViscosityDynProps m_viscosityDynProps;
|
||||
double m_pressure;
|
||||
|
||||
QComboBox* m_phaseComboBox;
|
||||
|
||||
@@ -134,8 +134,8 @@ bool RiuPvtPlotUpdater::queryDataAndUpdatePlot(const RimEclipseView& eclipseView
|
||||
{
|
||||
//cvf::Trace::show("Update PVT plot for active cell index: %d", static_cast<int>(activeCellIndex));
|
||||
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> fvfCurveArr = eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurvesForActiveCell(RigFlowDiagSolverInterface::PVT_CT_FVF, activeCellIndex);
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> viscosityCurveArr = eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurvesForActiveCell(RigFlowDiagSolverInterface::PVT_CT_VISCOSITY, activeCellIndex);
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> fvfCurveArr = eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurves(RigFlowDiagSolverInterface::PVT_CT_FVF, activeCellIndex);
|
||||
std::vector<RigFlowDiagSolverInterface::PvtCurve> viscosityCurveArr = eclipseResultCase->flowDiagSolverInterface()->calculatePvtCurves(RigFlowDiagSolverInterface::PVT_CT_VISCOSITY, activeCellIndex);
|
||||
|
||||
const size_t timeStepIndex = static_cast<size_t>(eclipseView.currentTimeStep());
|
||||
|
||||
@@ -153,7 +153,13 @@ bool RiuPvtPlotUpdater::queryDataAndUpdatePlot(const RimEclipseView& eclipseView
|
||||
const double cellPressure = pressureAccessor.notNull() ? pressureAccessor->cellScalar(gridLocalCellIndex) : HUGE_VAL;
|
||||
//cvf::Trace::show("cellRS = %f cellRV = %f cellPressure = %f", cellRS, cellRV, cellPressure);
|
||||
|
||||
plotPanel->setPlotData(fvfCurveArr, viscosityCurveArr, cellPressure);
|
||||
RiuPvtPlotPanel::FvfDynProps fvfDynProps;
|
||||
eclipseResultCase->flowDiagSolverInterface()->calculatePvtDynamicPropertiesFvf(activeCellIndex, cellPressure, cellRS, cellRV, &fvfDynProps.bo, &fvfDynProps.bg);
|
||||
|
||||
RiuPvtPlotPanel::ViscosityDynProps viscosityDynProps;
|
||||
eclipseResultCase->flowDiagSolverInterface()->calculatePvtDynamicPropertiesViscosity(activeCellIndex, cellPressure, cellRS, cellRV, &viscosityDynProps.mu_o, &viscosityDynProps.mu_g);
|
||||
|
||||
plotPanel->setPlotData(fvfCurveArr, viscosityCurveArr, fvfDynProps, viscosityDynProps, cellPressure);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ bool RiuRelativePermeabilityPlotUpdater::queryDataAndUpdatePlot(const RimEclipse
|
||||
{
|
||||
//cvf::Trace::show("Updating RelPerm plot for active cell index: %d", static_cast<int>(activeCellIndex));
|
||||
|
||||
std::vector<RigFlowDiagSolverInterface::RelPermCurve> relPermCurveArr = eclipseResultCase->flowDiagSolverInterface()->calculateRelPermCurvesForActiveCell(activeCellIndex);
|
||||
std::vector<RigFlowDiagSolverInterface::RelPermCurve> relPermCurveArr = eclipseResultCase->flowDiagSolverInterface()->calculateRelPermCurves(activeCellIndex);
|
||||
|
||||
// Make sure we load the results that we'll query below
|
||||
RigCaseCellResultsData* cellResultsData = eclipseCaseData->results(RiaDefines::MATRIX_MODEL);
|
||||
|
||||
Reference in New Issue
Block a user