fixing the interface of wellModel constructors

to make all the simulators compile.
This commit is contained in:
Kai Bao 2016-10-13 18:16:19 +02:00
parent 26b16c1050
commit 0df52603d7
9 changed files with 37 additions and 19 deletions

View File

@ -1058,12 +1058,12 @@ namespace detail {
converged = getWellConvergence(it);
// When the well targets are just updated or need to be updated, we need at least one more iteration.
if (asImpl().wellModel().justUpdateWellTargets()) {
if (asImpl().wellModel().wellCollection()->justUpdateWellTargets()) {
converged = false;
asImpl().wellModel().setJustUpdateWellTargets(false);
asImpl().wellModel().wellCollection()->setJustUpdateWellTargets(false);
}
if (converged && asImpl().wellModel().needUpdateWellTargets()) {
if (converged && asImpl().wellModel().wellCollection()->needUpdateWellTargets()) {
converged = false;
}

View File

@ -141,10 +141,12 @@ namespace Opm {
MultisegmentWells::
MultisegmentWells(const Wells* wells_arg,
WellCollection* well_collection,
const std::vector< const Well* >& wells_ecl,
const int time_step)
: wells_multisegment_( createMSWellVector(wells_arg, wells_ecl, time_step) )
, wops_ms_(wells_multisegment_)
, well_collection_(well_collection)
, num_phases_(wells_arg ? wells_arg->number_of_phases : 0)
, wells_(wells_arg)
, fluid_(nullptr)
@ -381,6 +383,16 @@ namespace Opm {
return indices;
}
WellCollection*
MultisegmentWells::
wellCollection() const {
return well_collection_;
}
} // end of namespace Opm

View File

@ -32,6 +32,7 @@
#include <cassert>
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/core/wells/WellCollection.hpp>
#include <opm/autodiff/AutoDiffBlock.hpp>
#include <opm/autodiff/AutoDiffHelpers.hpp>
@ -89,6 +90,7 @@ namespace Opm {
// TODO: using a vector of WellMultiSegmentConstPtr for now
// TODO: it should use const Wells or something else later.
MultisegmentWells(const Wells* wells_arg,
WellCollection* well_collection,
const std::vector< const Well* >& wells_ecl,
const int time_step);
@ -229,11 +231,16 @@ namespace Opm {
const std::vector<ADB>& kr_adb,
const std::vector<ADB>& fluid_density);
WellCollection* wellCollection() const;
protected:
// TODO: probably a wells_active_ will be required here.
bool wells_active_;
std::vector<WellMultiSegmentConstPtr> wells_multisegment_;
MultisegmentWellOps wops_ms_;
// It will probably need to be updated during running time.
WellCollection* well_collection_;
const int num_phases_;
int nseg_total_;
int nperf_total_;

View File

@ -122,7 +122,7 @@ namespace Opm
const auto wells_ecl = eclipse_state_->getSchedule().getWells(timer.currentStepNum());
const int current_time_step = timer.currentStepNum();
const WellModel well_model(wells, wells_ecl, current_time_step);
const WellModel well_model(wells, &(wells_manager.wellCollection()), wells_ecl, current_time_step);
well_state.init(well_model, state, prev_well_state, wells);

View File

@ -191,23 +191,14 @@ namespace Opm {
const WellState& well_state,
DynamicListEconLimited& list_econ_limited) const;
bool justUpdateWellTargets() const {
return well_collection_->justUpdateWellTargets();
}
bool needUpdateWellTargets() const {
return well_collection_->needUpdateWellTargets();
}
void setJustUpdateWellTargets(const bool flag) const {
well_collection_->setJustUpdateWellTargets(flag);
}
WellCollection* wellCollection() const;
protected:
bool wells_active_;
const Wells* wells_;
const WellOps wops_;
// TODO: It will probably need to be updated during running time.
// It will probably need to be updated during running time.
WellCollection* well_collection_;
const BlackoilPropsAdInterface* fluid_;

View File

@ -37,7 +37,7 @@ namespace Opm {
using Base::computeWellConnectionDensitesPressures;
// --------- Public methods ---------
StandardWellsSolvent(const Wells* wells_arg);
StandardWellsSolvent(const Wells* wells_arg, WellCollection* well_collection);
// added the Solvent related
void initSolvent(const SolventPropsAdFromDeck* solvent_props,

View File

@ -32,8 +32,8 @@ namespace Opm
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg)
: Base(wells_arg)
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg, WellCollection* well_collection)
: Base(wells_arg, well_collection)
, solvent_props_(nullptr)
, solvent_pos_(-1)
, has_solvent_(false)

View File

@ -1602,4 +1602,12 @@ namespace Opm
}
WellCollection* StandardWells::wellCollection() const {
return well_collection_;
}
} // namespace Opm

View File

@ -119,7 +119,7 @@ struct SetupMSW {
const Wells* wells = wells_manager.c_wells();
const auto wells_ecl = ecl_state.getSchedule().getWells(current_timestep);
ms_wells.reset(new Opm::MultisegmentWells(wells, wells_ecl, current_timestep));
ms_wells.reset(new Opm::MultisegmentWells(wells, &(wells_manager.wellCollection()), wells_ecl, current_timestep));
};
std::shared_ptr<const Opm::MultisegmentWells> ms_wells;