Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions opm/simulators/wells/WellInterface_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ namespace Opm
const auto& summary_state = simulator.vanguard().summaryState();
bool converged = true;
auto& ws = well_state.well(this->index_of_well_);
// if well is stopped, check if we can reopen with explicit fraction
if (this->wellIsStopped()) {
// Solver recovery may reopen dynamic stops, but never an explicit schedule STOP.
if (this->wellIsStopped() && this->well_ecl_.getStatus() != Well::Status::STOP) {
this->openWell();
const bool use_vfpexplicit = this->operability_status_.use_vfpexplicit;
this->operability_status_.use_vfpexplicit = true;
Expand Down Expand Up @@ -1145,7 +1145,9 @@ namespace Opm
deferred_logger.debug(" well " + this->name() + " gets STOPPED during iteration" + ctx);
changed_to_stopped_this_step_ = true;
}
} else if (well_state.isOpen(this->name())) {
// Do not let automatic revival override an explicit schedule STOP.
} else if (well_state.isOpen(this->name()) &&
this->well_ecl_.getStatus() != Well::Status::STOP) {
this->openWell();
if (!old_well_operable) {
const std::string ctx = iterCtx.inLocalSolve() ? " (NLDD domain solve)" : "";
Expand Down
5 changes: 4 additions & 1 deletion opm/simulators/wells/WellState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,10 @@ init(const std::vector<Scalar>& cellPressures,
continue;
}

new_well.status = prev_well.status;
// A current schedule STOP/OPEN must take precedence over the previous runtime status.
if (!new_well.events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE)) {
new_well.status = prev_well.status;
}

if (new_well.producer != prev_well.producer) {
// Well changed to/from injector from/to producer, do not
Expand Down