Skip to content

Commit 1c0f4b6

Browse files
author
Tor Harald Sandve
committed
Dont use BHP/THP from privious shut wells
1 parent 57c31cb commit 1c0f4b6

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

opm/simulators/wells/WellState.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,22 +388,20 @@ init(const std::vector<Scalar>& cellPressures,
388388
}
389389

390390
const auto& prev_well = prevState->well(*old_index);
391-
392-
auto& new_well = this->well(w);
393-
new_well.init_timestep(prev_well);
394-
395391
if (prev_well.status == Well::Status::SHUT) {
396392
// Well was shut in previous state, do not use its values.
397393
continue;
398394
}
399395

400-
new_well.status = prev_well.status;
401-
396+
auto& new_well = this->well(w);
402397
if (new_well.producer != prev_well.producer) {
403398
// Well changed to/from injector from/to producer, do not
404399
// use its previous values.
405400
continue;
406401
}
402+
// Use bhp, thp and temperature from previous values
403+
new_well.init_timestep(prev_well);
404+
new_well.status = prev_well.status;
407405

408406
// If new target is set using WCONPROD, WCONINJE etc. we use the new control
409407
if (!new_well.events.hasEvent(WellState::event_mask)) {

0 commit comments

Comments
 (0)