mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
fixing the interface of wellModel constructors
to make all the simulators compile.
This commit is contained in:
parent
26b16c1050
commit
0df52603d7
@ -1058,12 +1058,12 @@ namespace detail {
|
|||||||
converged = getWellConvergence(it);
|
converged = getWellConvergence(it);
|
||||||
|
|
||||||
// When the well targets are just updated or need to be updated, we need at least one more iteration.
|
// 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;
|
converged = false;
|
||||||
asImpl().wellModel().setJustUpdateWellTargets(false);
|
asImpl().wellModel().wellCollection()->setJustUpdateWellTargets(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (converged && asImpl().wellModel().needUpdateWellTargets()) {
|
if (converged && asImpl().wellModel().wellCollection()->needUpdateWellTargets()) {
|
||||||
converged = false;
|
converged = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,10 +141,12 @@ namespace Opm {
|
|||||||
|
|
||||||
MultisegmentWells::
|
MultisegmentWells::
|
||||||
MultisegmentWells(const Wells* wells_arg,
|
MultisegmentWells(const Wells* wells_arg,
|
||||||
|
WellCollection* well_collection,
|
||||||
const std::vector< const Well* >& wells_ecl,
|
const std::vector< const Well* >& wells_ecl,
|
||||||
const int time_step)
|
const int time_step)
|
||||||
: wells_multisegment_( createMSWellVector(wells_arg, wells_ecl, time_step) )
|
: wells_multisegment_( createMSWellVector(wells_arg, wells_ecl, time_step) )
|
||||||
, wops_ms_(wells_multisegment_)
|
, wops_ms_(wells_multisegment_)
|
||||||
|
, well_collection_(well_collection)
|
||||||
, num_phases_(wells_arg ? wells_arg->number_of_phases : 0)
|
, num_phases_(wells_arg ? wells_arg->number_of_phases : 0)
|
||||||
, wells_(wells_arg)
|
, wells_(wells_arg)
|
||||||
, fluid_(nullptr)
|
, fluid_(nullptr)
|
||||||
@ -381,6 +383,16 @@ namespace Opm {
|
|||||||
return indices;
|
return indices;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
WellCollection*
|
||||||
|
MultisegmentWells::
|
||||||
|
wellCollection() const {
|
||||||
|
return well_collection_;
|
||||||
|
}
|
||||||
|
|
||||||
} // end of namespace Opm
|
} // end of namespace Opm
|
||||||
|
|
||||||
|
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include <opm/core/props/BlackoilPhases.hpp>
|
#include <opm/core/props/BlackoilPhases.hpp>
|
||||||
|
#include <opm/core/wells/WellCollection.hpp>
|
||||||
|
|
||||||
#include <opm/autodiff/AutoDiffBlock.hpp>
|
#include <opm/autodiff/AutoDiffBlock.hpp>
|
||||||
#include <opm/autodiff/AutoDiffHelpers.hpp>
|
#include <opm/autodiff/AutoDiffHelpers.hpp>
|
||||||
@ -89,6 +90,7 @@ namespace Opm {
|
|||||||
// TODO: using a vector of WellMultiSegmentConstPtr for now
|
// TODO: using a vector of WellMultiSegmentConstPtr for now
|
||||||
// TODO: it should use const Wells or something else later.
|
// TODO: it should use const Wells or something else later.
|
||||||
MultisegmentWells(const Wells* wells_arg,
|
MultisegmentWells(const Wells* wells_arg,
|
||||||
|
WellCollection* well_collection,
|
||||||
const std::vector< const Well* >& wells_ecl,
|
const std::vector< const Well* >& wells_ecl,
|
||||||
const int time_step);
|
const int time_step);
|
||||||
|
|
||||||
@ -229,11 +231,16 @@ namespace Opm {
|
|||||||
const std::vector<ADB>& kr_adb,
|
const std::vector<ADB>& kr_adb,
|
||||||
const std::vector<ADB>& fluid_density);
|
const std::vector<ADB>& fluid_density);
|
||||||
|
|
||||||
|
WellCollection* wellCollection() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// TODO: probably a wells_active_ will be required here.
|
// TODO: probably a wells_active_ will be required here.
|
||||||
bool wells_active_;
|
bool wells_active_;
|
||||||
std::vector<WellMultiSegmentConstPtr> wells_multisegment_;
|
std::vector<WellMultiSegmentConstPtr> wells_multisegment_;
|
||||||
MultisegmentWellOps wops_ms_;
|
MultisegmentWellOps wops_ms_;
|
||||||
|
// It will probably need to be updated during running time.
|
||||||
|
WellCollection* well_collection_;
|
||||||
|
|
||||||
const int num_phases_;
|
const int num_phases_;
|
||||||
int nseg_total_;
|
int nseg_total_;
|
||||||
int nperf_total_;
|
int nperf_total_;
|
||||||
|
@ -122,7 +122,7 @@ namespace Opm
|
|||||||
const auto wells_ecl = eclipse_state_->getSchedule().getWells(timer.currentStepNum());
|
const auto wells_ecl = eclipse_state_->getSchedule().getWells(timer.currentStepNum());
|
||||||
const int current_time_step = 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);
|
well_state.init(well_model, state, prev_well_state, wells);
|
||||||
|
|
||||||
|
@ -191,23 +191,14 @@ namespace Opm {
|
|||||||
const WellState& well_state,
|
const WellState& well_state,
|
||||||
DynamicListEconLimited& list_econ_limited) const;
|
DynamicListEconLimited& list_econ_limited) const;
|
||||||
|
|
||||||
bool justUpdateWellTargets() const {
|
|
||||||
return well_collection_->justUpdateWellTargets();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool needUpdateWellTargets() const {
|
WellCollection* wellCollection() const;
|
||||||
return well_collection_->needUpdateWellTargets();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setJustUpdateWellTargets(const bool flag) const {
|
|
||||||
well_collection_->setJustUpdateWellTargets(flag);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool wells_active_;
|
bool wells_active_;
|
||||||
const Wells* wells_;
|
const Wells* wells_;
|
||||||
const WellOps wops_;
|
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_;
|
WellCollection* well_collection_;
|
||||||
|
|
||||||
const BlackoilPropsAdInterface* fluid_;
|
const BlackoilPropsAdInterface* fluid_;
|
||||||
|
@ -37,7 +37,7 @@ namespace Opm {
|
|||||||
using Base::computeWellConnectionDensitesPressures;
|
using Base::computeWellConnectionDensitesPressures;
|
||||||
|
|
||||||
// --------- Public methods ---------
|
// --------- Public methods ---------
|
||||||
StandardWellsSolvent(const Wells* wells_arg);
|
StandardWellsSolvent(const Wells* wells_arg, WellCollection* well_collection);
|
||||||
|
|
||||||
// added the Solvent related
|
// added the Solvent related
|
||||||
void initSolvent(const SolventPropsAdFromDeck* solvent_props,
|
void initSolvent(const SolventPropsAdFromDeck* solvent_props,
|
||||||
|
@ -32,8 +32,8 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg)
|
StandardWellsSolvent::StandardWellsSolvent(const Wells* wells_arg, WellCollection* well_collection)
|
||||||
: Base(wells_arg)
|
: Base(wells_arg, well_collection)
|
||||||
, solvent_props_(nullptr)
|
, solvent_props_(nullptr)
|
||||||
, solvent_pos_(-1)
|
, solvent_pos_(-1)
|
||||||
, has_solvent_(false)
|
, has_solvent_(false)
|
||||||
|
@ -1602,4 +1602,12 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
WellCollection* StandardWells::wellCollection() const {
|
||||||
|
return well_collection_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -119,7 +119,7 @@ struct SetupMSW {
|
|||||||
const Wells* wells = wells_manager.c_wells();
|
const Wells* wells = wells_manager.c_wells();
|
||||||
const auto wells_ecl = ecl_state.getSchedule().getWells(current_timestep);
|
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;
|
std::shared_ptr<const Opm::MultisegmentWells> ms_wells;
|
||||||
|
Loading…
Reference in New Issue
Block a user