Don't Run ASSIGN on Every Report Step

Commit 5a060910a distinguished ASSIGN from DEFINE at the field
level, but did not make the same distinction at the well or group
levels.  Passing 'report_step' instead of assign.report_step() as an
argument to UDQState::assign() means we'd be running every ASSIGN
operation on every report step which would reset the state.  That's
a bug if the model defines some sort of cumulative UDQ at the well
or group levels.
This commit is contained in:
Bård Skaflestad
2023-06-13 10:06:25 +02:00
parent c33b94ca3a
commit 4c2617f537

View File

@@ -449,14 +449,14 @@ namespace Opm {
const auto groups = sched.groupNames(report_step);
for (const auto& assign : this->assignments(UDQVarType::WELL_VAR)) {
if (udq_state.assign(report_step, assign.keyword())) {
if (udq_state.assign(assign.report_step(), assign.keyword())) {
auto ws = assign.eval(wells);
context.update_assign(report_step, assign.keyword(), ws);
}
}
for (const auto& assign : this->assignments(UDQVarType::GROUP_VAR)) {
if (udq_state.assign(report_step, assign.keyword())) {
if (udq_state.assign(assign.report_step(), assign.keyword())) {
auto ws = assign.eval(groups);
context.update_assign(report_step, assign.keyword(), ws);
}