Support WGRUPCON item 2 = no

This commit is contained in:
Tor Harald Sandve 2023-03-31 11:47:33 +02:00
parent 62f8a6433d
commit dbe8c3d294
2 changed files with 14 additions and 2 deletions

View File

@ -131,6 +131,10 @@ checkGroupConstraints(WellState& well_state,
const SummaryState& summaryState, const SummaryState& summaryState,
DeferredLogger& deferred_logger) const 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) 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) if (prod_gname)

View File

@ -302,13 +302,21 @@ void WellState::init(const std::vector<double>& cellPressures,
auto& ws = this->well(w); auto& ws = this->well(w);
if (wells_ecl[w].isProducer()) { if (wells_ecl[w].isProducer()) {
const auto controls = wells_ecl[w].productionControls(summary_state); const auto controls = wells_ecl[w].productionControls(summary_state);
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; ws.production_cmode = controls.cmode;
} }
}
else { else {
const auto controls = wells_ecl[w].injectionControls(summary_state); const auto controls = wells_ecl[w].injectionControls(summary_state);
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; ws.injection_cmode = controls.cmode;
} }
} }
}
for (int w = 0; w < nw; ++w) { for (int w = 0; w < nw; ++w) {