adding more checking for the potential values

during the well well potential calculation.
This commit is contained in:
Kai Bao
2017-04-11 15:29:33 +02:00
parent ce0e580cee
commit 0700c8cf67

View File

@@ -2850,7 +2850,7 @@ namespace Opm {
} }
} }
// there should be always some avaible bhp/thp constraints there // there should be always some available bhp/thp constraints there
if (std::isinf(bhp) || std::isnan(bhp)) { if (std::isinf(bhp) || std::isnan(bhp)) {
OPM_THROW(std::runtime_error, "Unvalid bhp value obtained during the potential calculation for well " << wells().name[well_index]); OPM_THROW(std::runtime_error, "Unvalid bhp value obtained during the potential calculation for well " << wells().name[well_index]);
} }
@@ -2859,6 +2859,13 @@ namespace Opm {
computeWellRatesWithBhp(ebosSimulator, bhp, well_index, potentials); computeWellRatesWithBhp(ebosSimulator, bhp, well_index, potentials);
// checking whether the potentials have valid values
for (const double value : potentials) {
if (std::isinf(value) || std::isnan(value)) {
OPM_THROW(std::runtime_error, "Unvalid potential value obtained during the potential calculation for well " << wells().name[well_index]);
}
}
if (!converged) { if (!converged) {
old_bhp = bhp; old_bhp = bhp;
for (int p = 0; p < np; ++p) { for (int p = 0; p < np; ++p) {