mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Handle WellOpen has both open and shut.
This commit is contained in:
parent
1a37c410fc
commit
068cbf0605
@ -689,18 +689,24 @@ namespace Opm
|
|||||||
std::string wellname = line.well_;
|
std::string wellname = line.well_;
|
||||||
std::map<std::string, int>::const_iterator it = well_names_to_index.find(wellname);
|
std::map<std::string, int>::const_iterator it = well_names_to_index.find(wellname);
|
||||||
if (it == well_names_to_index.end()) {
|
if (it == well_names_to_index.end()) {
|
||||||
THROW("Trying to open well with name: \"" << wellname<<"\" but it's not registered under WELSPECS.");
|
THROW("Trying to open/shut well with name: \"" << wellname<<"\" but it's not registered under WELSPECS.");
|
||||||
}
|
}
|
||||||
int index = it->second;
|
int index = it->second;
|
||||||
|
if (line.openshutflag_ == "SHUT") {
|
||||||
// We don't open already open wells
|
// We don't open already open wells
|
||||||
/// \TODO Should this perhaps be allowed? I.e. should it be if(well_shut) { shutwell(); } else { /* do nothing*/ }?
|
/// \TODO Should this perhaps be allowed? I.e. should it be if(well_shut) { shutwell(); } else { /* do nothing*/ }?
|
||||||
ASSERT(w_->ctrls[index]->current < 0);
|
ASSERT(w_->ctrls[index]->current < 0);
|
||||||
|
} else if (line.openshutflag_ == "OPEN") {
|
||||||
|
ASSERT(w_->ctrls[index]->current >= 0);
|
||||||
|
} else {
|
||||||
|
THROW("Unknown Open/close keyword: \"" << line.openshutflag_<< "\". Allowed values: OPEN, SHUT.");
|
||||||
|
}
|
||||||
|
|
||||||
// We revert back to it's original control.
|
// We revert back to it's original control.
|
||||||
// Note that this is OK as ~~ = id.
|
// Note that this is OK as ~~ = id.
|
||||||
w_->ctrls[index]->current = ~w_->ctrls[index]->current;
|
w_->ctrls[index]->current = ~w_->ctrls[index]->current;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user