RESV: Ignore phase distribution for non-PRODUCERs

The WellsManager class handles INJECTORS by assigning a phase
distribution (W->ctrls[i]->distr) that coincides with the injected
fluid for the corresponding well (e.g., {1,0,0} for WATER injectors in
a three-phase WATER/OIL/GAS simulation).  This, however, meshes poorly
with the restriction that all phase components must be ONE in the case
of wells constrained by total reservoir volume flow targets (RESV)
that was introduced in commit b7d1634.

This change-set limits the restriction on phase distributions to
PRODUCERs only and is a tentative solution to GitHub PR #360.
This commit is contained in:
Bård Skaflestad 2013-09-25 15:38:55 +02:00
parent 8added1bc8
commit 6a31f54a6e

View File

@ -379,12 +379,21 @@ assemble_well_contrib(int nc ,
break;
case RESERVOIR_RATE:
for (p = 0; p < np; p++) {
if (ctrls->distr[np * ctrls->current + p] != 1.0) {
*ok = 0;
break;
if (W->type[w] == PRODUCER) {
/* Ensure minimal consistency. A PRODUCER should
* specify a phase distribution of all ones in the
* case of RESV controls. */
for (p = 0; p < np; p++) {
if (ctrls->distr[np * ctrls->current + p] != 1.0) {
*ok = 0;
break;
}
}
} else {
/* Ignore phase distribution for non-PRODUCERs */
*ok = 1;
}
if (*ok) {
assemble_rate_well(nc, w, W, mt, wdp, h);
}