adding function initCompletions() to WellInterface

This commit is contained in:
Kai Bao 2019-06-20 09:07:20 +02:00
parent c0b48e28c3
commit 8be28e8448
2 changed files with 42 additions and 0 deletions

View File

@ -320,6 +320,21 @@ namespace Opm
// well bore diameter
std::vector<double> bore_diameters_;
/*
* completions_ contains the mapping from completion id to connection indices
* {
* 2 : [ConnectionIndex, ConnectioniIndex],
* 1 : [ConnectionIndex, ConnectionIndex, ConnectoniIndex],
* 5 : [ConnectionIndex],
* 7 : [ConnectionIndex]
* ...
* }
* The integer ID's 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
*/
std::map<int, std::vector<int>> completions_;
const PhaseUsage* phase_usage_;
bool getAllowCrossFlow() const;
@ -417,6 +432,8 @@ namespace Opm
void scaleProductivityIndex(const int perfIdx, double& productivity_index, const bool new_well, Opm::DeferredLogger& deferred_logger);
void initCompletions();
// count the number of times an output log message is created in the productivity
// index calculations
int well_productivity_index_logger_counter_;

View File

@ -100,6 +100,9 @@ namespace Opm
saturation_table_number_.begin() );
}
// initialization of the completions mapping
initCompletions();
well_efficiency_factor_ = 1.0;
connectionRates_.resize(number_of_perforations_);
@ -137,6 +140,28 @@ namespace Opm
template<typename TypeTag>
void
WellInterface<TypeTag>::
initCompletions()
{
assert(completions_.empty() );
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);
}
}
template<typename TypeTag>
void
WellInterface<TypeTag>::