#2328 Give warning when user tries to calculate injection flooding without available fluxes

This commit is contained in:
Rebecca Cox 2018-01-25 11:59:43 +01:00
parent 08a46c2307
commit ab72981681

View File

@ -40,6 +40,8 @@
#include "cafPdmUiTreeOrdering.h"
#include "QMessageBox"
CAF_PDM_SOURCE_INIT(RimEclipseCellColors, "ResultSlot");
//--------------------------------------------------------------------------------------------------
@ -275,6 +277,22 @@ void RimEclipseCellColors::updateLegendData(size_t currentTimeStep)
{
if (this->isFlowDiagOrInjectionFlooding())
{
RimEclipseCase* rimEclipseCase = nullptr;
this->firstAncestorOrThisOfType(rimEclipseCase);
CVF_ASSERT(rimEclipseCase);
if (!rimEclipseCase) return;
RigEclipseCaseData* eclipseCase = rimEclipseCase->eclipseCaseData();
CVF_ASSERT(eclipseCase);
if (!eclipseCase) return;
RigCaseCellResultsData* cellResultsData = eclipseCase->results(this->porosityModel());
if (!cellResultsData->hasFlowDiagUsableFluxes())
{
QMessageBox::warning(RiuMainWindow::instance(), "Injection Flooding", "Cannot calculate any injection flooding properties, since no fluxes are available");
return;
}
double globalMin, globalMax;
double globalPosClosestToZero, globalNegClosestToZero;
RigFlowDiagResults* flowResultsData = this->flowDiagSolution()->flowDiagResults();