Moved logic from schedule to well->setStatus

Only set status for well to open if well has open completions is now verified for all
This commit is contained in:
Fredrik Gundersen
2015-01-21 14:07:02 +01:00
parent 4d7213651c
commit 4f066af438
3 changed files with 16 additions and 10 deletions

View File

@@ -129,7 +129,13 @@ namespace Opm {
}
void Well::setStatus(size_t timeStep, WellCommon::StatusEnum status) {
m_status->add( timeStep , status );
if ((WellCommon::StatusEnum::OPEN == status) && this->getCompletions(timeStep)->allCompletionsShut()) {
std::cerr << "ERROR when handling WELOPEN for well "<< this->name() << ": Cannot open a well where all completions are shut" << std::endl;
} else
{
m_status->add( timeStep , status );
}
}
bool Well::isProducer(size_t timeStep) const {