recovering the SHUT during iteration beahvoir in prepareWellBeforeAssembling

when local_well_solver_control_switching_ is off
and incoporating commenst regarding resetting wellStatus_ in StandardWell within
the function iterateWellEqWithSwitching.
This commit is contained in:
Kai Bao 2023-09-26 11:42:19 +02:00
parent 83bbe89342
commit b1974bbe45
2 changed files with 19 additions and 3 deletions

View File

@ -2234,9 +2234,13 @@ namespace Opm
} else {
this->operability_status_.operable_under_only_bhp_limit = !is_stopped;
}
// We reset the well status to it's original state. Status is updated
// We reset the well status to its original state. Status is updated
// on the outside based on operability status
// TODO: this looks strange, let us check
// \Note for future reference: For the well to update its status to stop/shut,
// the flag changed_to_stopped_this_step_ in prepareWellBeforeAssembling needs to be set to true.
// For this to happen, isOperableAndSolvable() must change from true to false,
// and (until the most recent commit) the well needs to be open for this to trigger.
// Hence, the resetting of status.
this->wellStatus_ = well_status;
}
} else {

View File

@ -626,10 +626,22 @@ namespace Opm
const bool well_operable = this->operability_status_.isOperableAndSolvable();
if (!well_operable && old_well_operable) {
if (!this->wellIsStopped()) {
if (this->param_.local_well_solver_control_switching_) {
deferred_logger.info(" well " + this->name() + " gets STOPPED during iteration ");
this->stopWell();
changed_to_stopped_this_step_ = true;
} else {
// \Note: keep the old manner for now for testing checking.
// Will be investgiated and fixed in a later PR
if (this->well_ecl_.getAutomaticShutIn()) {
deferred_logger.info(" well " + this->name() + " gets SHUT during iteration ");
} else {
if (!this->wellIsStopped()) {
deferred_logger.info(" well " + this->name() + " gets STOPPED during iteration ");
this->stopWell();
changed_to_stopped_this_step_ = true;
}
}
}
} else if (well_operable && !old_well_operable) {
deferred_logger.info(" well " + this->name() + " gets REVIVED during iteration ");