mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3309 from joakim-hove/wellrates-at
Make sure all wells are added to the well_rates map
This commit is contained in:
commit
db49c8aeef
@ -236,9 +236,13 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
// call init on base class
|
// call init on base class
|
||||||
this->base_init(cellPressures, wells_ecl, parallel_well_info, well_perf_data, summary_state);
|
this->base_init(cellPressures, wells_ecl, parallel_well_info, well_perf_data, summary_state);
|
||||||
this->global_well_info = std::make_optional<GlobalWellInfo>( schedule, report_step, wells_ecl );
|
this->global_well_info = std::make_optional<GlobalWellInfo>( schedule, report_step, wells_ecl );
|
||||||
|
for (const auto& wname : schedule.wellNames(report_step))
|
||||||
|
{
|
||||||
|
well_rates.insert({wname, std::make_pair(false, std::vector<double>(this->numPhases()))});
|
||||||
|
}
|
||||||
for (const auto& winfo: parallel_well_info)
|
for (const auto& winfo: parallel_well_info)
|
||||||
{
|
{
|
||||||
well_rates.insert({winfo->name(), std::make_pair(winfo->isOwner(), std::vector<double>(this->numPhases()))});
|
well_rates[winfo->name()].first = winfo->isOwner();
|
||||||
}
|
}
|
||||||
|
|
||||||
const int nw = wells_ecl.size();
|
const int nw = wells_ecl.size();
|
||||||
|
@ -110,8 +110,10 @@ public:
|
|||||||
Well::ProducerCMode currentProductionControl(std::size_t well_index) const { return current_production_controls_[well_index]; }
|
Well::ProducerCMode currentProductionControl(std::size_t well_index) const { return current_production_controls_[well_index]; }
|
||||||
void currentProductionControl(std::size_t well_index, Well::ProducerCMode cmode) { current_production_controls_[well_index] = cmode; }
|
void currentProductionControl(std::size_t well_index, Well::ProducerCMode cmode) { current_production_controls_[well_index] = cmode; }
|
||||||
|
|
||||||
void setCurrentWellRates(const std::string& wellName, const std::vector<double>& rates ) {
|
void setCurrentWellRates(const std::string& wellName, const std::vector<double>& new_rates ) {
|
||||||
well_rates[wellName].second = rates;
|
auto& [owner, rates] = this->well_rates.at(wellName);
|
||||||
|
if (owner)
|
||||||
|
rates = new_rates;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::vector<double>& currentWellRates(const std::string& wellName) const;
|
const std::vector<double>& currentWellRates(const std::string& wellName) const;
|
||||||
@ -483,6 +485,9 @@ private:
|
|||||||
WellContainer<Opm::Well::InjectorCMode> current_injection_controls_;
|
WellContainer<Opm::Well::InjectorCMode> current_injection_controls_;
|
||||||
WellContainer<Well::ProducerCMode> current_production_controls_;
|
WellContainer<Well::ProducerCMode> current_production_controls_;
|
||||||
|
|
||||||
|
// The well_rates variable is defined for all wells on all processors. The
|
||||||
|
// bool in the value pair is whether the current process owns the well or
|
||||||
|
// not.
|
||||||
std::map<std::string, std::pair<bool, std::vector<double>>> well_rates;
|
std::map<std::string, std::pair<bool, std::vector<double>>> well_rates;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user