Merge pull request #1803 from joakim-hove/all-shut-message

All shut message
This commit is contained in:
Bård Skaflestad
2020-06-01 23:37:17 +02:00
committed by GitHub
2 changed files with 6 additions and 33 deletions

View File

@@ -2038,38 +2038,9 @@ Schedule::Schedule(const Deck& deck, const EclipseState& es, const ParseContext&
auto well2 = std::shared_ptr<Well>(new Well( this->getWell(name, currentStep)));
auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2->getConnections()));
connections->loadCOMPDAT(record, grid, fp);
/*
This block implements the following dubious logic.
1. All competions are shut.
2. A new open completion is added.
3. A currently SHUT well is opened.
This code assumes that the reason the well is initially
shut is due to all the shut completions, if the well was
explicitly shut for another reason the explicit opening of
the well might be in error?
*/
/*if (all_shut0) {
if (!connections->allConnectionsShut()) {
if (well2->getStatus() == WellCommon::StatusEnum::SHUT) {
printf("Running all_shut inner loop\n");
if (this->updateWellStatus(well2->name(), currentStep, WellCommon::StatusEnum::OPEN))
// Refresh pointer if the status has updated current slot. Ugly
well2 = std::shared_ptr<Well>(new Well(this->getWell(name, currentStep)));
}
}
}
*/
if (well2->updateConnections(connections, grid, fp.get_int("PVTNUM")))
this->updateWell(well2, currentStep);
if (well2->getStatus() == Well::Status::SHUT) {
std::string msg =
"All completions in well " + well2->name() + " is shut at " + std::to_string ( m_timeMap.getTimePassedUntil(currentStep) / (60*60*24) ) + " days. \n" +
"The well is therefore also shut.";
OpmLog::note(msg);
}
}
this->addWellGroupEvent(name, ScheduleEvents::COMPLETION_CHANGE, currentStep);
}
@@ -2824,8 +2795,13 @@ void Schedule::invalidNamePattern( const std::string& namePattern, std::size_t
for (const auto& wname : well_names) {
const auto& well = this->getWell(wname, timeStep);
const auto& connections = well.getConnections();
if (connections.allConnectionsShut())
if (connections.allConnectionsShut() && well.getStatus() != Well::Status::SHUT) {
this->updateWellStatus( well.name(), timeStep, Well::Status::SHUT, false);
std::string msg =
"All completions in well " + well.name() + " is shut at " + std::to_string ( m_timeMap.getTimePassedUntil(timeStep) / (60*60*24) ) + " days. \n" +
"The well is therefore also shut.";
OpmLog::note(msg);
}
}
}

View File

@@ -617,9 +617,6 @@ bool Well::updateConnections(std::shared_ptr<WellConnections> connections_arg) {
connections_arg->order( );
if (*this->connections != *connections_arg) {
this->connections = connections_arg;
//if (this->connections->allConnectionsShut()) {}
// This status update breaks line 825 in ScheduleTests
//this->status = WellCommon::StatusEnum::SHUT;
return true;
}