Skip to content

Commit

Permalink
Adapt to enum changes
Browse files Browse the repository at this point in the history
  • Loading branch information
joakim-hove committed Aug 29, 2019
1 parent c804e85 commit bcc8b2c
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 101 deletions.
4 changes: 2 additions & 2 deletions ebos/ecltracermodel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
60 changes: 30 additions & 30 deletions ebos/eclwellmanager.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -183,60 +183,60 @@ 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);
continue;
}

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");
}

Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion opm/core/wells/WellCollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
10 changes: 5 additions & 5 deletions opm/core/wells/WellsGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand All @@ -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
Expand Down
Loading

0 comments on commit bcc8b2c

Please sign in to comment.