diff --git a/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp b/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp index 3aa4b902d3..9177768572 100644 --- a/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp +++ b/ApplicationCode/Commands/FlowCommands/RicShowFlowCharacteristicsPlotFeature.cpp @@ -23,6 +23,8 @@ #include "RimEclipseResultCase.h" #include "RimEclipseView.h" #include "RimFlowCharacteristicsPlot.h" +#include "RigFlowDiagResults.h" +#include "RimFlowDiagSolution.h" #include "RimFlowPlotCollection.h" #include "RimMainPlotCollection.h" #include "RimProject.h" @@ -71,6 +73,16 @@ void RicShowFlowCharacteristicsPlotFeature::onActionTriggered(bool isChecked) if (eclCase && eclCase->defaultFlowDiagSolution()) { + // Make sure flow results for the the active timestep is calculated, to avoid an empty plot + { + RimView * activeView = RiaApplication::instance()->activeReservoirView(); + if (activeView && eclCase->defaultFlowDiagSolution()->flowDiagResults()) + { + // Trigger calculation + eclCase->defaultFlowDiagSolution()->flowDiagResults()->maxAbsPairFlux(activeView->currentTimeStep()); + } + } + if (RiaApplication::instance()->project()) { RimFlowPlotCollection* flowPlotColl = RiaApplication::instance()->project()->mainPlotCollection->flowPlotCollection(); diff --git a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp index db3622ec06..90acb4e88b 100644 --- a/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp +++ b/ApplicationCode/ProjectDataModel/Flow/RimFlowCharacteristicsPlot.cpp @@ -141,14 +141,16 @@ QList RimFlowCharacteristicsPlot::calculateValueOptions( { std::vector cases; proj->descendantsIncludingThisOfType(cases); - + RimEclipseResultCase* defaultCase = nullptr; for ( RimEclipseResultCase* c : cases ) { if ( c->defaultFlowDiagSolution() ) { options.push_back(caf::PdmOptionItemInfo(c->caseUserDescription(), c, false, c->uiIcon())); + if (!defaultCase) defaultCase = c; // Select first } } + if (!m_case() && defaultCase) m_case = defaultCase; } } else if ( fieldNeedingOptions == &m_flowDiagSolution )