Bugfix in well rate init.

Do not always try to initialize, also initialize proper phase rates.
This commit is contained in:
Atgeirr Flø Rasmussen 2013-06-02 22:19:43 +02:00
parent ad4c9a47e0
commit 175cecacda

View File

@ -59,11 +59,12 @@ namespace Opm
bhp_[w] = ctrl->target[ctrl->current];
}
// Initialize well rates to match controls if type is SURFACE_RATE
if ((ctrl->current >= 0) || // open well
if ((ctrl->current >= 0) && // open well
(ctrl->type[ctrl->current] != SURFACE_RATE)) {
const double rate_target = ctrl->target[ctrl->current];
for (int p = 0; p < np; ++p) {
const double phase_distr = ctrl->distr[np * ctrl->current + p];
const double phase_distr = ctrl->distr[np * ctrl->current + p]
* wells->comp_frac[np * w + p];
wellrates_[np*w + p] = rate_target * phase_distr;
}
}