diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index fde2bf8bb..bf618b9c0 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -1686,7 +1686,7 @@ public: const auto& simulator = this->simulator(); int epsiodeIdx = std::max(simulator.episodeIndex(), 0); const auto& oilVaporizationControl = simulator.vanguard().schedule().getOilVaporizationProperties(epsiodeIdx); - return (oilVaporizationControl.getType() == Opm::OilVaporizationEnum::VAPPARS); + return (oilVaporizationControl.getType() == Opm::OilVaporizationProperties::OilVaporization::VAPPARS); } bool nonTrivialBoundaryConditions() const diff --git a/ebos/ecltracermodel.hh b/ebos/ecltracermodel.hh index e2a988e75..97b4a4ce0 100644 --- a/ebos/ecltracermodel.hh +++ b/ebos/ecltracermodel.hh @@ -485,14 +485,14 @@ protected: const auto& wells = simulator_.vanguard().schedule().getWells2(episodeIdx); for (const auto& well : wells) { - if (well.getStatus() == Opm::WellCommon::SHUT) + if (well.getStatus() == Opm::Well2::Status::SHUT) continue; const double wtracer = well.getTracerProperties().getConcentration(tracerNames_[tracerIdx]); std::array cartesianCoordinate; for (auto& connection : well.getConnections()) { - if (connection.state() == Opm::WellCompletion::SHUT) + if (connection.state() == Opm::Connection::State::SHUT) continue; cartesianCoordinate[0] = connection.getI(); diff --git a/ebos/eclwellmanager.hh b/ebos/eclwellmanager.hh index 31ca71213..a08f7770d 100644 --- a/ebos/eclwellmanager.hh +++ b/ebos/eclwellmanager.hh @@ -158,17 +158,17 @@ public: if (deckWell.isInjector( )) well->setTemperature(deckWell.injectionControls(summaryState).temperature); - Opm::WellCommon::StatusEnum deckWellStatus = deckWell.getStatus( ); + auto deckWellStatus = deckWell.getStatus( ); switch (deckWellStatus) { - case Opm::WellCommon::AUTO: + case Opm::Well2::Status::AUTO: // TODO: for now, auto means open... - case Opm::WellCommon::OPEN: + case Opm::Well2::Status::OPEN: well->setWellStatus(Well::Open); break; - case Opm::WellCommon::STOP: + case Opm::Well2::Status::STOP: well->setWellStatus(Well::Closed); break; - case Opm::WellCommon::SHUT: + case Opm::Well2::Status::SHUT: well->setWellStatus(Well::Shut); break; } @@ -183,40 +183,40 @@ public: well->setWellType(Well::Injector); const auto controls = deckWell.injectionControls(summaryState); switch (controls.injector_type) { - case Opm::WellInjector::WATER: + case Opm::Well2::InjectorType::WATER: well->setInjectedPhaseIndex(FluidSystem::waterPhaseIdx); break; - case Opm::WellInjector::GAS: + case Opm::Well2::InjectorType::GAS: well->setInjectedPhaseIndex(FluidSystem::gasPhaseIdx); break; - case Opm::WellInjector::OIL: + case Opm::Well2::InjectorType::OIL: well->setInjectedPhaseIndex(FluidSystem::oilPhaseIdx); break; - case Opm::WellInjector::MULTI: + case Opm::Well2::InjectorType::MULTI: throw std::runtime_error("Not implemented: Multi-phase injector wells"); } switch (controls.cmode) { - case Opm::WellInjector::RATE: + case Opm::Well2::InjectorCMode::RATE: well->setControlMode(Well::ControlMode::VolumetricSurfaceRate); break; - case Opm::WellInjector::RESV: + case Opm::Well2::InjectorCMode::RESV: well->setControlMode(Well::ControlMode::VolumetricReservoirRate); break; - case Opm::WellInjector::BHP: + case Opm::Well2::InjectorCMode::BHP: well->setControlMode(Well::ControlMode::BottomHolePressure); break; - case Opm::WellInjector::THP: + case Opm::Well2::InjectorCMode::THP: well->setControlMode(Well::ControlMode::TubingHeadPressure); break; - case Opm::WellInjector::GRUP: + case Opm::Well2::InjectorCMode::GRUP: throw std::runtime_error("Not implemented: Well groups"); - case Opm::WellInjector::CMODE_UNDEFINED: + case Opm::Well2::InjectorCMode::CMODE_UNDEFINED: std::cout << "Warning: Control mode of injection well " << well->name() << " is undefined. Assuming well to be shut.\n"; well->setWellStatus(Well::WellStatus::Shut); @@ -224,19 +224,19 @@ public: } switch (controls.injector_type) { - case Opm::WellInjector::WATER: + case Opm::Well2::InjectorType::WATER: well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0); break; - case Opm::WellInjector::OIL: + case Opm::Well2::InjectorType::OIL: well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0); break; - case Opm::WellInjector::GAS: + case Opm::Well2::InjectorType::GAS: well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0); break; - case Opm::WellInjector::MULTI: + case Opm::Well2::InjectorType::MULTI: throw std::runtime_error("Not implemented: Multi-phase injection wells"); } @@ -254,53 +254,53 @@ public: const auto controls = deckWell.productionControls(summaryState); switch (controls.cmode) { - case Opm::WellProducer::ORAT: + case Opm::Well2::ProducerCMode::ORAT: well->setControlMode(Well::ControlMode::VolumetricSurfaceRate); well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0); well->setMaximumSurfaceRate(controls.oil_rate); break; - case Opm::WellProducer::GRAT: + case Opm::Well2::ProducerCMode::GRAT: well->setControlMode(Well::ControlMode::VolumetricSurfaceRate); well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0); well->setMaximumSurfaceRate(controls.gas_rate); break; - case Opm::WellProducer::WRAT: + case Opm::Well2::ProducerCMode::WRAT: well->setControlMode(Well::ControlMode::VolumetricSurfaceRate); well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0); well->setMaximumSurfaceRate(controls.water_rate); break; - case Opm::WellProducer::LRAT: + case Opm::Well2::ProducerCMode::LRAT: well->setControlMode(Well::ControlMode::VolumetricSurfaceRate); well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/1.0); well->setMaximumSurfaceRate(controls.liquid_rate); break; - case Opm::WellProducer::CRAT: + case Opm::Well2::ProducerCMode::CRAT: throw std::runtime_error("Not implemented: Linearly combined rates"); - case Opm::WellProducer::RESV: + case Opm::Well2::ProducerCMode::RESV: well->setControlMode(Well::ControlMode::VolumetricReservoirRate); well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/1.0, /*water=*/1.0); well->setMaximumSurfaceRate(controls.resv_rate); break; - case Opm::WellProducer::BHP: + case Opm::Well2::ProducerCMode::BHP: well->setControlMode(Well::ControlMode::BottomHolePressure); break; - case Opm::WellProducer::THP: + case Opm::Well2::ProducerCMode::THP: well->setControlMode(Well::ControlMode::TubingHeadPressure); break; - case Opm::WellProducer::GRUP: + case Opm::Well2::ProducerCMode::GRUP: throw std::runtime_error("Not implemented: Well groups"); - case Opm::WellProducer::NONE: + case Opm::Well2::ProducerCMode::NONE: // fall-through - case Opm::WellProducer::CMODE_UNDEFINED: + case Opm::Well2::ProducerCMode::CMODE_UNDEFINED: std::cout << "Warning: Control mode of production well " << well->name() << " is undefined. Assuming well to be shut."; well->setWellStatus(Well::WellStatus::Shut); diff --git a/opm/core/wells/WellCollection.cpp b/opm/core/wells/WellCollection.cpp index f2c16d627..770ca1468 100644 --- a/opm/core/wells/WellCollection.cpp +++ b/opm/core/wells/WellCollection.cpp @@ -69,7 +69,7 @@ namespace Opm } void WellCollection::addWell(const Well2& wellChild, const SummaryState& summaryState, const PhaseUsage& phaseUsage) { - if (wellChild.getStatus() == WellCommon::SHUT) { + if (wellChild.getStatus() == Well2::Status::SHUT) { //SHUT wells are not added to the well collection return; } diff --git a/opm/core/wells/WellsGroup.cpp b/opm/core/wells/WellsGroup.cpp index a042cee26..ce1de618e 100644 --- a/opm/core/wells/WellsGroup.cpp +++ b/opm/core/wells/WellsGroup.cpp @@ -1563,7 +1563,7 @@ namespace Opm if (group.isInjectionGroup()) { const auto& injection = group.injectionControls(st); injection_specification.injector_type_ = toInjectorType(injection.phase); - injection_specification.control_mode_ = toInjectionControlMode(GroupInjection::ControlEnum2String(injection.cmode)); + injection_specification.control_mode_ = toInjectionControlMode(Group2::InjectionCMode2String(injection.cmode)); injection_specification.surface_flow_max_rate_ = injection.surface_max_rate; injection_specification.reservoir_flow_max_rate_ = injection.resv_max_rate; injection_specification.reinjection_fraction_target_ = injection.target_reinj_fraction; @@ -1573,11 +1573,11 @@ namespace Opm if (group.isProductionGroup()) { const auto& production = group.productionControls(st); production_specification.oil_max_rate_ = production.oil_target; - production_specification.control_mode_ = toProductionControlMode(GroupProduction::ControlEnum2String(production.cmode)); + production_specification.control_mode_ = toProductionControlMode(Group2::ProductionCMode2String(production.cmode)); production_specification.water_max_rate_ = production.water_target; production_specification.gas_max_rate_ = production.gas_target; production_specification.liquid_max_rate_ = production.liquid_target; - production_specification.procedure_ = toProductionProcedure(GroupProductionExceedLimit::ActionEnum2String(production.exceed_action)); + production_specification.procedure_ = toProductionProcedure(Group2::ExceedAction2String(production.exceed_action)); production_specification.reservoir_flow_max_rate_ = production.resv_target; } @@ -1603,12 +1603,12 @@ namespace Opm if (well.isInjector()) { const auto controls = well.injectionControls(summaryState); injection_specification.BHP_limit_ = controls.bhp_limit; - injection_specification.injector_type_ = toInjectorType(WellInjector::Type2String(controls.injector_type)); + injection_specification.injector_type_ = toInjectorType(Well2::InjectorType2String(controls.injector_type)); injection_specification.surface_flow_max_rate_ = controls.surface_rate; injection_specification.reservoir_flow_max_rate_ = controls.reservoir_rate; production_specification.guide_rate_ = 0.0; // We know we're not a producer - if (controls.cmode != WellInjector::CMODE_UNDEFINED) { - injection_specification.control_mode_ = toInjectionControlMode(WellInjector::ControlMode2String(controls.cmode)); + if (controls.cmode != Well2::InjectorCMode::CMODE_UNDEFINED) { + injection_specification.control_mode_ = toInjectionControlMode(Well2::InjectorCMode2String(controls.cmode)); } } else if (well.isProducer()) { @@ -1618,8 +1618,8 @@ namespace Opm production_specification.oil_max_rate_ = controls.oil_rate; production_specification.water_max_rate_ = controls.water_rate; injection_specification.guide_rate_ = 0.0; // we know we're not an injector - if (controls.cmode != WellProducer::CMODE_UNDEFINED) { - production_specification.control_mode_ = toProductionControlMode(WellProducer::ControlMode2String(controls.cmode)); + if (controls.cmode != Well2::ProducerCMode::CMODE_UNDEFINED) { + production_specification.control_mode_ = toProductionControlMode(Well2::ProducerCMode2String(controls.cmode)); } } // Efficiency factor given specified with WEFAC diff --git a/opm/core/wells/WellsManager.cpp b/opm/core/wells/WellsManager.cpp index 21e09ebe9..6a7fbdaaf 100644 --- a/opm/core/wells/WellsManager.cpp +++ b/opm/core/wells/WellsManager.cpp @@ -30,8 +30,6 @@ #include #include -#include - #include #include #include @@ -92,26 +90,26 @@ namespace WellsManagerDetail } - Mode mode(Opm::WellProducer::ControlModeEnum controlMode) + Mode mode(Opm::Well2::ProducerCMode controlMode) { switch( controlMode ) { - case Opm::WellProducer::ORAT: + case Opm::Well2::ProducerCMode::ORAT: return ORAT; - case Opm::WellProducer::WRAT: + case Opm::Well2::ProducerCMode::WRAT: return WRAT; - case Opm::WellProducer::GRAT: + case Opm::Well2::ProducerCMode::GRAT: return GRAT; - case Opm::WellProducer::LRAT: + case Opm::Well2::ProducerCMode::LRAT: return LRAT; - case Opm::WellProducer::CRAT: + case Opm::Well2::ProducerCMode::CRAT: return CRAT; - case Opm::WellProducer::RESV: + case Opm::Well2::ProducerCMode::RESV: return RESV; - case Opm::WellProducer::BHP: + case Opm::Well2::ProducerCMode::BHP: return BHP; - case Opm::WellProducer::THP: + case Opm::Well2::ProducerCMode::THP: return THP; - case Opm::WellProducer::GRUP: + case Opm::Well2::ProducerCMode::GRUP: return GRUP; default: throw std::invalid_argument("unhandled enum value"); @@ -155,18 +153,18 @@ namespace WellsManagerDetail } } - Mode mode(Opm::WellInjector::ControlModeEnum controlMode) - { + Mode mode(Opm::Well2::InjectorCMode controlMode) + { switch ( controlMode ) { - case Opm::WellInjector::GRUP: + case Opm::Well2::InjectorCMode::GRUP: return GRUP; - case Opm::WellInjector::RESV: + case Opm::Well2::InjectorCMode::RESV: return RESV; - case Opm::WellInjector::RATE: + case Opm::Well2::InjectorCMode::RATE: return RATE; - case Opm::WellInjector::THP: + case Opm::Well2::InjectorCMode::THP: return THP; - case Opm::WellInjector::BHP: + case Opm::Well2::InjectorCMode::BHP: return BHP; default: throw std::invalid_argument("unhandled enum value"); @@ -309,12 +307,12 @@ namespace Opm const auto& well = (*wellIter); - if (well.getStatus() == WellCommon::SHUT) { + if (well.getStatus() == Well2::Status::SHUT) { //SHUT wells are not added to the well list continue; } - if (well.getStatus() == WellCommon::STOP) { + if (well.getStatus() == Well2::Status::STOP) { // Stopped wells are kept in the well list but marked as stopped. well_controls_stop_well(w_->ctrls[well_index]); } @@ -326,16 +324,16 @@ namespace Opm int control_pos[5] = { -1, -1, -1, -1, -1 }; clear_well_controls(well_index, w_); - if (controls.hasControl(WellInjector::RATE)) { + if (controls.hasControl(Well2::InjectorCMode::RATE)) { control_pos[WellsManagerDetail::InjectionControl::RATE] = well_controls_get_num(w_->ctrls[well_index]); double distr[3] = { 0.0, 0.0, 0.0 }; - WellInjector::TypeEnum injectorType = controls.injector_type; + auto injectorType = controls.injector_type; - if (injectorType == WellInjector::TypeEnum::WATER) { + if (injectorType == Well2::InjectorType::WATER) { distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0; - } else if (injectorType == WellInjector::TypeEnum::OIL) { + } else if (injectorType == Well2::InjectorType::OIL) { distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0; - } else if (injectorType == WellInjector::TypeEnum::GAS) { + } else if (injectorType == Well2::InjectorType::GAS) { distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0; } @@ -348,16 +346,16 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellInjector::RESV)) { + if (ok && controls.hasControl(Well2::InjectorCMode::RESV)) { control_pos[WellsManagerDetail::InjectionControl::RESV] = well_controls_get_num(w_->ctrls[well_index]); double distr[3] = { 0.0, 0.0, 0.0 }; - WellInjector::TypeEnum injectorType = controls.injector_type; + auto injectorType = controls.injector_type; - if (injectorType == WellInjector::TypeEnum::WATER) { + if (injectorType == Well2::InjectorType::WATER) { distr[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0; - } else if (injectorType == WellInjector::TypeEnum::OIL) { + } else if (injectorType == Well2::InjectorType::OIL) { distr[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0; - } else if (injectorType == WellInjector::TypeEnum::GAS) { + } else if (injectorType == Well2::InjectorType::GAS) { distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0; } @@ -370,7 +368,7 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellInjector::BHP)) { + if (ok && controls.hasControl(Well2::InjectorCMode::BHP)) { control_pos[WellsManagerDetail::InjectionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]); ok = append_well_controls(BHP, controls.bhp_limit, @@ -381,7 +379,7 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellInjector::THP)) { + if (ok && controls.hasControl(Well2::InjectorCMode::THP)) { control_pos[WellsManagerDetail::InjectionControl::THP] = well_controls_get_num(w_->ctrls[well_index]); const double thp_limit = controls.thp_limit; const int vfp_number = controls.vfp_table_number; @@ -398,7 +396,7 @@ namespace Opm OPM_THROW(std::runtime_error, "Failure occured appending controls for well " << well_names[well_index]); } - if (controls.cmode != WellInjector::CMODE_UNDEFINED) { + if (controls.cmode != Well2::InjectorCMode::CMODE_UNDEFINED) { WellsManagerDetail::InjectionControl::Mode mode = WellsManagerDetail::InjectionControl::mode(controls.cmode); int cpos = control_pos[mode]; if (cpos == -1 && mode != WellsManagerDetail::InjectionControl::GRUP) { @@ -411,19 +409,19 @@ namespace Opm // Set well component fraction. double cf[3] = { 0.0, 0.0, 0.0 }; { - WellInjector::TypeEnum injectorType = controls.injector_type; + auto injectorType = controls.injector_type; - if (injectorType == WellInjector::WATER) { + if (injectorType == Well2::InjectorType::WATER) { if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) { OPM_THROW(std::runtime_error, "Water phase not used, yet found water-injecting well."); } cf[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0; - } else if (injectorType == WellInjector::OIL) { + } else if (injectorType == Well2::InjectorType::OIL) { if (!phaseUsage.phase_used[BlackoilPhases::Liquid]) { OPM_THROW(std::runtime_error, "Oil phase not used, yet found oil-injecting well."); } cf[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0; - } else if (injectorType == WellInjector::GAS) { + } else if (injectorType == Well2::InjectorType::GAS) { if (!phaseUsage.phase_used[BlackoilPhases::Vapour]) { OPM_THROW(std::runtime_error, "Gas phase not used, yet found gas-injecting well."); } @@ -442,7 +440,7 @@ namespace Opm int ok = 1; clear_well_controls(well_index, w_); - if (ok && controls.hasControl(WellProducer::ORAT)) { + if (ok && controls.hasControl(Well2::ProducerCMode::ORAT)) { if (!phaseUsage.phase_used[BlackoilPhases::Liquid]) { OPM_THROW(std::runtime_error, "Oil phase not active and ORAT control specified."); } @@ -459,7 +457,7 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellProducer::WRAT)) { + if (ok && controls.hasControl(Well2::ProducerCMode::WRAT)) { if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) { OPM_THROW(std::runtime_error, "Water phase not active and WRAT control specified."); } @@ -475,7 +473,7 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellProducer::GRAT)) { + if (ok && controls.hasControl(Well2::ProducerCMode::GRAT)) { if (!phaseUsage.phase_used[BlackoilPhases::Vapour]) { OPM_THROW(std::runtime_error, "Gas phase not active and GRAT control specified."); } @@ -491,7 +489,7 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellProducer::LRAT)) { + if (ok && controls.hasControl(Well2::ProducerCMode::LRAT)) { if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) { OPM_THROW(std::runtime_error, "Water phase not active and LRAT control specified."); } @@ -511,7 +509,7 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellProducer::RESV)) { + if (ok && controls.hasControl(Well2::ProducerCMode::RESV)) { control_pos[WellsManagerDetail::ProductionControl::RESV] = well_controls_get_num(w_->ctrls[well_index]); double distr[3] = { 1.0, 1.0, 1.0 }; ok = append_well_controls(RESERVOIR_RATE, @@ -523,7 +521,7 @@ namespace Opm w_); } - if (ok && controls.hasControl(WellProducer::THP)) { + if (ok && controls.hasControl(Well2::ProducerCMode::THP)) { const double thp_limit = controls.thp_limit; const double alq_value = controls.alq_value; const int vfp_number = controls.vfp_table_number; @@ -553,7 +551,7 @@ namespace Opm OPM_THROW(std::runtime_error, "Failure occured appending controls for well " << well_names[well_index]); } - if (controls.cmode != WellProducer::CMODE_UNDEFINED) { + if (controls.cmode != Well2::ProducerCMode::CMODE_UNDEFINED) { WellsManagerDetail::ProductionControl::Mode mode = WellsManagerDetail::ProductionControl::mode(controls.cmode); int cpos = control_pos[mode]; if (cpos == -1 && mode != WellsManagerDetail::ProductionControl::GRUP) { @@ -603,7 +601,7 @@ namespace Opm for (auto wellIter = wells.begin(); wellIter != wells.end(); ++wellIter ) { const auto& well = *wellIter; - if (well.getStatus() == WellCommon::SHUT) { + if (well.getStatus() == Well2::Status::SHUT) { //SHUT wells does not need guide rates continue; } @@ -612,21 +610,21 @@ namespace Opm WellNode& wellnode = *well_collection_.getLeafNodes()[wix]; // TODO: looks like only handling OIL phase guide rate for producers - if (well.getGuideRatePhase() != GuideRate::UNDEFINED && well.getGuideRate() >= 0.) { + if (well.getGuideRatePhase() != Well2::GuideRateTarget::UNDEFINED && well.getGuideRate() >= 0.) { if (well_data[wix].type == PRODUCER) { wellnode.prodSpec().guide_rate_ = well.getGuideRate(); - if (well.getGuideRatePhase() == GuideRate::OIL) { + if (well.getGuideRatePhase() == Well2::GuideRateTarget::OIL) { wellnode.prodSpec().guide_rate_type_ = ProductionSpecification::OIL; } else { - OPM_THROW(std::runtime_error, "Guide rate type " << GuideRate::GuideRatePhaseEnum2String(well.getGuideRatePhase()) << " specified for producer " + OPM_THROW(std::runtime_error, "Guide rate type " << Well2::GuideRateTarget2String(well.getGuideRatePhase()) << " specified for producer " << well.name() << " in WGRUPCON, cannot handle."); } } else if (well_data[wix].type == INJECTOR) { wellnode.injSpec().guide_rate_ = well.getGuideRate(); - if (well.getGuideRatePhase() == GuideRate::RAT) { + if (well.getGuideRatePhase() == Well2::GuideRateTarget::RAT) { wellnode.injSpec().guide_rate_type_ = InjectionSpecification::RAT; } else { - OPM_THROW(std::runtime_error, "Guide rate type " << GuideRate::GuideRatePhaseEnum2String(well.getGuideRatePhase()) << " specified for injector " + OPM_THROW(std::runtime_error, "Guide rate type " << Well2::GuideRateTarget2String(well.getGuideRatePhase()) << " specified for injector " << well.name() << " in WGRUPCON, cannot handle."); } } else { diff --git a/opm/core/wells/WellsManager_impl.hpp b/opm/core/wells/WellsManager_impl.hpp index d27499551..d6c109739 100644 --- a/opm/core/wells/WellsManager_impl.hpp +++ b/opm/core/wells/WellsManager_impl.hpp @@ -34,7 +34,7 @@ namespace WellsManagerDetail Mode mode(const std::string& control); - Mode mode(Opm::WellProducer::ControlModeEnum controlMode); + Mode mode(Opm::Well2::ProducerCMode controlMode); } // namespace ProductionControl @@ -50,7 +50,7 @@ namespace WellsManagerDetail */ Mode mode(const std::string& control); - Mode mode(Opm::WellInjector::ControlModeEnum controlMode); + Mode mode(Opm::Well2::InjectorCMode controlMode); } // namespace InjectionControl @@ -136,7 +136,7 @@ void WellsManager::createWellsFromSpecs(const std::vector& wells, size_t for (auto wellIter= wells.begin(); wellIter != wells.end(); ++wellIter) { const auto& well = (*wellIter); - if (well.getStatus() == WellCommon::SHUT) { + if (well.getStatus() == Well2::Status::SHUT) { continue; } @@ -149,7 +149,7 @@ void WellsManager::createWellsFromSpecs(const std::vector& wells, size_t // shut completions and open ones stored in this process will have 1 others 0. for(const auto& completion : well.getConnections()) { - if (completion.state() == WellCompletion::OPEN) { + if (completion.state() == Connection::State::OPEN) { const int i = completion.getI(); const int j = completion.getJ(); const int k = completion.getK(); @@ -172,8 +172,8 @@ void WellsManager::createWellsFromSpecs(const std::vector& wells, size_t wellperf_data[active_well_index].push_back(pd); } } else { - if (completion.state() != WellCompletion::SHUT) { - OPM_THROW(std::runtime_error, "Completion state: " << WellCompletion::StateEnum2String( completion.state() ) << " not handled"); + if (completion.state() != Connection::State::SHUT) { + OPM_THROW(std::runtime_error, "Completion state: " << Connection::State2String( completion.state() ) << " not handled"); } } } diff --git a/opm/simulators/wells/MultisegmentWell.hpp b/opm/simulators/wells/MultisegmentWell.hpp index 86448509d..db7359629 100644 --- a/opm/simulators/wells/MultisegmentWell.hpp +++ b/opm/simulators/wells/MultisegmentWell.hpp @@ -164,9 +164,9 @@ namespace Opm int number_segments_; // components of the pressure drop to be included - WellSegment::CompPressureDropEnum compPressureDrop() const; + WellSegments::CompPressureDrop compPressureDrop() const; // multi-phase flow model - WellSegment::MultiPhaseModelEnum multiphaseModel() const; + WellSegments::MultiPhaseModel multiphaseModel() const; // get the WellSegments from the well_ecl_ const WellSegments& segmentSet() const; diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 02197b4b9..e4c802b16 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -72,7 +72,7 @@ namespace Opm perf_depth_.resize(number_of_perforations_, 0.); for (size_t perf = 0; perf < completion_set.size(); ++perf) { const Connection& connection = completion_set.get(perf); - if (connection.state() == WellCompletion::OPEN) { + if (connection.state() == Connection::State::OPEN) { const int segment_index = segmentNumberToIndex(connection.segment()); segment_perforations_[segment_index].push_back(i_perf_wells); perf_depth_[i_perf_wells] = connection.depth(); @@ -931,7 +931,7 @@ namespace Opm template - WellSegment::CompPressureDropEnum + WellSegments::CompPressureDrop MultisegmentWell:: compPressureDrop() const { @@ -943,7 +943,7 @@ namespace Opm template - WellSegment::MultiPhaseModelEnum + WellSegments::MultiPhaseModel MultisegmentWell:: multiphaseModel() const { @@ -1869,7 +1869,7 @@ namespace Opm frictionalPressureLossConsidered() const { // HF- and HFA needs to consider frictional pressure loss - return (segmentSet().compPressureDrop() != WellSegment::H__); + return (segmentSet().compPressureDrop() != WellSegments::CompPressureDrop::H__); } @@ -1881,7 +1881,7 @@ namespace Opm MultisegmentWell:: accelerationalPressureLossConsidered() const { - return (segmentSet().compPressureDrop() == WellSegment::HFA); + return (segmentSet().compPressureDrop() == WellSegments::CompPressureDrop::HFA); } diff --git a/opm/simulators/wells/SimFIBODetails.hpp b/opm/simulators/wells/SimFIBODetails.hpp index 22df8d66e..5cda4b3a6 100644 --- a/opm/simulators/wells/SimFIBODetails.hpp +++ b/opm/simulators/wells/SimFIBODetails.hpp @@ -24,7 +24,10 @@ #include #include #include + #include +#include + #include namespace Opm @@ -85,7 +88,7 @@ namespace Opm inline void historyRates(const PhaseUsage& pu, - const ProductionControls& p, + const Well2::ProductionControls& p, std::vector& rates) { assert (! p.prediction_mode); diff --git a/opm/simulators/wells/StandardWell_impl.hpp b/opm/simulators/wells/StandardWell_impl.hpp index 9aaab7b22..ca872cd36 100644 --- a/opm/simulators/wells/StandardWell_impl.hpp +++ b/opm/simulators/wells/StandardWell_impl.hpp @@ -608,7 +608,7 @@ namespace Opm // change temperature for injecting fluids if (well_type_ == INJECTOR && cq_s[activeCompIdx] > 0.0){ // only handles single phase injection now - assert(this->well_ecl_.injectorType() != WellInjector::MULTI); + assert(this->well_ecl_.injectorType() != Well2::InjectorType::MULTI); fs.setTemperature(this->well_ecl_.temperature()); typedef typename std::decay::type::Scalar FsScalar; typename FluidSystem::template ParameterCache paramCache; @@ -2534,7 +2534,7 @@ namespace Opm auto phase = well_ecl_.getInjectionProperties().injectorType; // only single phase injection handled if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) { - if (phase == WellInjector::TypeEnum::WATER) { + if (phase == Well2::InjectorType::WATER) { primary_variables_[WFrac] = 1.0; } else { primary_variables_[WFrac] = 0.0; @@ -2542,7 +2542,7 @@ namespace Opm } if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) { - if (phase == WellInjector::TypeEnum::GAS) { + if (phase == Well2::InjectorType::GAS) { primary_variables_[GFrac] = 1.0 - wsolvent(); if (has_solvent) { primary_variables_[SFrac] = wsolvent(); diff --git a/opm/simulators/wells/WellInterface.hpp b/opm/simulators/wells/WellInterface.hpp index a143ef9f8..012f1092c 100644 --- a/opm/simulators/wells/WellInterface.hpp +++ b/opm/simulators/wells/WellInterface.hpp @@ -29,8 +29,6 @@ #include #include -#include - #include #include diff --git a/opm/simulators/wells/WellInterface_impl.hpp b/opm/simulators/wells/WellInterface_impl.hpp index 2fd362a96..54653c4f5 100644 --- a/opm/simulators/wells/WellInterface_impl.hpp +++ b/opm/simulators/wells/WellInterface_impl.hpp @@ -152,7 +152,7 @@ namespace Opm int num_active_connections = 0; for (int c = 0; c < num_conns; ++c) { - if (connections[c].state() == WellCompletion::OPEN) { + if (connections[c].state() == Connection::State::OPEN) { completions_[connections[c].complnum()].push_back(num_active_connections++); } } @@ -312,7 +312,7 @@ namespace Opm } auto injectorType = well_ecl_.injectorType(); - if (injectorType == WellInjector::GAS) { + if (injectorType == Well2::InjectorType::GAS) { double solvent_fraction = well_ecl_.getSolventFraction(); return solvent_fraction; } else { @@ -336,7 +336,7 @@ namespace Opm auto injectorType = well_ecl_.injectorType(); - if (injectorType == WellInjector::WATER) { + if (injectorType == Well2::InjectorType::WATER) { WellPolymerProperties polymer = well_ecl_.getPolymerProperties(); const double polymer_injection_concentration = polymer.m_polymerConcentration; return polymer_injection_concentration; @@ -361,7 +361,7 @@ namespace Opm auto injectorType = well_ecl_.injectorType(); - if (injectorType == WellInjector::GAS) { + if (injectorType == Well2::InjectorType::GAS) { WellFoamProperties fprop = well_ecl_.getFoamProperties(); return fprop.m_foamConcentration; } else { @@ -923,8 +923,8 @@ namespace Opm // for the moment, we only handle rate limits, not handling potential limits // the potential limits should not be difficult to add - const WellEcon::QuantityLimitEnum& quantity_limit = econ_production_limits.quantityLimit(); - if (quantity_limit == WellEcon::POTN) { + const auto& quantity_limit = econ_production_limits.quantityLimit(); + if (quantity_limit == WellEconProductionLimits::QuantityLimit::POTN) { const std::string msg = std::string("POTN limit for well ") + name() + std::string(" is not supported for the moment. \n") + std::string("All the limits will be evaluated based on RATE. "); deferred_logger.warning("NOT_SUPPORTING_POTN", msg); @@ -973,9 +973,9 @@ namespace Opm checkRatioEconLimits(econ_production_limits, well_state, ratio_report, deferred_logger); if (ratio_report.ratio_limit_violated) { - const WellEcon::WorkoverEnum workover = econ_production_limits.workover(); + const auto workover = econ_production_limits.workover(); switch (workover) { - case WellEcon::CON: + case WellEconProductionLimits::EconWorkover::CON: { const int worst_offending_completion = ratio_report.worst_offending_completion; @@ -1014,7 +1014,7 @@ namespace Opm } break; } - case WellEcon::WELL: + case WellEconProductionLimits::EconWorkover::WELL: { well_test_state.closeWell(name(), WellTestConfig::Reason::ECONOMIC, simulation_time); if (write_message_to_opmlog) { @@ -1029,12 +1029,12 @@ namespace Opm } break; } - case WellEcon::NONE: - break; + case WellEconProductionLimits::EconWorkover::NONE: + break; default: { deferred_logger.warning("NOT_SUPPORTED_WORKOVER_TYPE", - "not supporting workover type " + WellEcon::WorkoverEnumToString(workover) ); + "not supporting workover type " + WellEconProductionLimits::EconWorkover2String(workover) ); } } } @@ -1152,7 +1152,7 @@ namespace Opm const auto& connectionSet = well_ecl_.getConnections(); for (size_t c=0; c> segment_perforations(well_nseg); for (size_t perf = 0; perf < completion_set.size(); ++perf) { const Connection& connection = completion_set.get(perf); - if (connection.state() == WellCompletion::OPEN) { + if (connection.state() == Connection::State::OPEN) { const int segment_index = segment_set.segmentNumberToIndex(connection.segment()); segment_perforations[segment_index].push_back(n_activeperf); n_activeperf++; diff --git a/tests/test_wellmodel.cpp b/tests/test_wellmodel.cpp index 6173b3e39..3cbe9ef3b 100644 --- a/tests/test_wellmodel.cpp +++ b/tests/test_wellmodel.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include