mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2978 from joakim-hove/use-well-status
Use enum Well::Status for well status in WellState
This commit is contained in:
commit
2673af7db5
@ -762,7 +762,7 @@ namespace Opm {
|
|||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
// stopped wells are added to the container but marked as stopped
|
// stopped wells are added to the container but marked as stopped
|
||||||
well_state_.thp()[w] = 0.;
|
well_state_.stopWell(w);
|
||||||
wellIsStopped = true;
|
wellIsStopped = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -809,7 +809,7 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (well_status == Well::Status::STOP) {
|
if (well_status == Well::Status::STOP) {
|
||||||
well_state_.thp()[w] = 0.;
|
well_state_.stopWell(w);
|
||||||
wellIsStopped = true;
|
wellIsStopped = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ namespace Opm
|
|||||||
// const int np = wells->number_of_phases;
|
// const int np = wells->number_of_phases;
|
||||||
const int np = pu.num_phases;
|
const int np = pu.num_phases;
|
||||||
np_ = np;
|
np_ = np;
|
||||||
open_for_output_.assign(nw, true);
|
status_.assign(nw, Well::Status::OPEN);
|
||||||
bhp_.resize(nw, 0.0);
|
bhp_.resize(nw, 0.0);
|
||||||
thp_.resize(nw, 0.0);
|
thp_.resize(nw, 0.0);
|
||||||
temperature_.resize(nw, 273.15 + 15.56); // standard condition temperature
|
temperature_.resize(nw, 273.15 + 15.56); // standard condition temperature
|
||||||
@ -219,9 +219,12 @@ namespace Opm
|
|||||||
return np_;
|
return np_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void openWell(int well_index) {
|
||||||
|
this->status_[well_index] = Well::Status::OPEN;
|
||||||
|
}
|
||||||
|
|
||||||
virtual void shutWell(int well_index) {
|
virtual void shutWell(int well_index) {
|
||||||
this->open_for_output_[well_index] = false;
|
this->status_[well_index] = Well::Status::SHUT;
|
||||||
this->thp_[well_index] = 0;
|
this->thp_[well_index] = 0;
|
||||||
this->bhp_[well_index] = 0;
|
this->bhp_[well_index] = 0;
|
||||||
const int np = numPhases();
|
const int np = numPhases();
|
||||||
@ -229,6 +232,10 @@ namespace Opm
|
|||||||
this->wellrates_[np * well_index + p] = 0;
|
this->wellrates_[np * well_index + p] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void stopWell(int well_index) {
|
||||||
|
this->status_[well_index] = Well::Status::STOP;
|
||||||
|
this->thp_[well_index] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
virtual data::Wells report(const PhaseUsage& pu, const int* globalCellIdxMap) const
|
virtual data::Wells report(const PhaseUsage& pu, const int* globalCellIdxMap) const
|
||||||
{
|
{
|
||||||
@ -237,7 +244,7 @@ namespace Opm
|
|||||||
data::Wells dw;
|
data::Wells dw;
|
||||||
for( const auto& itr : this->wellMap_ ) {
|
for( const auto& itr : this->wellMap_ ) {
|
||||||
const auto well_index = itr.second[ 0 ];
|
const auto well_index = itr.second[ 0 ];
|
||||||
if (!this->open_for_output_[well_index])
|
if (this->status_[well_index] != Well::Status::OPEN)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const auto& pwinfo = *parallel_well_info_[well_index];
|
const auto& pwinfo = *parallel_well_info_[well_index];
|
||||||
@ -314,7 +321,7 @@ namespace Opm
|
|||||||
std::vector<double> perfpress_;
|
std::vector<double> perfpress_;
|
||||||
int np_;
|
int np_;
|
||||||
protected:
|
protected:
|
||||||
std::vector<bool> open_for_output_;
|
std::vector<Well::Status> status_;
|
||||||
private:
|
private:
|
||||||
|
|
||||||
WellMapType wellMap_;
|
WellMapType wellMap_;
|
||||||
|
@ -559,7 +559,7 @@ namespace Opm
|
|||||||
for( const auto& wt : this->wellMap() ) {
|
for( const auto& wt : this->wellMap() ) {
|
||||||
const auto w = wt.second[ 0 ];
|
const auto w = wt.second[ 0 ];
|
||||||
const auto& pwinfo = *parallel_well_info_[w];
|
const auto& pwinfo = *parallel_well_info_[w];
|
||||||
if (!this->open_for_output_[w] || !pwinfo.isOwner())
|
if ((this->status_[w] != Well::Status::OPEN) || !pwinfo.isOwner())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto& well = res.at( wt.first );
|
auto& well = res.at( wt.first );
|
||||||
@ -1075,6 +1075,10 @@ namespace Opm
|
|||||||
this->well_reservoir_rates_[np * well_index + p] = 0;
|
this->well_reservoir_rates_[np * well_index + p] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void stopWell(int well_index) override {
|
||||||
|
WellState::stopWell(well_index);
|
||||||
|
}
|
||||||
|
|
||||||
template<class Comm>
|
template<class Comm>
|
||||||
void communicateGroupRates(const Comm& comm)
|
void communicateGroupRates(const Comm& comm)
|
||||||
{
|
{
|
||||||
@ -1178,7 +1182,7 @@ namespace Opm
|
|||||||
if (it != end) {
|
if (it != end) {
|
||||||
// ... set the GRUP/not GRUP states.
|
// ... set the GRUP/not GRUP states.
|
||||||
const int well_index = it->second[0];
|
const int well_index = it->second[0];
|
||||||
if (!this->open_for_output_[well_index]) {
|
if (this->status_[well_index] != Well::Status::OPEN) {
|
||||||
// Well is shut.
|
// Well is shut.
|
||||||
if (well.isInjector()) {
|
if (well.isInjector()) {
|
||||||
globalIsInjectionGrup_[global_well_index] = 0;
|
globalIsInjectionGrup_[global_well_index] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user