not adding wells without perforations to WellsManager

This commit is contained in:
Kai Bao 2019-01-04 11:17:48 +01:00
parent 480fa1fd44
commit a9f40df678

View File

@ -150,24 +150,22 @@ void WellsManager::createWellsFromSpecs(std::vector<const Well*>& wells, size_t
for(const auto& completion : well->getConnections(timeStep)) { for(const auto& completion : well->getConnections(timeStep)) {
if (completion.state() == WellCompletion::OPEN) { if (completion.state() == WellCompletion::OPEN) {
int i = completion.getI(); const int i = completion.getI();
int j = completion.getJ(); const int j = completion.getJ();
int k = completion.getK(); const int k = completion.getK();
const int* cpgdim = cart_dims; const int* cpgdim = cart_dims;
int cart_grid_indx = i + cpgdim[0]*(j + cpgdim[1]*k); const int cart_grid_indx = i + cpgdim[0]*(j + cpgdim[1]*k);
std::map<int, int>::const_iterator cgit = cartesian_to_compressed.find(cart_grid_indx); const std::map<int, int>::const_iterator cgit = cartesian_to_compressed.find(cart_grid_indx);
if (cgit == cartesian_to_compressed.end()) { if (cgit == cartesian_to_compressed.end()) {
OPM_MESSAGE("****Warning: Cell with i,j,k indices " << i << ' ' << j << ' ' const std::string msg = ("Cell with i,j,k indices " + std::to_string(i) + " " + std::to_string(j)
<< k << " not found in grid. The completion will be igored (well = " + " " + std::to_string(k) + " not found in grid (well = " + well->name() + ").");
<< well->name() << ')'); OPM_THROW(std::runtime_error, msg);
} }
else else
{ {
int cell = cgit->second;
PerfData pd; PerfData pd;
pd.cell = cell; pd.cell = cgit->second;
pd.well_index = completion.CF() * completion.wellPi(); pd.well_index = completion.CF() * completion.wellPi();
pd.satnumid = completion.satTableId(); pd.satnumid = completion.satTableId();
@ -180,6 +178,15 @@ void WellsManager::createWellsFromSpecs(std::vector<const Well*>& wells, size_t
} }
} }
} }
if (wellperf_data[active_well_index].empty()) {
const std::string msg = " there is no perforations associated with the well "
+ well->name() + ", the well is ignored for the report step "
+ std::to_string(timeStep);
OpmLog::warning(msg);
wells_on_proc[wellIter - wells.begin()] = 0;
continue;
}
{ // WELSPECS handling { // WELSPECS handling
well_names_to_index[well->name()] = active_well_index; well_names_to_index[well->name()] = active_well_index;
well_names.push_back(well->name()); well_names.push_back(well->name());