GasLiftStage2: use WellInterfaceGeneric

to lessen typetag dependence
This commit is contained in:
Arne Morten Kvarving 2021-05-23 13:47:04 +02:00
parent 8332909498
commit 8f14e51c9e
3 changed files with 6 additions and 5 deletions

View File

@ -113,7 +113,7 @@ namespace Opm {
using GLiftOptWells =
std::map<std::string,std::unique_ptr<GasLiftSingleWell>>;
using GLiftProdWells =
std::map<std::string,const WellInterface<TypeTag> *>;
std::map<std::string,const WellInterfaceGeneric*>;
static const int numEq = Indices::numEq;
static const int solventSaturationIdx = Indices::solventSaturationIdx;

View File

@ -29,6 +29,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/GasLiftOpt.hpp>
#include <opm/simulators/wells/WellInterfaceGeneric.hpp>
#include <opm/simulators/wells/StandardWell.hpp>
#include <opm/simulators/wells/GasLiftSingleWell.hpp>
#include <opm/simulators/wells/GasLiftWellState.hpp>
@ -53,7 +54,7 @@ namespace Opm
class GasLiftStage2 {
using GasLiftSingleWell = ::Opm::GasLiftSingleWell<TypeTag>;
using GLiftOptWells = std::map<std::string,std::unique_ptr<GasLiftSingleWell>>;
using GLiftProdWells = std::map<std::string,const WellInterface<TypeTag> *>;
using GLiftProdWells = std::map<std::string,const WellInterfaceGeneric*>;
using GLiftWellStateMap = std::map<std::string,std::unique_ptr<GasLiftWellState>>;
using GradPair = std::pair<std::string, double>;
using GradPairItr = std::vector<GradPair>::iterator;
@ -106,7 +107,7 @@ namespace Opm
const Group &group);
void getGroupGliftWellsRecursive_(
const Group &group, std::vector<GasLiftSingleWell *> &wells);
std::pair<double, double> getStdWellRates_(const WellInterface<TypeTag> &well);
std::pair<double, double> getStdWellRates_(const WellInterfaceGeneric &well);
void optimizeGroup_(const Group &group);
void optimizeGroupsRecursive_(const Group &group);
void recalculateGradientAndUpdateData_(

View File

@ -346,7 +346,7 @@ getCurrentWellRates_(const std::string &well_name, const std::string &group_name
{
double oil_rate, gas_rate, alq;
bool success = false;
const WellInterface<TypeTag> *well_ptr = nullptr;
const WellInterfaceGeneric *well_ptr = nullptr;
std::string debug_info;
if (this->stage1_wells_.count(well_name) == 1) {
GasLiftSingleWell &gs_well = *(this->stage1_wells_.at(well_name).get());
@ -415,7 +415,7 @@ getCurrentWellRates_(const std::string &well_name, const std::string &group_name
template<typename TypeTag>
std::pair<double, double>
GasLiftStage2<TypeTag>::
getStdWellRates_(const WellInterface<TypeTag> &well)
getStdWellRates_(const WellInterfaceGeneric &well)
{
const int well_index = well.indexOfWell();
const auto& pu = well.phaseUsage();