Clone the Wells pointer for output use later.

This commit is contained in:
Atgeirr Flø Rasmussen 2016-06-21 12:00:10 +02:00 committed by Liu Ming
parent 9bfb3f909e
commit 2c50e208dd
2 changed files with 5 additions and 2 deletions

View File

@ -119,7 +119,7 @@ namespace Opm
const WellModel well_model(wells, wells_ecl, current_time_step); 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 // give the polymer and surfactant simulators the chance to do their stuff
Base::asImpl().handleAdditionalWellInflow(timer, wells_manager, well_state, wells); Base::asImpl().handleAdditionalWellInflow(timer, wells_manager, well_state, wells);

View File

@ -65,8 +65,11 @@ namespace Opm
/// to give useful initial values to the bhp(), wellRates() /// to give useful initial values to the bhp(), wellRates()
/// and perfPhaseRates() fields, depending on controls /// and perfPhaseRates() fields, depending on controls
template <class ReservoirState, class PrevWellState> template <class ReservoirState, class PrevWellState>
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<WellMultiSegmentConstPtr>& wells = ms_wells.msWells(); const std::vector<WellMultiSegmentConstPtr>& wells = ms_wells.msWells();
const int nw = wells.size(); const int nw = wells.size();
nseg_ = 0; nseg_ = 0;