handling WELL workover over ratio economic limit.

This commit is contained in:
Kai Bao 2017-10-11 07:55:48 +02:00
parent de1be6b5ef
commit 5328de6361

View File

@ -636,11 +636,11 @@ namespace Opm
if (well_ecl_->getAutomaticShutIn()) {
list_econ_limited.addShutWell(well_name);
const std::string msg = std::string("well ") + well_name + std::string(" will be shut in due to economic limit");
const std::string msg = std::string("well ") + well_name + std::string(" will be shut in due to rate economic limit");
OpmLog::info(msg);
} else {
list_econ_limited.addStoppedWell(well_name);
const std::string msg = std::string("well ") + well_name + std::string(" will be stopped due to economic limit");
const std::string msg = std::string("well ") + well_name + std::string(" will be stopped due to rate economic limit");
OpmLog::info(msg);
}
// the well is closed, not need to check other limits
@ -657,21 +657,48 @@ namespace Opm
}
if (ratio_limits_violated) {
const bool last_connection = std::get<1>(ratio_check_return);
const int worst_offending_connection = std::get<2>(ratio_check_return);
const WellEcon::WorkoverEnum workover = econ_production_limits.workover();
switch (workover) {
case WellEcon::CON:
{
const bool last_connection = std::get<1>(ratio_check_return);
const int worst_offending_connection = std::get<2>(ratio_check_return);
assert((worst_offending_connection >= 0) && (worst_offending_connection < number_of_perforations_));
assert((worst_offending_connection >= 0) && (worst_offending_connection < number_of_perforations_));
const int cell_worst_offending_connection = well_cells_[worst_offending_connection];
list_econ_limited.addClosedConnectionsForWell(well_name, cell_worst_offending_connection);
const std::string msg = std::string("Connection ") + std::to_string(worst_offending_connection) + std::string(" for well ")
+ well_name + std::string(" will be closed due to economic limit");
OpmLog::info(msg);
const int cell_worst_offending_connection = well_cells_[worst_offending_connection];
list_econ_limited.addClosedConnectionsForWell(well_name, cell_worst_offending_connection);
const std::string msg = std::string("Connection ") + std::to_string(worst_offending_connection) + std::string(" for well ")
+ well_name + std::string(" will be closed due to economic limit");
OpmLog::info(msg);
if (last_connection) {
list_econ_limited.addShutWell(well_name);
const std::string msg2 = well_name + std::string(" will be shut due to the last connection closed");
OpmLog::info(msg2);
if (last_connection) {
// TODO: there is more things to check here
list_econ_limited.addShutWell(well_name);
const std::string msg2 = well_name + std::string(" will be shut due to the last connection closed");
OpmLog::info(msg2);
}
break;
}
case WellEcon::WELL:
{
if (well_ecl_->getAutomaticShutIn()) {
list_econ_limited.addShutWell(well_name);
const std::string msg = well_name + std::string(" will be shut due to ratio economic limit");
OpmLog::info(msg);
} else {
list_econ_limited.addStoppedWell(well_name);
const std::string msg = well_name + std::string(" will be stopped due to ratio economic limit");
OpmLog::info(msg);
}
break;
}
case WellEcon::NONE:
break;
default:
{
OpmLog::warning("NOT_SUPPORTED_WORKOVER_TYPE", "not supporting workover type " + WellEcon::WorkoverEnumToString(workover) );
}
}
}
}