Only restrict oscillation for iter > nupcol

This commit is contained in:
Tor Harald Sandve 2024-12-04 10:22:01 +01:00
parent 128e80ec7a
commit 738eb761c2

View File

@ -213,8 +213,10 @@ namespace Opm
from = WellProducerCMode2String(ws.production_cmode); from = WellProducerCMode2String(ws.production_cmode);
} }
bool oscillating = std::count(this->well_control_log_.begin(), this->well_control_log_.end(), from) >= this->param_.max_number_of_well_switches_; bool oscillating = std::count(this->well_control_log_.begin(), this->well_control_log_.end(), from) >= this->param_.max_number_of_well_switches_;
const int episodeIdx = simulator.episodeIndex();
if (oscillating) { const int iterationIdx = simulator.model().newtonMethod().numIterations();
const int nupcol = schedule[episodeIdx].nupcol();
if (oscillating && iterationIdx > nupcol) {
// only output frist time // only output frist time
bool output = std::count(this->well_control_log_.begin(), this->well_control_log_.end(), from) == this->param_.max_number_of_well_switches_; bool output = std::count(this->well_control_log_.begin(), this->well_control_log_.end(), from) == this->param_.max_number_of_well_switches_;
if (output) { if (output) {