Merge pull request #3591 from joakim-hove/welltest-state-rename

Welltest state rename
This commit is contained in:
Joakim Hove 2021-10-08 14:07:04 +02:00 committed by GitHub
commit c599402318
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 21 deletions

View File

@ -1325,7 +1325,7 @@ assignShutConnections(data::Wells& wsrpt,
return wellIsOpen && (conn.state() != Connection::State::SHUT);
};
if (this->wellTestState().hasWellClosed(well.name()) &&
if (this->wellTestState().well_is_closed(well.name()) &&
!this->wasDynamicallyShutThisTimeStep(wellID))
{
xwel.dynamicStatus = well.getAutomaticShutIn()
@ -1592,7 +1592,7 @@ forceShutWellByNameIfPredictionMode(const std::string& wellname,
for (const auto& well : well_container_generic_) {
if (well->name() == wellname && !well->wellIsStopped()) {
if (well->underPredictionMode()) {
wellTestState().closeWell(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time);
wellTestState().close_well(wellname, WellTestConfig::Reason::PHYSICAL, simulation_time);
well_was_shut = 1;
}
break;

View File

@ -599,7 +599,7 @@ namespace Opm {
}
// A new WCON keywords can re-open a well that was closed/shut due to Physical limit
if (this->wellTestState().hasWellClosed(well_name)) {
if (this->wellTestState().well_is_closed(well_name)) {
// TODO: more checking here, to make sure this standard more specific and complete
// maybe there is some WCON keywords will not open the well
auto& events = this->wellState().well(w).events;
@ -611,8 +611,8 @@ namespace Opm {
// even if it was new or received new targets this report step.
events.clearEvent(WellState::event_mask);
} else {
wellTestState().openWell(well_name);
wellTestState().openAllCompletions(well_name);
wellTestState().open_well(well_name);
wellTestState().open_completions(well_name);
}
}
}
@ -620,7 +620,7 @@ namespace Opm {
// TODO: should we do this for all kinds of closing reasons?
// something like wellTestState().hasWell(well_name)?
bool wellIsStopped = false;
if (wellTestState().hasWellClosed(well_name))
if (wellTestState().well_is_closed(well_name))
{
if (well_ecl.getAutomaticShutIn()) {
// shut wells are not added to the well container
@ -1294,11 +1294,11 @@ namespace Opm {
DeferredLogger local_deferredLogger;
for (const auto& well : well_container_) {
const auto& wname = well->name();
const auto wasClosed = wellTestState.hasWellClosed(wname);
const auto wasClosed = wellTestState.well_is_closed(wname);
well->checkWellOperability(ebosSimulator_, this->wellState(), local_deferredLogger);
well->updateWellTestState(this->wellState().well(wname), simulationTime, /*writeMessageToOPMLog=*/ true, wellTestState, local_deferredLogger);
if (!wasClosed && wellTestState.hasWellClosed(wname)) {
if (!wasClosed && wellTestState.well_is_closed(wname)) {
this->closed_this_step_.insert(wname);
}
}

View File

@ -708,7 +708,7 @@ updateWellTestStateEconomic(const SingleWellState& ws,
deferred_logger.warning("NOT_SUPPORTING_FOLLOWONWELL", "opening following on well after well closed is not supported yet");
}
well_test_state.closeWell(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
well_test_state.close_well(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
if (write_message_to_opmlog) {
if (this->well_ecl_.getAutomaticShutIn()) {
const std::string msg = std::string("well ") + name() + std::string(" will be shut due to rate economic limit");
@ -740,7 +740,7 @@ updateWellTestStateEconomic(const SingleWellState& ws,
{
const int worst_offending_completion = ratio_report.worst_offending_completion;
well_test_state.addClosedCompletion(name(), worst_offending_completion, simulation_time);
well_test_state.close_completion(name(), worst_offending_completion, simulation_time);
if (write_message_to_opmlog) {
if (worst_offending_completion < 0) {
const std::string msg = std::string("Connection ") + std::to_string(- worst_offending_completion)
@ -757,13 +757,13 @@ updateWellTestStateEconomic(const SingleWellState& ws,
const auto& connections = well_ecl_.getConnections();
for (const auto& connection : connections) {
if (connection.state() == Connection::State::OPEN
&& !well_test_state.hasCompletion(name(), connection.complnum())) {
&& !well_test_state.completion_is_closed(name(), connection.complnum())) {
allCompletionsClosed = false;
}
}
if (allCompletionsClosed) {
well_test_state.closeWell(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
well_test_state.close_well(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
if (write_message_to_opmlog) {
if (this->well_ecl_.getAutomaticShutIn()) {
const std::string msg = name() + std::string(" will be shut due to last completion closed");
@ -778,7 +778,7 @@ updateWellTestStateEconomic(const SingleWellState& ws,
}
case WellEconProductionLimits::EconWorkover::WELL:
{
well_test_state.closeWell(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
well_test_state.close_well(name(), WellTestConfig::Reason::ECONOMIC, simulation_time);
if (write_message_to_opmlog) {
if (well_ecl_.getAutomaticShutIn()) {
// tell the control that the well is closed

View File

@ -233,7 +233,7 @@ void WellInterfaceGeneric::closeCompletions(WellTestState& wellTestState)
int perfIdx = 0;
for (const auto& connection : connections) {
if (connection.state() == Connection::State::OPEN) {
if (wellTestState.hasCompletion(name(), connection.complnum())) {
if (wellTestState.completion_is_closed(name(), connection.complnum())) {
well_index_[perfIdx] = 0.0;
}
perfIdx++;
@ -353,10 +353,10 @@ void WellInterfaceGeneric::updateWellTestStatePhysical(const double simulation_t
DeferredLogger& deferred_logger) const
{
if (!isOperableAndSolvable()) {
if (well_test_state.hasWellClosed(name())) {
if (well_test_state.well_is_closed(name())) {
// Already closed, do nothing.
} else {
well_test_state.closeWell(name(), WellTestConfig::Reason::PHYSICAL, simulation_time);
well_test_state.close_well(name(), WellTestConfig::Reason::PHYSICAL, simulation_time);
if (write_message_to_opmlog) {
const std::string action = well_ecl_.getAutomaticShutIn() ? "shut" : "stopped";
const std::string msg = "Well " + name()

View File

@ -298,17 +298,16 @@ namespace Opm
}
// update wellTestState if the well test succeeds
if (!welltest_state_temp.hasWellClosed(this->name())) {
well_test_state.openWell(this->name());
if (!welltest_state_temp.well_is_closed(this->name())) {
well_test_state.open_well(this->name());
std::string msg = std::string("well ") + this->name() + std::string(" is re-opened");
deferred_logger.info(msg);
// also reopen completions
for (auto& completion : this->well_ecl_.getCompletions()) {
if (!welltest_state_temp.hasCompletion(this->name(), completion.first)) {
well_test_state.dropCompletion(this->name(), completion.first);
}
if (!welltest_state_temp.completion_is_closed(this->name(), completion.first))
well_test_state.open_completion(this->name(), completion.first);
}
// set the status of the well_state to open
ws.open();