drop type alias GasLiftSingleWell::GLiftWellState

This commit is contained in:
Arne Morten Kvarving 2021-05-20 14:12:41 +02:00
parent 28b9f04721
commit e8603dfea3
2 changed files with 18 additions and 19 deletions

View File

@ -61,7 +61,6 @@ namespace Opm
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using WellState = WellStateFullyImplicitBlackoil;
using StdWell = StandardWell<TypeTag>;
using GLiftWellState = GasLiftWellState;
// TODO: same definition with WellInterface, and
// WellStateFullyImplicitBlackoil eventually they should go
// to a common header file.
@ -85,7 +84,7 @@ namespace Opm
std::pair<double, double> getStage2Rates();
const WellInterface<TypeTag> &getStdWell() const { return std_well_; }
bool hasStage2Rates();
std::unique_ptr<GLiftWellState> runOptimize();
std::unique_ptr<GasLiftWellState> runOptimize();
const std::string& name() const {return well_name_; }
void updateStage2State(const GradInfo &gi, bool increase);
@ -155,13 +154,13 @@ namespace Opm
reduceALQtoOilTarget_(double alq, double oil_rate, double gas_rate,
bool oil_is_limited, bool gas_is_limited, std::vector<double> &potentials);
std::unique_ptr<GLiftWellState> runOptimize1_();
std::unique_ptr<GLiftWellState> runOptimize2_();
std::unique_ptr<GLiftWellState> runOptimizeLoop_(bool increase);
std::unique_ptr<GasLiftWellState> runOptimize1_();
std::unique_ptr<GasLiftWellState> runOptimize2_();
std::unique_ptr<GasLiftWellState> runOptimizeLoop_(bool increase);
void setAlqMaxRate_(const GasLiftOpt::Well &well);
void setAlqMinRate_(const GasLiftOpt::Well &well);
std::unique_ptr<GLiftWellState> tryIncreaseLiftGas_();
std::unique_ptr<GLiftWellState> tryDecreaseLiftGas_();
std::unique_ptr<GasLiftWellState> tryIncreaseLiftGas_();
std::unique_ptr<GasLiftWellState> tryDecreaseLiftGas_();
void updateWellStateAlqFixedValue_(const GasLiftOpt::Well &well);
bool useFixedAlq_(const GasLiftOpt::Well &well);
void warnMaxIterationsExceeded_();

View File

@ -199,11 +199,11 @@ calcIncOrDecGradient(double oil_rate, double gas_rate, double alq, bool increase
*
*/
template<typename TypeTag>
std::unique_ptr<typename GasLiftSingleWell<TypeTag>::GLiftWellState>
std::unique_ptr<GasLiftWellState>
GasLiftSingleWell<TypeTag>::
runOptimize()
{
std::unique_ptr<GLiftWellState> state;
std::unique_ptr<GasLiftWellState> state;
if (this->optimize_) {
if (this->debug_limit_increase_decrease_) {
state = runOptimize1_();
@ -224,11 +224,11 @@ runOptimize()
}
template<typename TypeTag>
std::unique_ptr<typename GasLiftSingleWell<TypeTag>::GLiftWellState>
std::unique_ptr<GasLiftWellState>
GasLiftSingleWell<TypeTag>::
runOptimize2_()
{
std::unique_ptr<GLiftWellState> state;
std::unique_ptr<GasLiftWellState> state;
state = tryIncreaseLiftGas_();
if (!state || !(state->alqChanged())) {
state = tryDecreaseLiftGas_();
@ -237,11 +237,11 @@ runOptimize2_()
}
template<typename TypeTag>
std::unique_ptr<typename GasLiftSingleWell<TypeTag>::GLiftWellState>
std::unique_ptr<GasLiftWellState>
GasLiftSingleWell<TypeTag>::
runOptimize1_()
{
std::unique_ptr<GLiftWellState> state;
std::unique_ptr<GasLiftWellState> state;
auto inc_count = this->well_state_.gliftGetAlqIncreaseCount(this->well_name_);
auto dec_count = this->well_state_.gliftGetAlqDecreaseCount(this->well_name_);
if (dec_count == 0 && inc_count == 0) {
@ -848,15 +848,15 @@ reduceALQtoOilTarget_(double alq, double oil_rate, double gas_rate,
//
// OUTPUT:
//
// - return value: a new GLiftWellState or nullptr
// - return value: a new GasLiftWellState or nullptr
//
template<typename TypeTag>
std::unique_ptr<typename GasLiftSingleWell<TypeTag>::GLiftWellState>
std::unique_ptr<GasLiftWellState>
GasLiftSingleWell<TypeTag>::
runOptimizeLoop_(bool increase)
{
std::vector<double> potentials(this->num_phases_, 0.0);
std::unique_ptr<GLiftWellState> ret_value; // nullptr initially
std::unique_ptr<GasLiftWellState> ret_value; // nullptr initially
if (!computeInitialWellRates_(potentials)) return ret_value;
bool alq_is_limited = false;
bool oil_is_limited = false;
@ -960,7 +960,7 @@ runOptimizeLoop_(bool increase)
else {
increase_opt = std::nullopt;
}
ret_value = std::make_unique<GLiftWellState>(oil_rate, oil_is_limited,
ret_value = std::make_unique<GasLiftWellState>(oil_rate, oil_is_limited,
gas_rate, gas_is_limited, cur_alq, alq_is_limited, increase_opt);
return ret_value;
}
@ -1025,7 +1025,7 @@ setAlqMinRate_(const GasLiftOpt::Well &well)
}
template<typename TypeTag>
std::unique_ptr<typename GasLiftSingleWell<TypeTag>::GLiftWellState>
std::unique_ptr<GasLiftWellState>
GasLiftSingleWell<TypeTag>::
tryDecreaseLiftGas_()
{
@ -1033,7 +1033,7 @@ tryDecreaseLiftGas_()
}
template<typename TypeTag>
std::unique_ptr<typename GasLiftSingleWell<TypeTag>::GLiftWellState>
std::unique_ptr<GasLiftWellState>
GasLiftSingleWell<TypeTag>::
tryIncreaseLiftGas_()
{