addressing the reviewing comments for PR #4596

This commit is contained in:
Kai Bao 2023-04-20 15:47:31 +02:00
parent 1542f2c087
commit 79eeeae16e
4 changed files with 9 additions and 12 deletions

View File

@ -386,8 +386,9 @@ namespace Opm {
void assemble(const int iterationIdx, void assemble(const int iterationIdx,
const double dt); const double dt);
// the function handles one itearation of updating well controls and also network related. // well controls and network pressures affect each other and are solved in an iterative manner.
// it is possible to decouple the update of well controls and network related further // 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 // the returned two booleans are {continue_due_to_network, well_group_control_changed}, respectively
std::pair<bool, bool> updateWellControlsAndNetworkIteration(const double dt, std::pair<bool, bool> updateWellControlsAndNetworkIteration(const double dt,
const std::size_t network_update_iteration, const std::size_t network_update_iteration,

View File

@ -1255,13 +1255,13 @@ shouldBalanceNetwork(const int reportStepIdx, const int iterationIdx) const
bool bool
BlackoilWellModelGeneric:: BlackoilWellModelGeneric::
shouldIterateNetwork(const int reportStepIdx, moreNetworkIteration(const int reportStepIdx,
const std::size_t recursion_level, const std::size_t iteration,
const double network_imbalance) const const double network_imbalance) const
{ {
const auto& balance = schedule()[reportStepIdx].network_balance(); const auto& balance = schedule()[reportStepIdx].network_balance();
// Iterate if not converged, and number of iterations is not yet max (NETBALAN item 3). // 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(); network_imbalance > balance.pressure_tolerance();
} }

View File

@ -177,8 +177,8 @@ public:
bool shouldBalanceNetwork(const int reportStepIndex, bool shouldBalanceNetwork(const int reportStepIndex,
const int iterationIdx) const; const int iterationIdx) const;
bool shouldIterateNetwork(const int reportStepIndex, bool moreNetworkIteration(const int reportStepIdx,
const std::size_t recursion_level, const std::size_t iteration,
const double network_imbalance) const; const double network_imbalance) const;
template<class Serializer> template<class Serializer>

View File

@ -1510,11 +1510,7 @@ namespace Opm {
const bool network_changed = comm.sum(local_network_changed); const bool network_changed = comm.sum(local_network_changed);
const double network_imbalance = comm.max(local_network_imbalance); const double network_imbalance = comm.max(local_network_imbalance);
if (network_changed) { if (network_changed) {
const auto& balance = schedule()[episodeIdx].network_balance(); more_network_update = moreNetworkIteration(episodeIdx, network_update_it, network_imbalance);
// 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;
}
} }
} }