mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
split close wells from close connection
This commit is contained in:
parent
a5f5581441
commit
4a2780d161
@ -163,7 +163,7 @@ namespace Opm {
|
|||||||
|
|
||||||
// Close wells and completions due to economical reasons
|
// Close wells and completions due to economical reasons
|
||||||
for (auto& well : well_container_) {
|
for (auto& well : well_container_) {
|
||||||
well->closeWellsAndCompletions(wellTestState_);
|
well->closeCompletions(wellTestState_);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -248,12 +248,12 @@ namespace Opm {
|
|||||||
const size_t numberOfClosedCompletions = wellTestStateForTheWellTest.sizeCompletions();
|
const size_t numberOfClosedCompletions = wellTestStateForTheWellTest.sizeCompletions();
|
||||||
well->solveWellForTesting(ebosSimulator_, wellStateCopy, B_avg, terminal_output_);
|
well->solveWellForTesting(ebosSimulator_, wellStateCopy, B_avg, terminal_output_);
|
||||||
well->updateWellTestState(wellStateCopy, simulationTime, wellTestStateForTheWellTest, /*writeMessageToOPMLog=*/ false);
|
well->updateWellTestState(wellStateCopy, simulationTime, wellTestStateForTheWellTest, /*writeMessageToOPMLog=*/ false);
|
||||||
well->closeWellsAndCompletions(wellTestStateForTheWellTest);
|
well->closeCompletions(wellTestStateForTheWellTest);
|
||||||
|
|
||||||
// Stop testing if the well is closed or shut due to all completions shut
|
// Stop testing if the well is closed or shut due to all completions shut
|
||||||
// Also check if number of completions has increased. If the number of closed completions do not increased
|
// Also check if number of completions has increased. If the number of closed completions do not increased
|
||||||
// we stop the testing.
|
// we stop the testing.
|
||||||
if (wellTestStateForTheWellTest.sizeWells() > 0 && numberOfClosedCompletions == wellTestStateForTheWellTest.sizeCompletions())
|
if (wellTestStateForTheWellTest.sizeWells() > 0 || numberOfClosedCompletions == wellTestStateForTheWellTest.sizeCompletions())
|
||||||
testWell = false;
|
testWell = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -338,14 +338,22 @@ namespace Opm {
|
|||||||
|
|
||||||
const Well* well_ecl = wells_ecl_[index_well];
|
const Well* well_ecl = wells_ecl_[index_well];
|
||||||
|
|
||||||
// well is shut due to economical reasons
|
// well is closed due to economical reasons
|
||||||
if (wellTestState_.hasWell(well_name, WellTestConfig::Reason::ECONOMIC) && well_ecl->getAutomaticShutIn() ) {
|
if (wellTestState_.hasWell(well_name, WellTestConfig::Reason::ECONOMIC)) {
|
||||||
well_state_.bhp()[w] = 0;
|
if( well_ecl->getAutomaticShutIn() ) {
|
||||||
const int np = numPhases();
|
// shut wells are not added to the well container
|
||||||
for (int p = 0; p < np; ++p) {
|
well_state_.bhp()[w] = 0;
|
||||||
well_state_.wellRates()[np * w + p] = 0;
|
const int np = numPhases();
|
||||||
|
for (int p = 0; p < np; ++p) {
|
||||||
|
well_state_.wellRates()[np * w + p] = 0;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// close wells are added to the container but marked as closed
|
||||||
|
struct WellControls* well_controls = wells()->ctrls[w];
|
||||||
|
well_controls_stop_well(well_controls);
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use the pvtRegionIdx from the top cell
|
// Use the pvtRegionIdx from the top cell
|
||||||
|
@ -227,7 +227,7 @@ namespace Opm
|
|||||||
|
|
||||||
void solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, const std::vector<double>& B_avg, bool terminal_output);
|
void solveWellForTesting(Simulator& ebosSimulator, WellState& well_state, const std::vector<double>& B_avg, bool terminal_output);
|
||||||
|
|
||||||
void closeWellsAndCompletions(WellTestState& wellTestState);
|
void closeCompletions(WellTestState& wellTestState);
|
||||||
|
|
||||||
const Well* wellEcl() const;
|
const Well* wellEcl() const;
|
||||||
|
|
||||||
|
@ -913,12 +913,8 @@ namespace Opm
|
|||||||
|
|
||||||
template<typename TypeTag>
|
template<typename TypeTag>
|
||||||
void
|
void
|
||||||
WellInterface<TypeTag>::closeWellsAndCompletions(WellTestState& wellTestState)
|
WellInterface<TypeTag>::closeCompletions(WellTestState& wellTestState)
|
||||||
{
|
{
|
||||||
if (wellTestState.hasWell(name(), WellTestConfig::Reason::ECONOMIC)) {
|
|
||||||
well_controls_stop_well(wellControls());
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto& connections = well_ecl_->getConnections(current_step_);
|
const auto& connections = well_ecl_->getConnections(current_step_);
|
||||||
int perfIdx = 0;
|
int perfIdx = 0;
|
||||||
for (const auto& connection : connections) {
|
for (const auto& connection : connections) {
|
||||||
|
Loading…
Reference in New Issue
Block a user