@@ -697,7 +697,7 @@ checkGroupHigherConstraints(const Group& group,
697
697
resv_coeff_inj,
698
698
deferred_logger);
699
699
if (is_changed) {
700
- switched_inj_groups_[group.name ()][static_cast <std::underlying_type_t <Phase>>(phase)].push_back (Group::InjectionCMode::FLD );
700
+ switched_inj_groups_[group.name ()][static_cast <std::underlying_type_t <Phase>>(phase)].push_back (currentControl );
701
701
BlackoilWellModelConstraints (*this ).
702
702
actionOnBrokenConstraints (group, Group::InjectionCMode::FLD,
703
703
phase, this ->groupState (),
@@ -784,7 +784,7 @@ checkGroupHigherConstraints(const Group& group,
784
784
deferred_logger);
785
785
786
786
if (changed) {
787
- switched_prod_groups_[group.name ()].push_back (Group::ProductionCMode::FLD );
787
+ switched_prod_groups_[group.name ()].push_back (currentControl );
788
788
WellGroupHelpers<Scalar>::updateWellRatesFromGroupTargetScale (scaling_factor,
789
789
group,
790
790
schedule (),
@@ -1388,7 +1388,7 @@ updateAndCommunicateGroupData(const int reportStepIdx,
1388
1388
WellGroupHelpers<Scalar>::updateWellRates (fieldGroup,
1389
1389
schedule (),
1390
1390
reportStepIdx,
1391
- this -> prevWellState () ,
1391
+ well_state_nupcol ,
1392
1392
well_state);
1393
1393
1394
1394
// Set ALQ for off-process wells to zero
@@ -2033,36 +2033,36 @@ void BlackoilWellModelGeneric<Scalar>::
2033
2033
reportGroupSwitching (DeferredLogger& local_deferredLogger) const
2034
2034
{
2035
2035
for (const auto & [name, ctrls] : this ->switched_prod_groups_ ) {
2036
- const Group::ProductionCMode& oldControl =
2037
- this ->prevWGState (). group_state .production_control (name);
2038
- if (ctrls. back () != oldControl ) {
2036
+ const Group::ProductionCMode& newControl =
2037
+ this ->groupState () .production_control (name);
2038
+ if (ctrls[ 0 ] != newControl ) {
2039
2039
const std::string msg =
2040
2040
fmt::format (" Production Group {} control model changed from {} to {}" ,
2041
2041
name,
2042
- Group::ProductionCMode2String (oldControl ),
2043
- Group::ProductionCMode2String (ctrls. back () ));
2042
+ Group::ProductionCMode2String (ctrls[ 0 ] ),
2043
+ Group::ProductionCMode2String (newControl ));
2044
2044
local_deferredLogger.info (msg);
2045
2045
}
2046
2046
}
2047
2047
for (const auto & [grname, grdata] : this ->switched_inj_groups_ ) {
2048
2048
const Phase all[] = {Phase::WATER, Phase::OIL, Phase::GAS};
2049
2049
for (Phase phase : all) {
2050
- if (!this ->prevWGState (). group_state .has_injection_control (grname, phase)) {
2050
+ if (!this ->groupState () .has_injection_control (grname, phase)) {
2051
2051
continue ;
2052
2052
}
2053
2053
const auto & ctrls = grdata[static_cast <std::underlying_type_t <Phase>>(phase)];
2054
2054
if (ctrls.empty ()) {
2055
2055
continue ;
2056
2056
}
2057
2057
2058
- const Group::InjectionCMode& oldControl =
2059
- this ->prevWGState (). group_state .injection_control (grname, phase);
2060
- if (ctrls. back () != oldControl ) {
2058
+ const Group::InjectionCMode& newControl =
2059
+ this ->groupState () .injection_control (grname, phase);
2060
+ if (ctrls[ 0 ] != newControl ) {
2061
2061
const std::string msg =
2062
2062
fmt::format (" Injection Group {} control model changed from {} to {}" ,
2063
2063
grname,
2064
- Group::InjectionCMode2String (oldControl ),
2065
- Group::InjectionCMode2String (ctrls. back () ));
2064
+ Group::InjectionCMode2String (ctrls[ 0 ] ),
2065
+ Group::InjectionCMode2String (newControl ));
2066
2066
local_deferredLogger.info (msg);
2067
2067
}
2068
2068
}
0 commit comments