diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index 317132630..f316b7b01 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -386,8 +386,9 @@ namespace Opm { void assemble(const int iterationIdx, const double dt); - // the function handles one itearation of updating well controls and also network related. - // it is possible to decouple the update of well controls and network related further + // well controls and network pressures affect each other and are solved in an iterative manner. + // the function handles one iteration of updating well controls and network pressures. + // it is possible to decouple the update of well controls and network pressures further. // the returned two booleans are {continue_due_to_network, well_group_control_changed}, respectively std::pair updateWellControlsAndNetworkIteration(const double dt, const std::size_t network_update_iteration, diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index c1d2b68ab..14d6116cb 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -1255,13 +1255,13 @@ shouldBalanceNetwork(const int reportStepIdx, const int iterationIdx) const bool BlackoilWellModelGeneric:: -shouldIterateNetwork(const int reportStepIdx, - const std::size_t recursion_level, +moreNetworkIteration(const int reportStepIdx, + const std::size_t iteration, const double network_imbalance) const { const auto& balance = schedule()[reportStepIdx].network_balance(); // Iterate if not converged, and number of iterations is not yet max (NETBALAN item 3). - return recursion_level < balance.pressure_max_iter() && + return iteration < balance.pressure_max_iter() && network_imbalance > balance.pressure_tolerance(); } diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.hpp b/opm/simulators/wells/BlackoilWellModelGeneric.hpp index cb2e3eaf2..a3a4c9fbe 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.hpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.hpp @@ -177,8 +177,8 @@ public: bool shouldBalanceNetwork(const int reportStepIndex, const int iterationIdx) const; - bool shouldIterateNetwork(const int reportStepIndex, - const std::size_t recursion_level, + bool moreNetworkIteration(const int reportStepIdx, + const std::size_t iteration, const double network_imbalance) const; template diff --git a/opm/simulators/wells/BlackoilWellModel_impl.hpp b/opm/simulators/wells/BlackoilWellModel_impl.hpp index 6d4b976dc..0b5e6b16f 100644 --- a/opm/simulators/wells/BlackoilWellModel_impl.hpp +++ b/opm/simulators/wells/BlackoilWellModel_impl.hpp @@ -1510,11 +1510,7 @@ namespace Opm { const bool network_changed = comm.sum(local_network_changed); const double network_imbalance = comm.max(local_network_imbalance); if (network_changed) { - const auto& balance = schedule()[episodeIdx].network_balance(); - // Iterate if not converged, and number of iterations is not yet max (NETBALAN item 3). - if (network_update_it < balance.pressure_max_iter() && network_imbalance > balance.pressure_tolerance()) { - more_network_update = true; - } + more_network_update = moreNetworkIteration(episodeIdx, network_update_it, network_imbalance); } }