mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2375 Fix missing catch of exceptions from opm-flowdiagnostics libraries
This commit is contained in:
parent
79539c1c99
commit
6adcbd9c56
@ -237,6 +237,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
|
|
||||||
caf::ProgressInfo progressInfo(8, "Calculating Flow Diagnostics");
|
caf::ProgressInfo progressInfo(8, "Calculating Flow Diagnostics");
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
progressInfo.setProgressDescription("Grid access");
|
progressInfo.setProgressDescription("Grid access");
|
||||||
|
|
||||||
@ -294,6 +295,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch ( const std::exception& e )
|
||||||
|
{
|
||||||
|
QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString(e.what()));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
progressInfo.setProgress(3);
|
progressInfo.setProgress(3);
|
||||||
progressInfo.setProgressDescription("Assigning Flux Field");
|
progressInfo.setProgressDescription("Assigning Flux Field");
|
||||||
@ -328,6 +334,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
// Set up flow Toolbox with timestep data
|
// Set up flow Toolbox with timestep data
|
||||||
std::map<Opm::FlowDiagnostics::CellSetID, Opm::FlowDiagnostics::CellSetValues> WellInFluxPrCell;
|
std::map<Opm::FlowDiagnostics::CellSetID, Opm::FlowDiagnostics::CellSetValues> WellInFluxPrCell;
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->hasFlowDiagUsableFluxes())
|
if (m_eclipseCase->eclipseCaseData()->results(RiaDefines::MATRIX_MODEL)->hasFlowDiagUsableFluxes())
|
||||||
{
|
{
|
||||||
@ -338,12 +345,12 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Opm::ECLInitFileData init(getInitFileName());
|
Opm::ECLInitFileData init(getInitFileName());
|
||||||
Opm::FlowDiagnostics::ConnectionValues connectionVals = RigFlowDiagInterfaceTools::calculateFluxField((*m_opmFlowDiagStaticData->m_eclGraph),
|
Opm::FlowDiagnostics::ConnectionValues connectionVals = RigFlowDiagInterfaceTools::calculateFluxField((*m_opmFlowDiagStaticData->m_eclGraph),
|
||||||
init,
|
init,
|
||||||
*currentRestartData,
|
*currentRestartData,
|
||||||
phaseSelection);
|
phaseSelection);
|
||||||
m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionVals);
|
m_opmFlowDiagStaticData->m_fldToolbox->assignConnectionFlux(connectionVals);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -360,10 +367,16 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
m_opmFlowDiagStaticData->m_fldToolbox->assignInflowFlux(WellInFluxPrCell);
|
m_opmFlowDiagStaticData->m_fldToolbox->assignInflowFlux(WellInFluxPrCell);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
catch ( const std::exception& e )
|
||||||
|
{
|
||||||
|
QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString(e.what()));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
progressInfo.incrementProgress();
|
progressInfo.incrementProgress();
|
||||||
progressInfo.setProgressDescription("Injector Solution");
|
progressInfo.setProgressDescription("Injector Solution");
|
||||||
|
|
||||||
|
try
|
||||||
{
|
{
|
||||||
// Injection Solution
|
// Injection Solution
|
||||||
std::set<std::string> injectorCrossFlowTracers;
|
std::set<std::string> injectorCrossFlowTracers;
|
||||||
@ -381,15 +394,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
injectorCellSets.push_back(CellSet(CellSetID(tracerName), tIt.second));
|
injectorCellSets.push_back(CellSet(CellSetID(tracerName), tIt.second));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
injectorSolution.reset(new Toolbox::Forward(m_opmFlowDiagStaticData->m_fldToolbox->computeInjectionDiagnostics(injectorCellSets)));
|
||||||
{
|
|
||||||
injectorSolution.reset(new Toolbox::Forward(m_opmFlowDiagStaticData->m_fldToolbox->computeInjectionDiagnostics(injectorCellSets)));
|
|
||||||
}
|
|
||||||
catch ( const std::exception& e )
|
|
||||||
{
|
|
||||||
QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: " + QString(e.what()));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( const CellSetID& tracerId: injectorSolution->fd.startPoints() )
|
for ( const CellSetID& tracerId: injectorSolution->fd.startPoints() )
|
||||||
{
|
{
|
||||||
@ -422,15 +427,7 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
prodjCellSets.push_back(CellSet(CellSetID(tracerName), tIt.second));
|
prodjCellSets.push_back(CellSet(CellSetID(tracerName), tIt.second));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
producerSolution.reset(new Toolbox::Reverse(m_opmFlowDiagStaticData->m_fldToolbox->computeProductionDiagnostics(prodjCellSets)));
|
||||||
{
|
|
||||||
producerSolution.reset(new Toolbox::Reverse(m_opmFlowDiagStaticData->m_fldToolbox->computeProductionDiagnostics(prodjCellSets)));
|
|
||||||
}
|
|
||||||
catch ( const std::exception& e )
|
|
||||||
{
|
|
||||||
QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics: " + QString(e.what()));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( const CellSetID& tracerId: producerSolution->fd.startPoints() )
|
for ( const CellSetID& tracerId: producerSolution->fd.startPoints() )
|
||||||
{
|
{
|
||||||
@ -490,6 +487,11 @@ RigFlowDiagTimeStepResult RigFlowDiagSolverInterface::calculate(size_t timeStepI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch ( const std::exception& e )
|
||||||
|
{
|
||||||
|
QMessageBox::critical(nullptr, "ResInsight", "Flow Diagnostics Exception: " + QString(e.what()));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
return result; // Relying on implicit move constructor
|
return result; // Relying on implicit move constructor
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user