Merge pull request #1909 from GitPaean/fixing_completions

considering not OPEN connection when updateCompletions in WellInterface.
This commit is contained in:
Bård Skaflestad 2019-06-24 22:18:37 +02:00 committed by GitHub
commit 35a174d326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -331,7 +331,9 @@ namespace Opm
* }
* The integer IDs correspond to the COMPLETION id given by the COMPLUMP keyword.
* When there is no COMPLUMP keyword used, a default completion number will be assigned
* based on the order of the declaration of the connections
* based on the order of the declaration of the connections.
* Since the connections not OPEN is not included in the Wells, so they will not be considered
* in this mapping relation.
*/
std::map<int, std::vector<int>> completions_;

View File

@ -150,11 +150,13 @@ namespace Opm
const WellConnections& connections = well_ecl_.getConnections();
const int num_conns = connections.size();
assert(num_conns == number_of_perforations_);
for (int c = 0; c < num_conns; c++) {
completions_[connections[c].complnum()].push_back(c);
int num_active_connections = 0;
for (int c = 0; c < num_conns; ++c) {
if (connections[c].state() == WellCompletion::OPEN) {
completions_[connections[c].complnum()].push_back(num_active_connections++);
}
}
assert(num_active_connections == number_of_perforations_);
}