Merge pull request #1986 from joakim-hove/enum-refactor

Adapt to enum changes
This commit is contained in:
Joakim Hove
2019-09-04 16:29:32 +02:00
committed by GitHub
15 changed files with 128 additions and 130 deletions

View File

@@ -1715,7 +1715,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

View File

@@ -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();

View File

@@ -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);