mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
move the try-catch inside the compute potential loop
This commit is contained in:
parent
6e87ec6266
commit
2deee380f9
@ -1484,7 +1484,6 @@ namespace Opm {
|
|||||||
const Opm::SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig();
|
const Opm::SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig();
|
||||||
const bool write_restart_file = ebosSimulator_.vanguard().schedule().restart().getWriteRestartFile(reportStepIdx);
|
const bool write_restart_file = ebosSimulator_.vanguard().schedule().restart().getWriteRestartFile(reportStepIdx);
|
||||||
int exception_thrown = 0;
|
int exception_thrown = 0;
|
||||||
try {
|
|
||||||
for (const auto& well : well_container_) {
|
for (const auto& well : well_container_) {
|
||||||
const bool needed_for_summary = ((summaryConfig.hasSummaryKey( "WWPI:" + well->name()) ||
|
const bool needed_for_summary = ((summaryConfig.hasSummaryKey( "WWPI:" + well->name()) ||
|
||||||
summaryConfig.hasSummaryKey( "WOPI:" + well->name()) ||
|
summaryConfig.hasSummaryKey( "WOPI:" + well->name()) ||
|
||||||
@ -1496,18 +1495,18 @@ namespace Opm {
|
|||||||
bool needPotentialsForGuideRate = true;//eclWell.getGuideRatePhase() == Well::GuideRateTarget::UNDEFINED;
|
bool needPotentialsForGuideRate = true;//eclWell.getGuideRatePhase() == Well::GuideRateTarget::UNDEFINED;
|
||||||
if (write_restart_file || needed_for_summary || needPotentialsForGuideRate)
|
if (write_restart_file || needed_for_summary || needPotentialsForGuideRate)
|
||||||
{
|
{
|
||||||
|
try {
|
||||||
std::vector<double> potentials;
|
std::vector<double> potentials;
|
||||||
well->computeWellPotentials(ebosSimulator_, B_avg, well_state_copy, potentials, deferred_logger);
|
well->computeWellPotentials(ebosSimulator_, B_avg, well_state_copy, potentials, deferred_logger);
|
||||||
// putting the sucessfully calculated potentials to the well_potentials
|
// putting the sucessfully calculated potentials to the well_potentials
|
||||||
for (int p = 0; p < np; ++p) {
|
for (int p = 0; p < np; ++p) {
|
||||||
well_potentials[well->indexOfWell() * np + p] = std::abs(potentials[p]);
|
well_potentials[well->indexOfWell() * np + p] = std::abs(potentials[p]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} // end of for (int w = 0; w < nw; ++w)
|
|
||||||
} catch (std::exception& e) {
|
} catch (std::exception& e) {
|
||||||
exception_thrown = 1;
|
exception_thrown = 1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
logAndCheckForExceptionsAndThrow(deferred_logger, exception_thrown, "computeWellPotentials() failed.", terminal_output_);
|
logAndCheckForExceptionsAndThrow(deferred_logger, exception_thrown, "computeWellPotentials() failed.", terminal_output_);
|
||||||
|
|
||||||
// Store it in the well state
|
// Store it in the well state
|
||||||
|
Loading…
Reference in New Issue
Block a user