Merge pull request #110 from qilicun/fix_polyinflow

Fix error: When the injector is not the first of wells, opm should work well
This commit is contained in:
Atgeirr Flø Rasmussen 2015-05-20 11:12:43 +02:00
commit c700b2124d

View File

@ -158,19 +158,22 @@ namespace Opm
std::unordered_map<std::string, double>::const_iterator map_it;
// Extract concentrations and put into cell->concentration map.
std::map<int, double> perfcell_conc;
for (size_t i = 0; i < wellPolymerRate_.size(); ++i) {
for (map_it = wellPolymerRate_.begin(); map_it != wellPolymerRate_.end(); ++map_it) {
// Only use well name and polymer concentration.
// That is, we ignore salt concentration and group
// names.
int wix = 0;
for (; wix < wells.number_of_wells; ++wix) {
map_it = wellPolymerRate_.find(wells.name[wix]);
if (map_it == wellPolymerRate_.end()) {
OPM_THROW(std::runtime_error, "Could not find a match for well from WPOLYMER.");
} else {
if (wellPolymerRate_.count(wells.name[wix]) > 0) {
break;
}
}
if (wix == wells.number_of_wells) {
OPM_THROW(std::runtime_error, "Could not find a match for well "
<< map_it->first
<< " from WPOLYMER.");
}
for (int j = wells.well_connpos[wix]; j < wells.well_connpos[wix+1]; ++j) {
const int perf_cell = wells.well_cells[j];
perfcell_conc[perf_cell] = map_it->second;