mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -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();
|
const auto& simulator = this->simulator();
|
||||||
int epsiodeIdx = std::max(simulator.episodeIndex(), 0);
|
int epsiodeIdx = std::max(simulator.episodeIndex(), 0);
|
||||||
const auto& oilVaporizationControl = simulator.vanguard().schedule().getOilVaporizationProperties(epsiodeIdx);
|
const auto& oilVaporizationControl = simulator.vanguard().schedule().getOilVaporizationProperties(epsiodeIdx);
|
||||||
return (oilVaporizationControl.getType() == Opm::OilVaporizationEnum::VAPPARS);
|
return (oilVaporizationControl.getType() == Opm::OilVaporizationProperties::OilVaporization::VAPPARS);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool nonTrivialBoundaryConditions() const
|
bool nonTrivialBoundaryConditions() const
|
||||||
|
@ -485,14 +485,14 @@ protected:
|
|||||||
const auto& wells = simulator_.vanguard().schedule().getWells2(episodeIdx);
|
const auto& wells = simulator_.vanguard().schedule().getWells2(episodeIdx);
|
||||||
for (const auto& well : wells) {
|
for (const auto& well : wells) {
|
||||||
|
|
||||||
if (well.getStatus() == Opm::WellCommon::SHUT)
|
if (well.getStatus() == Opm::Well2::Status::SHUT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const double wtracer = well.getTracerProperties().getConcentration(tracerNames_[tracerIdx]);
|
const double wtracer = well.getTracerProperties().getConcentration(tracerNames_[tracerIdx]);
|
||||||
std::array<int, 3> cartesianCoordinate;
|
std::array<int, 3> cartesianCoordinate;
|
||||||
for (auto& connection : well.getConnections()) {
|
for (auto& connection : well.getConnections()) {
|
||||||
|
|
||||||
if (connection.state() == Opm::WellCompletion::SHUT)
|
if (connection.state() == Opm::Connection::State::SHUT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
cartesianCoordinate[0] = connection.getI();
|
cartesianCoordinate[0] = connection.getI();
|
||||||
|
@ -158,17 +158,17 @@ public:
|
|||||||
if (deckWell.isInjector( ))
|
if (deckWell.isInjector( ))
|
||||||
well->setTemperature(deckWell.injectionControls(summaryState).temperature);
|
well->setTemperature(deckWell.injectionControls(summaryState).temperature);
|
||||||
|
|
||||||
Opm::WellCommon::StatusEnum deckWellStatus = deckWell.getStatus( );
|
auto deckWellStatus = deckWell.getStatus( );
|
||||||
switch (deckWellStatus) {
|
switch (deckWellStatus) {
|
||||||
case Opm::WellCommon::AUTO:
|
case Opm::Well2::Status::AUTO:
|
||||||
// TODO: for now, auto means open...
|
// TODO: for now, auto means open...
|
||||||
case Opm::WellCommon::OPEN:
|
case Opm::Well2::Status::OPEN:
|
||||||
well->setWellStatus(Well::Open);
|
well->setWellStatus(Well::Open);
|
||||||
break;
|
break;
|
||||||
case Opm::WellCommon::STOP:
|
case Opm::Well2::Status::STOP:
|
||||||
well->setWellStatus(Well::Closed);
|
well->setWellStatus(Well::Closed);
|
||||||
break;
|
break;
|
||||||
case Opm::WellCommon::SHUT:
|
case Opm::Well2::Status::SHUT:
|
||||||
well->setWellStatus(Well::Shut);
|
well->setWellStatus(Well::Shut);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -183,40 +183,40 @@ public:
|
|||||||
well->setWellType(Well::Injector);
|
well->setWellType(Well::Injector);
|
||||||
const auto controls = deckWell.injectionControls(summaryState);
|
const auto controls = deckWell.injectionControls(summaryState);
|
||||||
switch (controls.injector_type) {
|
switch (controls.injector_type) {
|
||||||
case Opm::WellInjector::WATER:
|
case Opm::Well2::InjectorType::WATER:
|
||||||
well->setInjectedPhaseIndex(FluidSystem::waterPhaseIdx);
|
well->setInjectedPhaseIndex(FluidSystem::waterPhaseIdx);
|
||||||
break;
|
break;
|
||||||
case Opm::WellInjector::GAS:
|
case Opm::Well2::InjectorType::GAS:
|
||||||
well->setInjectedPhaseIndex(FluidSystem::gasPhaseIdx);
|
well->setInjectedPhaseIndex(FluidSystem::gasPhaseIdx);
|
||||||
break;
|
break;
|
||||||
case Opm::WellInjector::OIL:
|
case Opm::Well2::InjectorType::OIL:
|
||||||
well->setInjectedPhaseIndex(FluidSystem::oilPhaseIdx);
|
well->setInjectedPhaseIndex(FluidSystem::oilPhaseIdx);
|
||||||
break;
|
break;
|
||||||
case Opm::WellInjector::MULTI:
|
case Opm::Well2::InjectorType::MULTI:
|
||||||
throw std::runtime_error("Not implemented: Multi-phase injector wells");
|
throw std::runtime_error("Not implemented: Multi-phase injector wells");
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (controls.cmode) {
|
switch (controls.cmode) {
|
||||||
case Opm::WellInjector::RATE:
|
case Opm::Well2::InjectorCMode::RATE:
|
||||||
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellInjector::RESV:
|
case Opm::Well2::InjectorCMode::RESV:
|
||||||
well->setControlMode(Well::ControlMode::VolumetricReservoirRate);
|
well->setControlMode(Well::ControlMode::VolumetricReservoirRate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellInjector::BHP:
|
case Opm::Well2::InjectorCMode::BHP:
|
||||||
well->setControlMode(Well::ControlMode::BottomHolePressure);
|
well->setControlMode(Well::ControlMode::BottomHolePressure);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellInjector::THP:
|
case Opm::Well2::InjectorCMode::THP:
|
||||||
well->setControlMode(Well::ControlMode::TubingHeadPressure);
|
well->setControlMode(Well::ControlMode::TubingHeadPressure);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellInjector::GRUP:
|
case Opm::Well2::InjectorCMode::GRUP:
|
||||||
throw std::runtime_error("Not implemented: Well groups");
|
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()
|
std::cout << "Warning: Control mode of injection well " << well->name()
|
||||||
<< " is undefined. Assuming well to be shut.\n";
|
<< " is undefined. Assuming well to be shut.\n";
|
||||||
well->setWellStatus(Well::WellStatus::Shut);
|
well->setWellStatus(Well::WellStatus::Shut);
|
||||||
@ -224,19 +224,19 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (controls.injector_type) {
|
switch (controls.injector_type) {
|
||||||
case Opm::WellInjector::WATER:
|
case Opm::Well2::InjectorType::WATER:
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0);
|
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellInjector::OIL:
|
case Opm::Well2::InjectorType::OIL:
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0);
|
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellInjector::GAS:
|
case Opm::Well2::InjectorType::GAS:
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0);
|
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellInjector::MULTI:
|
case Opm::Well2::InjectorType::MULTI:
|
||||||
throw std::runtime_error("Not implemented: Multi-phase injection wells");
|
throw std::runtime_error("Not implemented: Multi-phase injection wells");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,53 +254,53 @@ public:
|
|||||||
const auto controls = deckWell.productionControls(summaryState);
|
const auto controls = deckWell.productionControls(summaryState);
|
||||||
|
|
||||||
switch (controls.cmode) {
|
switch (controls.cmode) {
|
||||||
case Opm::WellProducer::ORAT:
|
case Opm::Well2::ProducerCMode::ORAT:
|
||||||
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0);
|
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/0.0);
|
||||||
well->setMaximumSurfaceRate(controls.oil_rate);
|
well->setMaximumSurfaceRate(controls.oil_rate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellProducer::GRAT:
|
case Opm::Well2::ProducerCMode::GRAT:
|
||||||
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0);
|
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/1.0, /*water=*/0.0);
|
||||||
well->setMaximumSurfaceRate(controls.gas_rate);
|
well->setMaximumSurfaceRate(controls.gas_rate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellProducer::WRAT:
|
case Opm::Well2::ProducerCMode::WRAT:
|
||||||
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0);
|
well->setVolumetricPhaseWeights(/*oil=*/0.0, /*gas=*/0.0, /*water=*/1.0);
|
||||||
well->setMaximumSurfaceRate(controls.water_rate);
|
well->setMaximumSurfaceRate(controls.water_rate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellProducer::LRAT:
|
case Opm::Well2::ProducerCMode::LRAT:
|
||||||
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
well->setControlMode(Well::ControlMode::VolumetricSurfaceRate);
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/1.0);
|
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/0.0, /*water=*/1.0);
|
||||||
well->setMaximumSurfaceRate(controls.liquid_rate);
|
well->setMaximumSurfaceRate(controls.liquid_rate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellProducer::CRAT:
|
case Opm::Well2::ProducerCMode::CRAT:
|
||||||
throw std::runtime_error("Not implemented: Linearly combined rates");
|
throw std::runtime_error("Not implemented: Linearly combined rates");
|
||||||
|
|
||||||
case Opm::WellProducer::RESV:
|
case Opm::Well2::ProducerCMode::RESV:
|
||||||
well->setControlMode(Well::ControlMode::VolumetricReservoirRate);
|
well->setControlMode(Well::ControlMode::VolumetricReservoirRate);
|
||||||
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/1.0, /*water=*/1.0);
|
well->setVolumetricPhaseWeights(/*oil=*/1.0, /*gas=*/1.0, /*water=*/1.0);
|
||||||
well->setMaximumSurfaceRate(controls.resv_rate);
|
well->setMaximumSurfaceRate(controls.resv_rate);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellProducer::BHP:
|
case Opm::Well2::ProducerCMode::BHP:
|
||||||
well->setControlMode(Well::ControlMode::BottomHolePressure);
|
well->setControlMode(Well::ControlMode::BottomHolePressure);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellProducer::THP:
|
case Opm::Well2::ProducerCMode::THP:
|
||||||
well->setControlMode(Well::ControlMode::TubingHeadPressure);
|
well->setControlMode(Well::ControlMode::TubingHeadPressure);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Opm::WellProducer::GRUP:
|
case Opm::Well2::ProducerCMode::GRUP:
|
||||||
throw std::runtime_error("Not implemented: Well groups");
|
throw std::runtime_error("Not implemented: Well groups");
|
||||||
|
|
||||||
case Opm::WellProducer::NONE:
|
case Opm::Well2::ProducerCMode::NONE:
|
||||||
// fall-through
|
// fall-through
|
||||||
case Opm::WellProducer::CMODE_UNDEFINED:
|
case Opm::Well2::ProducerCMode::CMODE_UNDEFINED:
|
||||||
std::cout << "Warning: Control mode of production well " << well->name()
|
std::cout << "Warning: Control mode of production well " << well->name()
|
||||||
<< " is undefined. Assuming well to be shut.";
|
<< " is undefined. Assuming well to be shut.";
|
||||||
well->setWellStatus(Well::WellStatus::Shut);
|
well->setWellStatus(Well::WellStatus::Shut);
|
||||||
|
@ -69,7 +69,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
void WellCollection::addWell(const Well2& wellChild, const SummaryState& summaryState, const PhaseUsage& phaseUsage) {
|
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
|
//SHUT wells are not added to the well collection
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1563,7 +1563,7 @@ namespace Opm
|
|||||||
if (group.isInjectionGroup()) {
|
if (group.isInjectionGroup()) {
|
||||||
const auto& injection = group.injectionControls(st);
|
const auto& injection = group.injectionControls(st);
|
||||||
injection_specification.injector_type_ = toInjectorType(injection.phase);
|
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.surface_flow_max_rate_ = injection.surface_max_rate;
|
||||||
injection_specification.reservoir_flow_max_rate_ = injection.resv_max_rate;
|
injection_specification.reservoir_flow_max_rate_ = injection.resv_max_rate;
|
||||||
injection_specification.reinjection_fraction_target_ = injection.target_reinj_fraction;
|
injection_specification.reinjection_fraction_target_ = injection.target_reinj_fraction;
|
||||||
@ -1573,11 +1573,11 @@ namespace Opm
|
|||||||
if (group.isProductionGroup()) {
|
if (group.isProductionGroup()) {
|
||||||
const auto& production = group.productionControls(st);
|
const auto& production = group.productionControls(st);
|
||||||
production_specification.oil_max_rate_ = production.oil_target;
|
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.water_max_rate_ = production.water_target;
|
||||||
production_specification.gas_max_rate_ = production.gas_target;
|
production_specification.gas_max_rate_ = production.gas_target;
|
||||||
production_specification.liquid_max_rate_ = production.liquid_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;
|
production_specification.reservoir_flow_max_rate_ = production.resv_target;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1603,12 +1603,12 @@ namespace Opm
|
|||||||
if (well.isInjector()) {
|
if (well.isInjector()) {
|
||||||
const auto controls = well.injectionControls(summaryState);
|
const auto controls = well.injectionControls(summaryState);
|
||||||
injection_specification.BHP_limit_ = controls.bhp_limit;
|
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.surface_flow_max_rate_ = controls.surface_rate;
|
||||||
injection_specification.reservoir_flow_max_rate_ = controls.reservoir_rate;
|
injection_specification.reservoir_flow_max_rate_ = controls.reservoir_rate;
|
||||||
production_specification.guide_rate_ = 0.0; // We know we're not a producer
|
production_specification.guide_rate_ = 0.0; // We know we're not a producer
|
||||||
if (controls.cmode != WellInjector::CMODE_UNDEFINED) {
|
if (controls.cmode != Well2::InjectorCMode::CMODE_UNDEFINED) {
|
||||||
injection_specification.control_mode_ = toInjectionControlMode(WellInjector::ControlMode2String(controls.cmode));
|
injection_specification.control_mode_ = toInjectionControlMode(Well2::InjectorCMode2String(controls.cmode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (well.isProducer()) {
|
else if (well.isProducer()) {
|
||||||
@ -1618,8 +1618,8 @@ namespace Opm
|
|||||||
production_specification.oil_max_rate_ = controls.oil_rate;
|
production_specification.oil_max_rate_ = controls.oil_rate;
|
||||||
production_specification.water_max_rate_ = controls.water_rate;
|
production_specification.water_max_rate_ = controls.water_rate;
|
||||||
injection_specification.guide_rate_ = 0.0; // we know we're not an injector
|
injection_specification.guide_rate_ = 0.0; // we know we're not an injector
|
||||||
if (controls.cmode != WellProducer::CMODE_UNDEFINED) {
|
if (controls.cmode != Well2::ProducerCMode::CMODE_UNDEFINED) {
|
||||||
production_specification.control_mode_ = toProductionControlMode(WellProducer::ControlMode2String(controls.cmode));
|
production_specification.control_mode_ = toProductionControlMode(Well2::ProducerCMode2String(controls.cmode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Efficiency factor given specified with WEFAC
|
// Efficiency factor given specified with WEFAC
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#include <opm/core/wells/WellsGroup.hpp>
|
#include <opm/core/wells/WellsGroup.hpp>
|
||||||
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
@ -92,26 +90,26 @@ namespace WellsManagerDetail
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Mode mode(Opm::WellProducer::ControlModeEnum controlMode)
|
Mode mode(Opm::Well2::ProducerCMode controlMode)
|
||||||
{
|
{
|
||||||
switch( controlMode ) {
|
switch( controlMode ) {
|
||||||
case Opm::WellProducer::ORAT:
|
case Opm::Well2::ProducerCMode::ORAT:
|
||||||
return ORAT;
|
return ORAT;
|
||||||
case Opm::WellProducer::WRAT:
|
case Opm::Well2::ProducerCMode::WRAT:
|
||||||
return WRAT;
|
return WRAT;
|
||||||
case Opm::WellProducer::GRAT:
|
case Opm::Well2::ProducerCMode::GRAT:
|
||||||
return GRAT;
|
return GRAT;
|
||||||
case Opm::WellProducer::LRAT:
|
case Opm::Well2::ProducerCMode::LRAT:
|
||||||
return LRAT;
|
return LRAT;
|
||||||
case Opm::WellProducer::CRAT:
|
case Opm::Well2::ProducerCMode::CRAT:
|
||||||
return CRAT;
|
return CRAT;
|
||||||
case Opm::WellProducer::RESV:
|
case Opm::Well2::ProducerCMode::RESV:
|
||||||
return RESV;
|
return RESV;
|
||||||
case Opm::WellProducer::BHP:
|
case Opm::Well2::ProducerCMode::BHP:
|
||||||
return BHP;
|
return BHP;
|
||||||
case Opm::WellProducer::THP:
|
case Opm::Well2::ProducerCMode::THP:
|
||||||
return THP;
|
return THP;
|
||||||
case Opm::WellProducer::GRUP:
|
case Opm::Well2::ProducerCMode::GRUP:
|
||||||
return GRUP;
|
return GRUP;
|
||||||
default:
|
default:
|
||||||
throw std::invalid_argument("unhandled enum value");
|
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 ) {
|
switch ( controlMode ) {
|
||||||
case Opm::WellInjector::GRUP:
|
case Opm::Well2::InjectorCMode::GRUP:
|
||||||
return GRUP;
|
return GRUP;
|
||||||
case Opm::WellInjector::RESV:
|
case Opm::Well2::InjectorCMode::RESV:
|
||||||
return RESV;
|
return RESV;
|
||||||
case Opm::WellInjector::RATE:
|
case Opm::Well2::InjectorCMode::RATE:
|
||||||
return RATE;
|
return RATE;
|
||||||
case Opm::WellInjector::THP:
|
case Opm::Well2::InjectorCMode::THP:
|
||||||
return THP;
|
return THP;
|
||||||
case Opm::WellInjector::BHP:
|
case Opm::Well2::InjectorCMode::BHP:
|
||||||
return BHP;
|
return BHP;
|
||||||
default:
|
default:
|
||||||
throw std::invalid_argument("unhandled enum value");
|
throw std::invalid_argument("unhandled enum value");
|
||||||
@ -309,12 +307,12 @@ namespace Opm
|
|||||||
|
|
||||||
const auto& well = (*wellIter);
|
const auto& well = (*wellIter);
|
||||||
|
|
||||||
if (well.getStatus() == WellCommon::SHUT) {
|
if (well.getStatus() == Well2::Status::SHUT) {
|
||||||
//SHUT wells are not added to the well list
|
//SHUT wells are not added to the well list
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (well.getStatus() == WellCommon::STOP) {
|
if (well.getStatus() == Well2::Status::STOP) {
|
||||||
// Stopped wells are kept in the well list but marked as stopped.
|
// Stopped wells are kept in the well list but marked as stopped.
|
||||||
well_controls_stop_well(w_->ctrls[well_index]);
|
well_controls_stop_well(w_->ctrls[well_index]);
|
||||||
}
|
}
|
||||||
@ -326,16 +324,16 @@ namespace Opm
|
|||||||
int control_pos[5] = { -1, -1, -1, -1, -1 };
|
int control_pos[5] = { -1, -1, -1, -1, -1 };
|
||||||
|
|
||||||
clear_well_controls(well_index, w_);
|
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]);
|
control_pos[WellsManagerDetail::InjectionControl::RATE] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
double distr[3] = { 0.0, 0.0, 0.0 };
|
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;
|
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;
|
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;
|
distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,16 +346,16 @@ namespace Opm
|
|||||||
w_);
|
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]);
|
control_pos[WellsManagerDetail::InjectionControl::RESV] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
double distr[3] = { 0.0, 0.0, 0.0 };
|
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;
|
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;
|
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;
|
distr[phaseUsage.phase_pos[BlackoilPhases::Vapour]] = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,7 +368,7 @@ namespace Opm
|
|||||||
w_);
|
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]);
|
control_pos[WellsManagerDetail::InjectionControl::BHP] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
ok = append_well_controls(BHP,
|
ok = append_well_controls(BHP,
|
||||||
controls.bhp_limit,
|
controls.bhp_limit,
|
||||||
@ -381,7 +379,7 @@ namespace Opm
|
|||||||
w_);
|
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]);
|
control_pos[WellsManagerDetail::InjectionControl::THP] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
const double thp_limit = controls.thp_limit;
|
const double thp_limit = controls.thp_limit;
|
||||||
const int vfp_number = controls.vfp_table_number;
|
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]);
|
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);
|
WellsManagerDetail::InjectionControl::Mode mode = WellsManagerDetail::InjectionControl::mode(controls.cmode);
|
||||||
int cpos = control_pos[mode];
|
int cpos = control_pos[mode];
|
||||||
if (cpos == -1 && mode != WellsManagerDetail::InjectionControl::GRUP) {
|
if (cpos == -1 && mode != WellsManagerDetail::InjectionControl::GRUP) {
|
||||||
@ -411,19 +409,19 @@ namespace Opm
|
|||||||
// Set well component fraction.
|
// Set well component fraction.
|
||||||
double cf[3] = { 0.0, 0.0, 0.0 };
|
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]) {
|
if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) {
|
||||||
OPM_THROW(std::runtime_error, "Water phase not used, yet found water-injecting well.");
|
OPM_THROW(std::runtime_error, "Water phase not used, yet found water-injecting well.");
|
||||||
}
|
}
|
||||||
cf[phaseUsage.phase_pos[BlackoilPhases::Aqua]] = 1.0;
|
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]) {
|
if (!phaseUsage.phase_used[BlackoilPhases::Liquid]) {
|
||||||
OPM_THROW(std::runtime_error, "Oil phase not used, yet found oil-injecting well.");
|
OPM_THROW(std::runtime_error, "Oil phase not used, yet found oil-injecting well.");
|
||||||
}
|
}
|
||||||
cf[phaseUsage.phase_pos[BlackoilPhases::Liquid]] = 1.0;
|
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]) {
|
if (!phaseUsage.phase_used[BlackoilPhases::Vapour]) {
|
||||||
OPM_THROW(std::runtime_error, "Gas phase not used, yet found gas-injecting well.");
|
OPM_THROW(std::runtime_error, "Gas phase not used, yet found gas-injecting well.");
|
||||||
}
|
}
|
||||||
@ -442,7 +440,7 @@ namespace Opm
|
|||||||
int ok = 1;
|
int ok = 1;
|
||||||
|
|
||||||
clear_well_controls(well_index, w_);
|
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]) {
|
if (!phaseUsage.phase_used[BlackoilPhases::Liquid]) {
|
||||||
OPM_THROW(std::runtime_error, "Oil phase not active and ORAT control specified.");
|
OPM_THROW(std::runtime_error, "Oil phase not active and ORAT control specified.");
|
||||||
}
|
}
|
||||||
@ -459,7 +457,7 @@ namespace Opm
|
|||||||
w_);
|
w_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok && controls.hasControl(WellProducer::WRAT)) {
|
if (ok && controls.hasControl(Well2::ProducerCMode::WRAT)) {
|
||||||
if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) {
|
if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) {
|
||||||
OPM_THROW(std::runtime_error, "Water phase not active and WRAT control specified.");
|
OPM_THROW(std::runtime_error, "Water phase not active and WRAT control specified.");
|
||||||
}
|
}
|
||||||
@ -475,7 +473,7 @@ namespace Opm
|
|||||||
w_);
|
w_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok && controls.hasControl(WellProducer::GRAT)) {
|
if (ok && controls.hasControl(Well2::ProducerCMode::GRAT)) {
|
||||||
if (!phaseUsage.phase_used[BlackoilPhases::Vapour]) {
|
if (!phaseUsage.phase_used[BlackoilPhases::Vapour]) {
|
||||||
OPM_THROW(std::runtime_error, "Gas phase not active and GRAT control specified.");
|
OPM_THROW(std::runtime_error, "Gas phase not active and GRAT control specified.");
|
||||||
}
|
}
|
||||||
@ -491,7 +489,7 @@ namespace Opm
|
|||||||
w_);
|
w_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok && controls.hasControl(WellProducer::LRAT)) {
|
if (ok && controls.hasControl(Well2::ProducerCMode::LRAT)) {
|
||||||
if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) {
|
if (!phaseUsage.phase_used[BlackoilPhases::Aqua]) {
|
||||||
OPM_THROW(std::runtime_error, "Water phase not active and LRAT control specified.");
|
OPM_THROW(std::runtime_error, "Water phase not active and LRAT control specified.");
|
||||||
}
|
}
|
||||||
@ -511,7 +509,7 @@ namespace Opm
|
|||||||
w_);
|
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]);
|
control_pos[WellsManagerDetail::ProductionControl::RESV] = well_controls_get_num(w_->ctrls[well_index]);
|
||||||
double distr[3] = { 1.0, 1.0, 1.0 };
|
double distr[3] = { 1.0, 1.0, 1.0 };
|
||||||
ok = append_well_controls(RESERVOIR_RATE,
|
ok = append_well_controls(RESERVOIR_RATE,
|
||||||
@ -523,7 +521,7 @@ namespace Opm
|
|||||||
w_);
|
w_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ok && controls.hasControl(WellProducer::THP)) {
|
if (ok && controls.hasControl(Well2::ProducerCMode::THP)) {
|
||||||
const double thp_limit = controls.thp_limit;
|
const double thp_limit = controls.thp_limit;
|
||||||
const double alq_value = controls.alq_value;
|
const double alq_value = controls.alq_value;
|
||||||
const int vfp_number = controls.vfp_table_number;
|
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]);
|
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);
|
WellsManagerDetail::ProductionControl::Mode mode = WellsManagerDetail::ProductionControl::mode(controls.cmode);
|
||||||
int cpos = control_pos[mode];
|
int cpos = control_pos[mode];
|
||||||
if (cpos == -1 && mode != WellsManagerDetail::ProductionControl::GRUP) {
|
if (cpos == -1 && mode != WellsManagerDetail::ProductionControl::GRUP) {
|
||||||
@ -603,7 +601,7 @@ namespace Opm
|
|||||||
for (auto wellIter = wells.begin(); wellIter != wells.end(); ++wellIter ) {
|
for (auto wellIter = wells.begin(); wellIter != wells.end(); ++wellIter ) {
|
||||||
const auto& well = *wellIter;
|
const auto& well = *wellIter;
|
||||||
|
|
||||||
if (well.getStatus() == WellCommon::SHUT) {
|
if (well.getStatus() == Well2::Status::SHUT) {
|
||||||
//SHUT wells does not need guide rates
|
//SHUT wells does not need guide rates
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -612,21 +610,21 @@ namespace Opm
|
|||||||
WellNode& wellnode = *well_collection_.getLeafNodes()[wix];
|
WellNode& wellnode = *well_collection_.getLeafNodes()[wix];
|
||||||
|
|
||||||
// TODO: looks like only handling OIL phase guide rate for producers
|
// 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) {
|
if (well_data[wix].type == PRODUCER) {
|
||||||
wellnode.prodSpec().guide_rate_ = well.getGuideRate();
|
wellnode.prodSpec().guide_rate_ = well.getGuideRate();
|
||||||
if (well.getGuideRatePhase() == GuideRate::OIL) {
|
if (well.getGuideRatePhase() == Well2::GuideRateTarget::OIL) {
|
||||||
wellnode.prodSpec().guide_rate_type_ = ProductionSpecification::OIL;
|
wellnode.prodSpec().guide_rate_type_ = ProductionSpecification::OIL;
|
||||||
} else {
|
} 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.");
|
<< well.name() << " in WGRUPCON, cannot handle.");
|
||||||
}
|
}
|
||||||
} else if (well_data[wix].type == INJECTOR) {
|
} else if (well_data[wix].type == INJECTOR) {
|
||||||
wellnode.injSpec().guide_rate_ = well.getGuideRate();
|
wellnode.injSpec().guide_rate_ = well.getGuideRate();
|
||||||
if (well.getGuideRatePhase() == GuideRate::RAT) {
|
if (well.getGuideRatePhase() == Well2::GuideRateTarget::RAT) {
|
||||||
wellnode.injSpec().guide_rate_type_ = InjectionSpecification::RAT;
|
wellnode.injSpec().guide_rate_type_ = InjectionSpecification::RAT;
|
||||||
} else {
|
} 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.");
|
<< well.name() << " in WGRUPCON, cannot handle.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -34,7 +34,7 @@ namespace WellsManagerDetail
|
|||||||
Mode mode(const std::string& control);
|
Mode mode(const std::string& control);
|
||||||
|
|
||||||
|
|
||||||
Mode mode(Opm::WellProducer::ControlModeEnum controlMode);
|
Mode mode(Opm::Well2::ProducerCMode controlMode);
|
||||||
} // namespace ProductionControl
|
} // namespace ProductionControl
|
||||||
|
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ namespace WellsManagerDetail
|
|||||||
*/
|
*/
|
||||||
Mode mode(const std::string& control);
|
Mode mode(const std::string& control);
|
||||||
|
|
||||||
Mode mode(Opm::WellInjector::ControlModeEnum controlMode);
|
Mode mode(Opm::Well2::InjectorCMode controlMode);
|
||||||
|
|
||||||
} // namespace InjectionControl
|
} // 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) {
|
for (auto wellIter= wells.begin(); wellIter != wells.end(); ++wellIter) {
|
||||||
const auto& well = (*wellIter);
|
const auto& well = (*wellIter);
|
||||||
|
|
||||||
if (well.getStatus() == WellCommon::SHUT) {
|
if (well.getStatus() == Well2::Status::SHUT) {
|
||||||
continue;
|
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.
|
// shut completions and open ones stored in this process will have 1 others 0.
|
||||||
|
|
||||||
for(const auto& completion : well.getConnections()) {
|
for(const auto& completion : well.getConnections()) {
|
||||||
if (completion.state() == WellCompletion::OPEN) {
|
if (completion.state() == Connection::State::OPEN) {
|
||||||
const int i = completion.getI();
|
const int i = completion.getI();
|
||||||
const int j = completion.getJ();
|
const int j = completion.getJ();
|
||||||
const int k = completion.getK();
|
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);
|
wellperf_data[active_well_index].push_back(pd);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (completion.state() != WellCompletion::SHUT) {
|
if (completion.state() != Connection::State::SHUT) {
|
||||||
OPM_THROW(std::runtime_error, "Completion state: " << WellCompletion::StateEnum2String( completion.state() ) << " not handled");
|
OPM_THROW(std::runtime_error, "Completion state: " << Connection::State2String( completion.state() ) << " not handled");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,9 +164,9 @@ namespace Opm
|
|||||||
int number_segments_;
|
int number_segments_;
|
||||||
|
|
||||||
// components of the pressure drop to be included
|
// components of the pressure drop to be included
|
||||||
WellSegment::CompPressureDropEnum compPressureDrop() const;
|
WellSegments::CompPressureDrop compPressureDrop() const;
|
||||||
// multi-phase flow model
|
// multi-phase flow model
|
||||||
WellSegment::MultiPhaseModelEnum multiphaseModel() const;
|
WellSegments::MultiPhaseModel multiphaseModel() const;
|
||||||
|
|
||||||
// get the WellSegments from the well_ecl_
|
// get the WellSegments from the well_ecl_
|
||||||
const WellSegments& segmentSet() const;
|
const WellSegments& segmentSet() const;
|
||||||
|
@ -72,7 +72,7 @@ namespace Opm
|
|||||||
perf_depth_.resize(number_of_perforations_, 0.);
|
perf_depth_.resize(number_of_perforations_, 0.);
|
||||||
for (size_t perf = 0; perf < completion_set.size(); ++perf) {
|
for (size_t perf = 0; perf < completion_set.size(); ++perf) {
|
||||||
const Connection& connection = completion_set.get(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());
|
const int segment_index = segmentNumberToIndex(connection.segment());
|
||||||
segment_perforations_[segment_index].push_back(i_perf_wells);
|
segment_perforations_[segment_index].push_back(i_perf_wells);
|
||||||
perf_depth_[i_perf_wells] = connection.depth();
|
perf_depth_[i_perf_wells] = connection.depth();
|
||||||
@ -931,7 +931,7 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
template <typename TypeTag>
|
template <typename TypeTag>
|
||||||
WellSegment::CompPressureDropEnum
|
WellSegments::CompPressureDrop
|
||||||
MultisegmentWell<TypeTag>::
|
MultisegmentWell<TypeTag>::
|
||||||
compPressureDrop() const
|
compPressureDrop() const
|
||||||
{
|
{
|
||||||
@ -943,7 +943,7 @@ namespace Opm
|
|||||||
|
|
||||||
|
|
||||||
template <typename TypeTag>
|
template <typename TypeTag>
|
||||||
WellSegment::MultiPhaseModelEnum
|
WellSegments::MultiPhaseModel
|
||||||
MultisegmentWell<TypeTag>::
|
MultisegmentWell<TypeTag>::
|
||||||
multiphaseModel() const
|
multiphaseModel() const
|
||||||
{
|
{
|
||||||
@ -1869,7 +1869,7 @@ namespace Opm
|
|||||||
frictionalPressureLossConsidered() const
|
frictionalPressureLossConsidered() const
|
||||||
{
|
{
|
||||||
// HF- and HFA needs to consider frictional pressure loss
|
// 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>::
|
MultisegmentWell<TypeTag>::
|
||||||
accelerationalPressureLossConsidered() const
|
accelerationalPressureLossConsidered() const
|
||||||
{
|
{
|
||||||
return (segmentSet().compPressureDrop() == WellSegment::HFA);
|
return (segmentSet().compPressureDrop() == WellSegments::CompPressureDrop::HFA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,7 +24,10 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <locale>
|
#include <locale>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||||
|
|
||||||
#include <opm/core/well_controls.h>
|
#include <opm/core/well_controls.h>
|
||||||
|
|
||||||
namespace Opm
|
namespace Opm
|
||||||
@ -85,7 +88,7 @@ namespace Opm
|
|||||||
|
|
||||||
inline void
|
inline void
|
||||||
historyRates(const PhaseUsage& pu,
|
historyRates(const PhaseUsage& pu,
|
||||||
const ProductionControls& p,
|
const Well2::ProductionControls& p,
|
||||||
std::vector<double>& rates)
|
std::vector<double>& rates)
|
||||||
{
|
{
|
||||||
assert (! p.prediction_mode);
|
assert (! p.prediction_mode);
|
||||||
|
@ -608,7 +608,7 @@ namespace Opm
|
|||||||
// change temperature for injecting fluids
|
// change temperature for injecting fluids
|
||||||
if (well_type_ == INJECTOR && cq_s[activeCompIdx] > 0.0){
|
if (well_type_ == INJECTOR && cq_s[activeCompIdx] > 0.0){
|
||||||
// only handles single phase injection now
|
// 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());
|
fs.setTemperature(this->well_ecl_.temperature());
|
||||||
typedef typename std::decay<decltype(fs)>::type::Scalar FsScalar;
|
typedef typename std::decay<decltype(fs)>::type::Scalar FsScalar;
|
||||||
typename FluidSystem::template ParameterCache<FsScalar> paramCache;
|
typename FluidSystem::template ParameterCache<FsScalar> paramCache;
|
||||||
@ -2534,7 +2534,7 @@ namespace Opm
|
|||||||
auto phase = well_ecl_.getInjectionProperties().injectorType;
|
auto phase = well_ecl_.getInjectionProperties().injectorType;
|
||||||
// only single phase injection handled
|
// only single phase injection handled
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx)) {
|
||||||
if (phase == WellInjector::TypeEnum::WATER) {
|
if (phase == Well2::InjectorType::WATER) {
|
||||||
primary_variables_[WFrac] = 1.0;
|
primary_variables_[WFrac] = 1.0;
|
||||||
} else {
|
} else {
|
||||||
primary_variables_[WFrac] = 0.0;
|
primary_variables_[WFrac] = 0.0;
|
||||||
@ -2542,7 +2542,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
|
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx)) {
|
||||||
if (phase == WellInjector::TypeEnum::GAS) {
|
if (phase == Well2::InjectorType::GAS) {
|
||||||
primary_variables_[GFrac] = 1.0 - wsolvent();
|
primary_variables_[GFrac] = 1.0 - wsolvent();
|
||||||
if (has_solvent) {
|
if (has_solvent) {
|
||||||
primary_variables_[SFrac] = wsolvent();
|
primary_variables_[SFrac] = wsolvent();
|
||||||
|
@ -29,8 +29,6 @@
|
|||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.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/wells.h>
|
||||||
#include <opm/core/well_controls.h>
|
#include <opm/core/well_controls.h>
|
||||||
|
@ -152,7 +152,7 @@ namespace Opm
|
|||||||
|
|
||||||
int num_active_connections = 0;
|
int num_active_connections = 0;
|
||||||
for (int c = 0; c < num_conns; ++c) {
|
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++);
|
completions_[connections[c].complnum()].push_back(num_active_connections++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -312,7 +312,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto injectorType = well_ecl_.injectorType();
|
auto injectorType = well_ecl_.injectorType();
|
||||||
if (injectorType == WellInjector::GAS) {
|
if (injectorType == Well2::InjectorType::GAS) {
|
||||||
double solvent_fraction = well_ecl_.getSolventFraction();
|
double solvent_fraction = well_ecl_.getSolventFraction();
|
||||||
return solvent_fraction;
|
return solvent_fraction;
|
||||||
} else {
|
} else {
|
||||||
@ -336,7 +336,7 @@ namespace Opm
|
|||||||
|
|
||||||
auto injectorType = well_ecl_.injectorType();
|
auto injectorType = well_ecl_.injectorType();
|
||||||
|
|
||||||
if (injectorType == WellInjector::WATER) {
|
if (injectorType == Well2::InjectorType::WATER) {
|
||||||
WellPolymerProperties polymer = well_ecl_.getPolymerProperties();
|
WellPolymerProperties polymer = well_ecl_.getPolymerProperties();
|
||||||
const double polymer_injection_concentration = polymer.m_polymerConcentration;
|
const double polymer_injection_concentration = polymer.m_polymerConcentration;
|
||||||
return polymer_injection_concentration;
|
return polymer_injection_concentration;
|
||||||
@ -361,7 +361,7 @@ namespace Opm
|
|||||||
|
|
||||||
auto injectorType = well_ecl_.injectorType();
|
auto injectorType = well_ecl_.injectorType();
|
||||||
|
|
||||||
if (injectorType == WellInjector::GAS) {
|
if (injectorType == Well2::InjectorType::GAS) {
|
||||||
WellFoamProperties fprop = well_ecl_.getFoamProperties();
|
WellFoamProperties fprop = well_ecl_.getFoamProperties();
|
||||||
return fprop.m_foamConcentration;
|
return fprop.m_foamConcentration;
|
||||||
} else {
|
} else {
|
||||||
@ -923,8 +923,8 @@ namespace Opm
|
|||||||
|
|
||||||
// for the moment, we only handle rate limits, not handling potential limits
|
// for the moment, we only handle rate limits, not handling potential limits
|
||||||
// the potential limits should not be difficult to add
|
// the potential limits should not be difficult to add
|
||||||
const WellEcon::QuantityLimitEnum& quantity_limit = econ_production_limits.quantityLimit();
|
const auto& quantity_limit = econ_production_limits.quantityLimit();
|
||||||
if (quantity_limit == WellEcon::POTN) {
|
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")
|
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. ");
|
+ std::string("All the limits will be evaluated based on RATE. ");
|
||||||
deferred_logger.warning("NOT_SUPPORTING_POTN", msg);
|
deferred_logger.warning("NOT_SUPPORTING_POTN", msg);
|
||||||
@ -973,9 +973,9 @@ namespace Opm
|
|||||||
checkRatioEconLimits(econ_production_limits, well_state, ratio_report, deferred_logger);
|
checkRatioEconLimits(econ_production_limits, well_state, ratio_report, deferred_logger);
|
||||||
|
|
||||||
if (ratio_report.ratio_limit_violated) {
|
if (ratio_report.ratio_limit_violated) {
|
||||||
const WellEcon::WorkoverEnum workover = econ_production_limits.workover();
|
const auto workover = econ_production_limits.workover();
|
||||||
switch (workover) {
|
switch (workover) {
|
||||||
case WellEcon::CON:
|
case WellEconProductionLimits::EconWorkover::CON:
|
||||||
{
|
{
|
||||||
const int worst_offending_completion = ratio_report.worst_offending_completion;
|
const int worst_offending_completion = ratio_report.worst_offending_completion;
|
||||||
|
|
||||||
@ -1014,7 +1014,7 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WellEcon::WELL:
|
case WellEconProductionLimits::EconWorkover::WELL:
|
||||||
{
|
{
|
||||||
well_test_state.closeWell(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
|
well_test_state.closeWell(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
|
||||||
if (write_message_to_opmlog) {
|
if (write_message_to_opmlog) {
|
||||||
@ -1029,12 +1029,12 @@ namespace Opm
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case WellEcon::NONE:
|
case WellEconProductionLimits::EconWorkover::NONE:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
deferred_logger.warning("NOT_SUPPORTED_WORKOVER_TYPE",
|
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();
|
const auto& connectionSet = well_ecl_.getConnections();
|
||||||
for (size_t c=0; c<connectionSet.size(); c++) {
|
for (size_t c=0; c<connectionSet.size(); c++) {
|
||||||
const auto& connection = connectionSet.get(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 i = connection.getI();
|
||||||
const int j = connection.getJ();
|
const int j = connection.getJ();
|
||||||
const int k = connection.getK();
|
const int k = connection.getK();
|
||||||
@ -1175,15 +1175,15 @@ namespace Opm
|
|||||||
double perf_length; // the length of the well perforation
|
double perf_length; // the length of the well perforation
|
||||||
|
|
||||||
switch (connection.dir()) {
|
switch (connection.dir()) {
|
||||||
case Opm::WellCompletion::DirectionEnum::X:
|
case Opm::Connection::Direction::X:
|
||||||
re = std::sqrt(cubical[1] * cubical[2] / M_PI);
|
re = std::sqrt(cubical[1] * cubical[2] / M_PI);
|
||||||
perf_length = cubical[0];
|
perf_length = cubical[0];
|
||||||
break;
|
break;
|
||||||
case Opm::WellCompletion::DirectionEnum::Y:
|
case Opm::Connection::Direction::Y:
|
||||||
re = std::sqrt(cubical[0] * cubical[2] / M_PI);
|
re = std::sqrt(cubical[0] * cubical[2] / M_PI);
|
||||||
perf_length = cubical[1];
|
perf_length = cubical[1];
|
||||||
break;
|
break;
|
||||||
case Opm::WellCompletion::DirectionEnum::Z:
|
case Opm::Connection::Direction::Z:
|
||||||
re = std::sqrt(cubical[0] * cubical[1] / M_PI);
|
re = std::sqrt(cubical[0] * cubical[1] / M_PI);
|
||||||
perf_length = cubical[2];
|
perf_length = cubical[2];
|
||||||
break;
|
break;
|
||||||
|
@ -669,7 +669,7 @@ namespace Opm
|
|||||||
std::vector<std::vector<int>> segment_perforations(well_nseg);
|
std::vector<std::vector<int>> segment_perforations(well_nseg);
|
||||||
for (size_t perf = 0; perf < completion_set.size(); ++perf) {
|
for (size_t perf = 0; perf < completion_set.size(); ++perf) {
|
||||||
const Connection& connection = completion_set.get(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());
|
const int segment_index = segment_set.segmentNumberToIndex(connection.segment());
|
||||||
segment_perforations[segment_index].push_back(n_activeperf);
|
segment_perforations[segment_index].push_back(n_activeperf);
|
||||||
n_activeperf++;
|
n_activeperf++;
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
#include <opm/parser/eclipse/Deck/Deck.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/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||||
|
|
||||||
#include <opm/grid/UnstructuredGrid.h>
|
#include <opm/grid/UnstructuredGrid.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user