mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-09 23:53:04 -06:00
#2237 Progress bar when calculating flooded PV
Fix errors in progress detected when opening project
This commit is contained in:
parent
1a8f4e1829
commit
84dcc0980e
@ -558,24 +558,25 @@ bool RiaApplication::loadProject(const QString& projectFileName, ProjectLoadActi
|
||||
|
||||
caseProgress.setProgressDescription(cas->caseUserDescription());
|
||||
std::vector<RimView*> views = cas->views();
|
||||
caf::ProgressInfo viewProgress(views.size(), "Creating Views");
|
||||
{ // To delete the view progress before incrementing the caseProgress
|
||||
caf::ProgressInfo viewProgress(views.size(), "Creating Views");
|
||||
|
||||
size_t j;
|
||||
for (j = 0; j < views.size(); j++)
|
||||
{
|
||||
RimView* riv = views[j];
|
||||
CVF_ASSERT(riv);
|
||||
size_t j;
|
||||
for ( j = 0; j < views.size(); j++ )
|
||||
{
|
||||
RimView* riv = views[j];
|
||||
CVF_ASSERT(riv);
|
||||
|
||||
viewProgress.setProgressDescription(riv->name());
|
||||
viewProgress.setProgressDescription(riv->name());
|
||||
|
||||
riv->loadDataAndUpdate();
|
||||
this->setActiveReservoirView(riv);
|
||||
riv->loadDataAndUpdate();
|
||||
this->setActiveReservoirView(riv);
|
||||
|
||||
riv->rangeFilterCollection()->updateIconState();
|
||||
riv->rangeFilterCollection()->updateIconState();
|
||||
|
||||
viewProgress.incrementProgress();
|
||||
viewProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
||||
caseProgress.incrementProgress();
|
||||
}
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ bool RifReaderEclipseOutput::open(const QString& fileName, RigEclipseCaseData* e
|
||||
if (isNNCsEnabled())
|
||||
{
|
||||
progInfo.setProgressDescription("Reading NNC data");
|
||||
progInfo.setNextProgressIncrement(5);
|
||||
progInfo.setNextProgressIncrement(4);
|
||||
transferStaticNNCData(mainEclGrid, m_ecl_init_file, eclipseCase->mainGrid());
|
||||
progInfo.incrementProgress();
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <QString>
|
||||
#include "cafProgressInfo.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -47,28 +48,42 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator
|
||||
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
size_t resultCellCount = actCellInfo->reservoirCellResultCount();
|
||||
|
||||
size_t timeStepCount = caseToApply->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->maxTimeStepCount();
|
||||
size_t totalProgress = tracerNames.size()
|
||||
+ 8
|
||||
+ timeStepCount
|
||||
+ 2* timeStepCount;
|
||||
caf::ProgressInfo progress(totalProgress, "Calculating number of flooded mobile pore volumes." );
|
||||
progress.setProgressDescription("Loading required results");
|
||||
// PORV
|
||||
const std::vector<double>* porvResults = nullptr;
|
||||
std::vector<double> porvActiveCellsResultStorage;
|
||||
porvResults = RigCaseCellResultsData::getResultIndexableStaticResult(actCellInfo, gridCellResults, "PORV", porvActiveCellsResultStorage);
|
||||
|
||||
progress.incrementProgress();
|
||||
|
||||
// SWCR if defined
|
||||
|
||||
const std::vector<double>* swcrResults = nullptr;
|
||||
swcrResults = RigCaseCellResultsData::getResultIndexableStaticResult(actCellInfo, gridCellResults, "SWCR", porvActiveCellsResultStorage);
|
||||
progress.incrementProgress();
|
||||
|
||||
std::vector<size_t> scalarResultIndexTracers;
|
||||
for (QString tracerName : tracerNames)
|
||||
{
|
||||
scalarResultIndexTracers.push_back(gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, tracerName));
|
||||
progress.incrementProgress();
|
||||
}
|
||||
std::vector<std::vector<double> > summedTracersAtAllTimesteps;
|
||||
|
||||
//TODO: Option for Oil and Gas instead of water
|
||||
|
||||
size_t scalarResultIndexFlowrateI = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "FLRWATI+");
|
||||
size_t scalarResultIndexFlowrateJ = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "FLRWATJ+");
|
||||
size_t scalarResultIndexFlowrateK = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "FLRWATK+");
|
||||
size_t scalarResultIndexFlowrateI = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "FLRWATI+");
|
||||
progress.incrementProgress();
|
||||
size_t scalarResultIndexFlowrateJ = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "FLRWATJ+");
|
||||
progress.incrementProgress();
|
||||
size_t scalarResultIndexFlowrateK = gridCellResults->findOrLoadScalarResult(RiaDefines::DYNAMIC_NATIVE, "FLRWATK+");
|
||||
progress.incrementProgress();
|
||||
|
||||
std::vector<const std::vector<double>* > flowrateIatAllTimeSteps;
|
||||
std::vector<const std::vector<double>* > flowrateJatAllTimeSteps;
|
||||
@ -76,13 +91,18 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator
|
||||
|
||||
RigNNCData* nncData = eclipseCaseData->mainGrid()->nncData();
|
||||
const std::vector<RigConnection> connections = nncData->connections();
|
||||
|
||||
progress.incrementProgress();
|
||||
|
||||
//TODO: oil or gas flowrate
|
||||
std::vector<const std::vector<double>* > flowrateNNCatAllTimeSteps;
|
||||
QString nncConnectionProperty = mainGrid->nncData()->propertyNameFluxWat();
|
||||
|
||||
|
||||
std::vector<double> daysSinceSimulationStart = caseToApply->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->daysSinceSimulationStart();
|
||||
progress.incrementProgress();
|
||||
|
||||
std::vector<double> daysSinceSimulationStart = caseToApply->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->daysSinceSimulationStart();
|
||||
|
||||
progress.incrementProgress();
|
||||
|
||||
for (size_t timeStep = 0; timeStep < daysSinceSimulationStart.size(); timeStep++)
|
||||
{
|
||||
@ -133,9 +153,13 @@ RigNumberOfFloodedPoreVolumesCalculator::RigNumberOfFloodedPoreVolumesCalculator
|
||||
}
|
||||
}
|
||||
summedTracersAtAllTimesteps.push_back(summedTracerValues);
|
||||
|
||||
|
||||
progress.incrementProgress();
|
||||
}
|
||||
|
||||
progress.setNextProgressIncrement(2*timeStepCount);
|
||||
progress.setProgressDescription("Calculating");
|
||||
|
||||
calculate(mainGrid,
|
||||
caseToApply,
|
||||
daysSinceSimulationStart,
|
||||
@ -178,6 +202,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate(RigMainGrid* mainGrid,
|
||||
RigActiveCellInfo* actCellInfo = caseToApply->eclipseCaseData()->activeCellInfo(RiaDefines::MATRIX_MODEL);
|
||||
size_t resultCellCount = actCellInfo->reservoirCellResultCount();
|
||||
|
||||
caf::ProgressInfo progress(2*daysSinceSimulationStart.size() , "");
|
||||
|
||||
std::vector<std::vector<double>> cellQwInAtAllTimeSteps;
|
||||
std::vector<double> cellQwInTimeStep0(resultCellCount);
|
||||
@ -233,6 +258,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate(RigMainGrid* mainGrid,
|
||||
}
|
||||
cellQwInAtAllTimeSteps.push_back(CellQwIn);
|
||||
|
||||
progress.incrementProgress();
|
||||
}
|
||||
|
||||
|
||||
@ -257,6 +283,7 @@ void RigNumberOfFloodedPoreVolumesCalculator::calculate(RigMainGrid* mainGrid,
|
||||
/ scaledPoreVolume;
|
||||
}
|
||||
m_cumWinflowPVAllTimeSteps.push_back(cumWinflowPV);
|
||||
progress.incrementProgress();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user