diff --git a/opm/simulators/wells/BlackoilWellModel.hpp b/opm/simulators/wells/BlackoilWellModel.hpp index d3d0eb804..de65bed49 100644 --- a/opm/simulators/wells/BlackoilWellModel.hpp +++ b/opm/simulators/wells/BlackoilWellModel.hpp @@ -109,7 +109,7 @@ namespace Opm { typedef typename BaseAuxiliaryModule::NeighborSet NeighborSet; using GasLiftSingleWell = ::Opm::GasLiftSingleWell; using GasLiftStage2 = ::Opm::GasLiftStage2; - using GLiftWellState = ::Opm::GasLiftWellState; + using GLiftWellState = GasLiftWellState; using GLiftWellStateMap = std::map>; using GLiftOptWells = diff --git a/opm/simulators/wells/GasLiftSingleWell.hpp b/opm/simulators/wells/GasLiftSingleWell.hpp index 1526a0b36..9f7431db3 100644 --- a/opm/simulators/wells/GasLiftSingleWell.hpp +++ b/opm/simulators/wells/GasLiftSingleWell.hpp @@ -60,8 +60,7 @@ namespace Opm { using Simulator = GetPropType; using WellState = WellStateFullyImplicitBlackoil; - using StdWell = Opm::StandardWell; - using GLiftWellState = Opm::GasLiftWellState; + using StdWell = StandardWell; // TODO: same definition with WellInterface, and // WellStateFullyImplicitBlackoil eventually they should go // to a common header file. @@ -70,7 +69,6 @@ namespace Opm static const int Gas = BlackoilPhases::Vapour; static constexpr double ALQ_EPSILON = 1e-8; struct OptimizeState; - class Stage2State; public: GasLiftSingleWell( const StdWell &std_well, @@ -82,12 +80,9 @@ namespace Opm struct GradInfo; std::optional calcIncOrDecGradient( double oil_rate, double gas_rate, double alq, bool increase) const; - std::pair getStage2Rates(); const WellInterface &getStdWell() const { return std_well_; } - bool hasStage2Rates(); - std::unique_ptr runOptimize(); + std::unique_ptr runOptimize(); const std::string& name() const {return well_name_; } - void updateStage2State(const GradInfo &gi, bool increase); struct GradInfo { @@ -155,13 +150,13 @@ namespace Opm reduceALQtoOilTarget_(double alq, double oil_rate, double gas_rate, bool oil_is_limited, bool gas_is_limited, std::vector &potentials); - std::unique_ptr runOptimize1_(); - std::unique_ptr runOptimize2_(); - std::unique_ptr runOptimizeLoop_(bool increase); + std::unique_ptr runOptimize1_(); + std::unique_ptr runOptimize2_(); + std::unique_ptr runOptimizeLoop_(bool increase); void setAlqMaxRate_(const GasLiftOpt::Well &well); void setAlqMinRate_(const GasLiftOpt::Well &well); - std::unique_ptr tryIncreaseLiftGas_(); - std::unique_ptr tryDecreaseLiftGas_(); + std::unique_ptr tryIncreaseLiftGas_(); + std::unique_ptr tryDecreaseLiftGas_(); void updateWellStateAlqFixedValue_(const GasLiftOpt::Well &well); bool useFixedAlq_(const GasLiftOpt::Well &well); void warnMaxIterationsExceeded_(); diff --git a/opm/simulators/wells/GasLiftSingleWell_impl.hpp b/opm/simulators/wells/GasLiftSingleWell_impl.hpp index f3838ad4b..68f3234e1 100644 --- a/opm/simulators/wells/GasLiftSingleWell_impl.hpp +++ b/opm/simulators/wells/GasLiftSingleWell_impl.hpp @@ -199,11 +199,11 @@ calcIncOrDecGradient(double oil_rate, double gas_rate, double alq, bool increase * */ template -std::unique_ptr::GLiftWellState> +std::unique_ptr GasLiftSingleWell:: runOptimize() { - std::unique_ptr state; + std::unique_ptr state; if (this->optimize_) { if (this->debug_limit_increase_decrease_) { state = runOptimize1_(); @@ -224,11 +224,11 @@ runOptimize() } template -std::unique_ptr::GLiftWellState> +std::unique_ptr GasLiftSingleWell:: runOptimize2_() { - std::unique_ptr state; + std::unique_ptr state; state = tryIncreaseLiftGas_(); if (!state || !(state->alqChanged())) { state = tryDecreaseLiftGas_(); @@ -237,11 +237,11 @@ runOptimize2_() } template -std::unique_ptr::GLiftWellState> +std::unique_ptr GasLiftSingleWell:: runOptimize1_() { - std::unique_ptr state; + std::unique_ptr 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 -std::unique_ptr::GLiftWellState> +std::unique_ptr GasLiftSingleWell:: runOptimizeLoop_(bool increase) { std::vector potentials(this->num_phases_, 0.0); - std::unique_ptr ret_value; // nullptr initially + std::unique_ptr 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(oil_rate, oil_is_limited, + ret_value = std::make_unique(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 -std::unique_ptr::GLiftWellState> +std::unique_ptr GasLiftSingleWell:: tryDecreaseLiftGas_() { @@ -1033,7 +1033,7 @@ tryDecreaseLiftGas_() } template -std::unique_ptr::GLiftWellState> +std::unique_ptr GasLiftSingleWell:: tryIncreaseLiftGas_() { diff --git a/opm/simulators/wells/GasLiftStage2.hpp b/opm/simulators/wells/GasLiftStage2.hpp index fceb24529..28de06887 100644 --- a/opm/simulators/wells/GasLiftStage2.hpp +++ b/opm/simulators/wells/GasLiftStage2.hpp @@ -61,7 +61,7 @@ namespace Opm using WellState = WellStateFullyImplicitBlackoil; using BlackoilWellModel = ::Opm::BlackoilWellModel; using GasLiftSingleWell = ::Opm::GasLiftSingleWell; - using GLiftWellState = ::Opm::GasLiftWellState; + using GLiftWellState = GasLiftWellState; using GLiftOptWells = typename BlackoilWellModel::GLiftOptWells; using GLiftProdWells = typename BlackoilWellModel::GLiftProdWells; using GLiftWellStateMap = typename BlackoilWellModel::GLiftWellStateMap; diff --git a/opm/simulators/wells/GasLiftWellState.hpp b/opm/simulators/wells/GasLiftWellState.hpp index 89cd6e11e..fe4802114 100644 --- a/opm/simulators/wells/GasLiftWellState.hpp +++ b/opm/simulators/wells/GasLiftWellState.hpp @@ -20,14 +20,11 @@ #ifndef OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED #define OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED -#include #include -#include #include namespace Opm { - template class GasLiftWellState { public: @@ -77,6 +74,4 @@ namespace Opm } // namespace Opm -#include "GasLiftWellState_impl.hpp" - #endif // OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED diff --git a/opm/simulators/wells/GasLiftWellState_impl.hpp b/opm/simulators/wells/GasLiftWellState_impl.hpp deleted file mode 100644 index 1a046e6d4..000000000 --- a/opm/simulators/wells/GasLiftWellState_impl.hpp +++ /dev/null @@ -1,18 +0,0 @@ -/* - Copyright 2021 Equinor ASA. - - This file is part of the Open Porous Media project (OPM). - - OPM is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OPM is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with OPM. If not, see . -*/