Use preferred phase to compute wellbore mix for dead wells

The wellmore mix is set to preferred phase for dead wells, where the
total volumetric rates are zero. This sets the phase of the flow out of
perforations in dead wells and thus avoids zero volumerats for injecting
preforations in dead wells.
This commit is contained in:
Tor Harald Sandve 2014-04-04 11:33:36 +02:00
parent 1f8276b3d4
commit a905eade7a

View File

@ -792,9 +792,11 @@ namespace {
isNotDeadWells[c] = 0;
}
// compute wellbore mixture at std conds
Selector<double> notDeadWells_selector(wbqt.value(),Selector<double>::Zero);
std::vector<ADB> mix_s(np, ADB::null());
for (int phase = 0; phase < np; ++phase) {
mix_s[phase] = isNotDeadWells * wbq[phase]/wbqt;
const int pos = pu.phase_pos[phase];
mix_s[phase] = notDeadWells_selector.select(ADB::constant(compi.col(pos), state.bhp.blockPattern()),wbq[phase]/wbqt);
}
@ -832,7 +834,7 @@ namespace {
const int oilpos = pu.phase_pos[Oil];
tmp = tmp - subset(state.rs,well_cells) * cmix_s[oilpos] / d;
}
volRat += tmp / subset(rq_[phase].b,well_cells);
volRat += tmp / subset(rq_[phase].b,well_cells);
}