#2375 Fix missing catch of exeptions from pvt/relperm curve generation

This commit is contained in:
Jacob Støren 2018-01-19 15:21:17 +01:00
parent 6adcbd9c56
commit 5855e412e7
2 changed files with 68 additions and 1 deletions

View File

@ -185,7 +185,9 @@ public:
///
//--------------------------------------------------------------------------------------------------
RigFlowDiagSolverInterface::RigFlowDiagSolverInterface(RimEclipseResultCase * eclipseCase)
: m_eclipseCase(eclipseCase)
: m_eclipseCase(eclipseCase),
m_pvtCurveErrorCount(0),
m_relpermCurveErrorCount(0)
{
}
@ -561,6 +563,30 @@ void RigFlowDiagSolverInterface::assignPhaseCorrecedPORV(RigFlowDiagResultAddres
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFlowDiagSolverInterface::reportRelPermCurveError(const QString& message)
{
if (m_relpermCurveErrorCount == 0)
{
QMessageBox::critical(nullptr, "ResInsight", "RelPerm curve problems: \n" + message);
}
m_relpermCurveErrorCount++;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFlowDiagSolverInterface::reportPvtCurveError(const QString& message)
{
if (m_pvtCurveErrorCount == 0)
{
QMessageBox::critical(nullptr, "ResInsight", "PVT curve problems: \n" + message);
}
m_pvtCurveErrorCount++;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
@ -636,6 +662,8 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
curveIdentNameArr.push_back(std::make_pair(RelPermCurve::PCOG, "PCOG")); satFuncRequests.push_back(pcgo);
curveIdentNameArr.push_back(std::make_pair(RelPermCurve::PCOW, "PCOW")); satFuncRequests.push_back(pcow);
try {
// Calculate and return curves both with and without endpoint scaling and tag them accordingly
// Must use two calls to achieve this
const std::array<RelPermCurve::EpsMode, 2> epsModeArr = { RelPermCurve::EPS_ON , RelPermCurve::EPS_OFF };
@ -657,6 +685,13 @@ std::vector<RigFlowDiagSolverInterface::RelPermCurve> RigFlowDiagSolverInterface
}
}
}
catch ( const std::exception& e )
{
reportRelPermCurveError( QString(e.what()));
return retCurveArr;
}
return retCurveArr;
}
@ -667,6 +702,8 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
{
std::vector<PvtCurve> retCurveArr;
try {
if (!ensureStaticDataObjectInstanceCreated())
{
return retCurveArr;
@ -734,6 +771,13 @@ std::vector<RigFlowDiagSolverInterface::PvtCurve> RigFlowDiagSolverInterface::ca
}
}
}
catch ( const std::exception& e )
{
reportPvtCurveError( QString(e.what()));
return retCurveArr;
}
return retCurveArr;
}
@ -756,6 +800,7 @@ bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesFvf(size_t activeC
return false;
}
try {
// Bo
{
std::vector<double> phasePress = { pressure };
@ -778,6 +823,13 @@ bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesFvf(size_t activeC
}
}
}
catch ( const std::exception& e )
{
reportPvtCurveError( QString(e.what()));
return false;
}
return true;
}
@ -800,6 +852,7 @@ bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesViscosity(size_t a
return false;
}
try {
// mu_o
{
std::vector<double> phasePress = { pressure };
@ -822,6 +875,13 @@ bool RigFlowDiagSolverInterface::calculatePvtDynamicPropertiesViscosity(size_t a
}
}
}
catch ( const std::exception& e )
{
reportPvtCurveError( QString(e.what()));
return false;
}
return true;
}

View File

@ -129,9 +129,16 @@ private:
bool ensureStaticDataObjectInstanceCreated();
void assignPhaseCorrecedPORV(RigFlowDiagResultAddress::PhaseSelection phaseSelection,
size_t timeStepIdx);
void reportRelPermCurveError(const QString &message);
void reportPvtCurveError(const QString &message);
RimEclipseResultCase * m_eclipseCase;
cvf::ref<RigOpmFlowDiagStaticData> m_opmFlowDiagStaticData;
int m_pvtCurveErrorCount;
int m_relpermCurveErrorCount;
};