From 2c50e208dde29383f0077aca7014cb2e1ef9623d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Tue, 21 Jun 2016 12:00:10 +0200 Subject: [PATCH] Clone the Wells pointer for output use later. --- .../SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp | 2 +- opm/autodiff/WellStateMultiSegment.hpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp index 2293e0e77..5e20fff11 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilMultiSegment_impl.hpp @@ -119,7 +119,7 @@ namespace Opm const WellModel well_model(wells, wells_ecl, current_time_step); - well_state.init(well_model, state, prev_well_state); + well_state.init(well_model, state, prev_well_state, wells); // give the polymer and surfactant simulators the chance to do their stuff Base::asImpl().handleAdditionalWellInflow(timer, wells_manager, well_state, wells); diff --git a/opm/autodiff/WellStateMultiSegment.hpp b/opm/autodiff/WellStateMultiSegment.hpp index 783288eb3..a2cfcb858 100644 --- a/opm/autodiff/WellStateMultiSegment.hpp +++ b/opm/autodiff/WellStateMultiSegment.hpp @@ -65,8 +65,11 @@ namespace Opm /// to give useful initial values to the bhp(), wellRates() /// and perfPhaseRates() fields, depending on controls template - void init(const MultisegmentWells& ms_wells, const ReservoirState& state, const PrevWellState& prevState) + void init(const MultisegmentWells& ms_wells, const ReservoirState& state, const PrevWellState& prevState, const Wells* legacy_wells_ptr) { + // Used by output facilities. + this->wells_.reset( clone_wells( legacy_wells_ptr ) ); + const std::vector& wells = ms_wells.msWells(); const int nw = wells.size(); nseg_ = 0;