Use enum Well::Status to indicate well status instead of bool

This commit is contained in:
Joakim Hove 2020-12-09 10:44:24 +01:00 committed by Bård Skaflestad
parent 0468b2eee6
commit 9662d4019e
6 changed files with 15 additions and 14 deletions

View File

@ -244,7 +244,7 @@ namespace Opm
using Base::ebosCompIdxToFlowCompIdx;
using Base::getAllowCrossFlow;
using Base::scalingFactor;
using Base::wellIsStopped_;
using Base::wellIsStopped;
using Base::updateWellOperability;
using Base::checkWellOperability;

View File

@ -302,7 +302,7 @@ namespace Opm
const int np = well_state.numPhases();
const auto& summaryState = ebos_simulator.vanguard().summaryState();
if (wellIsStopped_) {
if (this->wellIsStopped()) {
for (int p = 0; p<np; ++p) {
well_state.wellRates()[well_index*np + p] = 0.0;
}
@ -2030,7 +2030,7 @@ namespace Opm
return rates;
};
if (wellIsStopped_) {
if (this->wellIsStopped()) {
control_eq = getWQTotal();
} else if (this->isInjector() ) {
// Find scaling factor to get injection rate,

View File

@ -336,6 +336,7 @@ namespace Opm
using Base::mostStrictBhpFromBhpLimits;
using Base::updateWellOperability;
using Base::checkWellOperability;
using Base::wellIsStopped;
// protected member variables from the Base class
using Base::current_step_;
@ -362,7 +363,6 @@ namespace Opm
using Base::ipr_b_;
using Base::changed_to_stopped_this_step_;
using Base::wellIsStopped_;
// total number of the well equations and primary variables
// there might be extra equations be used, numWellEq will be updated during the initialization

View File

@ -892,7 +892,7 @@ namespace Opm
return rates;
};
if (wellIsStopped_) {
if (this->wellIsStopped()) {
control_eq = getWQTotal();
} else if (this->isInjector()) {
// Find injection rate.
@ -1365,7 +1365,7 @@ namespace Opm
const int np = well_state.numPhases();
const auto& summaryState = ebos_simulator.vanguard().summaryState();
if (wellIsStopped_) {
if (this->wellIsStopped()) {
for (int p = 0; p<np; ++p) {
well_state.wellRates()[well_index*np + p] = 0.0;
}
@ -3490,7 +3490,7 @@ namespace Opm
CR::WellFailure::Type ctrltype = CR::WellFailure::Type::Invalid;
const int well_index = index_of_well_;
if (wellIsStopped_) {
if (this->wellIsStopped()) {
ctrltype = CR::WellFailure::Type::ControlRate;
control_tolerance = 1.e-6; // use smaller tolerance for zero control?
}

View File

@ -307,14 +307,15 @@ namespace Opm
DeferredLogger& deferred_logger) const;
void stopWell() {
wellIsStopped_ = true;
this->wellStatus_ = Well::Status::STOP;
}
void openWell() {
wellIsStopped_ = false;
this->wellStatus_ = Well::Status::OPEN;
}
bool wellIsStopped() const {
return wellIsStopped_;
return this->wellStatus_ == Well::Status::STOP;
}
void setWsolvent(const double wsolvent);
@ -419,7 +420,7 @@ namespace Opm
std::vector<RateVector> connectionRates_;
bool wellIsStopped_;
Well::Status wellStatus_;
double wsolvent_;

View File

@ -90,9 +90,9 @@ namespace Opm
connectionRates_.resize(number_of_perforations_);
wellIsStopped_ = false;
this->wellStatus_ = Well::Status::OPEN;
if (well.getStatus() == Well::Status::STOP) {
wellIsStopped_ = true;
this->wellStatus_ = Well::Status::STOP;
}
wsolvent_ = 0.0;
@ -973,7 +973,7 @@ namespace Opm
WellTestState& well_test_state,
Opm::DeferredLogger& deferred_logger) const
{
if (wellIsStopped_)
if (this->wellIsStopped())
return;
const WellEconProductionLimits& econ_production_limits = well_ecl_.getEconLimits();