opm-simulators icon indicating copy to clipboard operation
opm-simulators copied to clipboard

Rerun UDQ Assignments After Action Processing

Open bska opened this issue 1 year ago • 2 comments

If an action block happens to run a UDQ ASSIGN operation and, furthermore, happens to run at the last time step of an episode then the "clear pending assignments" behaviour of the ScheduleState copy constructor leads to not performing the UDQ assignment at all. This PR works around this problem by invoking the action handler's UDQ assignment function after processing all active action blocks.

The underlying problem has been present since at least PR OPM/opm-common#3587 which introduced the "clear pending assignments" behaviour of ScheduleState's copy constructor.

While here, also make a few whitespace adjustments to FlowProblem::endTimeStep() to be more consistent with the rest of the implementation.

bska avatar May 03 '24 09:05 bska

jenkins build this please

bska avatar May 03 '24 09:05 bska

jenkins build this please

bska avatar May 03 '24 16:05 bska

jenkins build this please

bska avatar May 06 '24 09:05 bska

jenkins build this please

blattms avatar May 21 '24 12:05 blattms

The call this->actionHandler_.evalUDQAssignments(...) in beginTimeStep will only have any effect on the first time step of an episode

You're probably thinking of this statement. That's triggered from beginEpisode() I think, and not from beginTimeStep(). That said,

are they run twice now?

Even if they were, that's where we get a bit of protection from the pending assignment structure in the UDConfig class. Every time we complete a round of UDQ assignments, we clear the list of pending assignments meaning if there are no new UDQ ASSIGN operations triggered between the end of the previous timestep and the start of the next, then we won't actually trigger the assignment twice.

bska avatar May 21 '24 12:05 bska