Initialize well rates better.

Instead of making well rates zero for wells that are not controlled by
surface volume, we initialize them to a small value with the correct
sign (positive for injectors, negative for producers).
This commit is contained in:
Atgeirr Flø Rasmussen
2014-03-10 13:30:43 +01:00
parent d88a5572b8
commit c0ddb9707e

View File

@@ -59,13 +59,20 @@ namespace Opm
bhp_[w] = well_controls_get_current_target( ctrl );
}
// Initialize well rates to match controls if type is SURFACE_RATE
// Initialize well rates to match controls if type is SURFACE_RATE,
// otherwise set to a small rate with the correct sign.
if (well_controls_well_is_open( ctrl ) || (well_controls_get_current_type(ctrl) == SURFACE_RATE)) {
const double rate_target = well_controls_get_current_target(ctrl);
const double * distr = well_controls_get_current_distr( ctrl );
for (int p = 0; p < np; ++p) {
wellrates_[np*w + p] = rate_target * distr[p];
}
} else {
const double small_rate = 1e-14;
const double sign = (wells->type[w] == INJECTOR) ? 1.0 : -1.0;
for (int p = 0; p < np; ++p) {
wellrates_[np*w + p] = small_rate * sign;
}
}
}
// The perforation rates and perforation pressures are