GasLiftStage2: drop circular dependency for BlackoilWellModel

This commit is contained in:
Arne Morten Kvarving 2021-05-23 13:47:04 +02:00
parent 7993e045c4
commit 378efd0ff9
3 changed files with 7 additions and 16 deletions

View File

@ -1108,7 +1108,7 @@ namespace Opm {
GLiftWellStateMap &glift_well_state_map)
{
GasLiftStage2 glift {*this, ebosSimulator_, deferred_logger, this->wellState(),
GasLiftStage2 glift {this->phaseUsage(), ebosSimulator_, deferred_logger, this->wellState(),
prod_wells, glift_wells, glift_well_state_map};
glift.runOptimize();
}

View File

@ -34,12 +34,6 @@
#include <opm/simulators/wells/GasLiftWellState.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/simulators/wells/WellState.hpp>
// NOTE: BlackoilWellModel.hpp includes ourself (GasLiftStage2.hpp), so we need
// to forward declare BlackoilWellModel for it to be defined in this file.
namespace Opm {
template<typename TypeTag> class BlackoilWellModel;
}
#include <opm/simulators/wells/BlackoilWellModel.hpp>
#include <cassert>
#include <functional>
@ -58,11 +52,10 @@ namespace Opm
template<class TypeTag>
class GasLiftStage2 {
using Simulator = GetPropType<TypeTag, Properties::Simulator>;
using BlackoilWellModel = ::Opm::BlackoilWellModel<TypeTag>;
using GasLiftSingleWell = ::Opm::GasLiftSingleWell<TypeTag>;
using GLiftOptWells = typename BlackoilWellModel::GLiftOptWells;
using GLiftProdWells = typename BlackoilWellModel::GLiftProdWells;
using GLiftWellStateMap = typename BlackoilWellModel::GLiftWellStateMap;
using GLiftOptWells = std::map<std::string,std::unique_ptr<GasLiftSingleWell>>;
using GLiftProdWells = std::map<std::string,const WellInterface<TypeTag> *>;
using GLiftWellStateMap = std::map<std::string,std::unique_ptr<GasLiftWellState>>;
using GradPair = std::pair<std::string, double>;
using GradPairItr = std::vector<GradPair>::iterator;
using GradInfo = typename GasLiftSingleWell::GradInfo;
@ -78,7 +71,7 @@ namespace Opm
static const int Gas = BlackoilPhases::Vapour;
public:
GasLiftStage2(
const BlackoilWellModel &well_model,
const PhaseUsage& phase_usage,
const Simulator &ebos_simulator,
DeferredLogger &deferred_logger,
WellState &well_state,
@ -139,7 +132,6 @@ namespace Opm
DeferredLogger &deferred_logger_;
const Simulator &ebos_simulator_;
const BlackoilWellModel &well_model_;
WellState &well_state_;
GLiftProdWells &prod_wells_;
GLiftOptWells &stage1_wells_;

View File

@ -36,7 +36,7 @@ namespace Opm {
template<typename TypeTag>
GasLiftStage2<TypeTag>::
GasLiftStage2(
const BlackoilWellModel &well_model,
const PhaseUsage& phase_usage,
const Simulator &ebos_simulator,
DeferredLogger &deferred_logger,
WellState &well_state,
@ -46,7 +46,6 @@ GasLiftStage2(
) :
deferred_logger_{deferred_logger},
ebos_simulator_{ebos_simulator},
well_model_{well_model},
well_state_{well_state},
prod_wells_{prod_wells},
stage1_wells_{glift_wells},
@ -54,7 +53,7 @@ GasLiftStage2(
report_step_idx_{ebos_simulator_.episodeIndex()},
summary_state_{ebos_simulator_.vanguard().summaryState()},
schedule_{ebos_simulator.vanguard().schedule()},
phase_usage_{well_model_.phaseUsage()},
phase_usage_{phase_usage},
glo_{schedule_.glo(report_step_idx_)},
comm_{ebos_simulator.vanguard().grid().comm()},
debug_{false}