mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-23 07:53:29 -06:00
Adapt to enum changes
This commit is contained in:
parent
c804e85bc7
commit
3d36565db7
@ -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
|
||||
|
@ -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<int, 3> cartesianCoordinate;
|
||||
for (auto& connection : well.getConnections()) {
|
||||
|
||||
if (connection.state() == Opm::WellCompletion::SHUT)
|
||||
if (connection.state() == Opm::Connection::State::SHUT)
|
||||
continue;
|
||||
|
||||
cartesianCoordinate[0] = connection.getI();
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -30,8 +30,6 @@
|
||||
#include <opm/core/wells/WellsGroup.hpp>
|
||||
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
@ -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 {
|
||||
|
@ -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<Well2>& 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<Well2>& 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<Well2>& 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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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 <typename TypeTag>
|
||||
WellSegment::CompPressureDropEnum
|
||||
WellSegments::CompPressureDrop
|
||||
MultisegmentWell<TypeTag>::
|
||||
compPressureDrop() const
|
||||
{
|
||||
@ -943,7 +943,7 @@ namespace Opm
|
||||
|
||||
|
||||
template <typename TypeTag>
|
||||
WellSegment::MultiPhaseModelEnum
|
||||
WellSegments::MultiPhaseModel
|
||||
MultisegmentWell<TypeTag>::
|
||||
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<TypeTag>::
|
||||
accelerationalPressureLossConsidered() const
|
||||
{
|
||||
return (segmentSet().compPressureDrop() == WellSegment::HFA);
|
||||
return (segmentSet().compPressureDrop() == WellSegments::CompPressureDrop::HFA);
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,7 +24,10 @@
|
||||
#include <utility>
|
||||
#include <algorithm>
|
||||
#include <locale>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
|
||||
#include <opm/core/well_controls.h>
|
||||
|
||||
namespace Opm
|
||||
@ -85,7 +88,7 @@ namespace Opm
|
||||
|
||||
inline void
|
||||
historyRates(const PhaseUsage& pu,
|
||||
const ProductionControls& p,
|
||||
const Well2::ProductionControls& p,
|
||||
std::vector<double>& rates)
|
||||
{
|
||||
assert (! p.prediction_mode);
|
||||
|
@ -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<decltype(fs)>::type::Scalar FsScalar;
|
||||
typename FluidSystem::template ParameterCache<FsScalar> 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();
|
||||
|
@ -29,8 +29,6 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
|
||||
|
||||
#include <opm/core/wells.h>
|
||||
#include <opm/core/well_controls.h>
|
||||
|
@ -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<connectionSet.size(); c++) {
|
||||
const auto& connection = connectionSet.get(c);
|
||||
if (connection.state() == WellCompletion::OPEN) {
|
||||
if (connection.state() == Connection::State::OPEN) {
|
||||
const int i = connection.getI();
|
||||
const int j = connection.getJ();
|
||||
const int k = connection.getK();
|
||||
@ -1175,15 +1175,15 @@ namespace Opm
|
||||
double perf_length; // the length of the well perforation
|
||||
|
||||
switch (connection.dir()) {
|
||||
case Opm::WellCompletion::DirectionEnum::X:
|
||||
case Opm::Connection::Direction::X:
|
||||
re = std::sqrt(cubical[1] * cubical[2] / M_PI);
|
||||
perf_length = cubical[0];
|
||||
break;
|
||||
case Opm::WellCompletion::DirectionEnum::Y:
|
||||
case Opm::Connection::Direction::Y:
|
||||
re = std::sqrt(cubical[0] * cubical[2] / M_PI);
|
||||
perf_length = cubical[1];
|
||||
break;
|
||||
case Opm::WellCompletion::DirectionEnum::Z:
|
||||
case Opm::Connection::Direction::Z:
|
||||
re = std::sqrt(cubical[0] * cubical[1] / M_PI);
|
||||
perf_length = cubical[2];
|
||||
break;
|
||||
|
@ -669,7 +669,7 @@ namespace Opm
|
||||
std::vector<std::vector<int>> 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++;
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
|
||||
#include <opm/grid/UnstructuredGrid.h>
|
||||
|
Loading…
Reference in New Issue
Block a user