Merge pull request #4575 from totto82/wgrupcon_no

Support WGRUPCON item 2 = no
This commit is contained in:
Tor Harald Sandve 2023-04-14 08:16:28 +02:00 committed by GitHub
commit fcb6eeb0ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 2 deletions

View File

@ -131,6 +131,10 @@ checkGroupConstraints(WellState& well_state,
const SummaryState& summaryState,
DeferredLogger& deferred_logger) const
{
if (!this->wellEcl().isAvailableForGroupControl())
return false;
auto rCoeff = [this, &group_state](const RegionId id, const int region, const std::optional<std::string>& prod_gname, std::vector<double>& coeff)
{
if (prod_gname)

View File

@ -302,11 +302,19 @@ void WellState::init(const std::vector<double>& cellPressures,
auto& ws = this->well(w);
if (wells_ecl[w].isProducer()) {
const auto controls = wells_ecl[w].productionControls(summary_state);
ws.production_cmode = controls.cmode;
if (controls.cmode == Well::ProducerCMode::GRUP && !wells_ecl[w].isAvailableForGroupControl()) {
ws.production_cmode = Well::ProducerCMode::BHP; // wells always has a BHP control
} else {
ws.production_cmode = controls.cmode;
}
}
else {
const auto controls = wells_ecl[w].injectionControls(summary_state);
ws.injection_cmode = controls.cmode;
if (controls.cmode == Well::InjectorCMode::GRUP && !wells_ecl[w].isAvailableForGroupControl()) {
ws.injection_cmode = Well::InjectorCMode::BHP; // wells always has a BHP control
} else {
ws.injection_cmode = controls.cmode;
}
}
}