improve initialization msw new wells

This commit is contained in:
Tor Harald Sandve
2022-03-23 12:29:40 +01:00
parent 519b5dd8cc
commit 32dfdc6198
3 changed files with 28 additions and 17 deletions

View File

@@ -422,9 +422,15 @@ namespace Opm
// initialized the well rates with the potentials i.e. the well rates based on bhp
const int np = this->number_of_phases_;
const double sign = well_copy.well_ecl_.isInjector() ? 1.0 : -1.0;
bool trivial = true;
for (int phase = 0; phase < np; ++phase){
ws.surface_rates[phase] = sign * ws.well_potentials[phase];
trivial = trivial && (ws.well_potentials[phase] == 0.0) ;
}
if (!trivial) {
const double sign = well_copy.well_ecl_.isInjector() ? 1.0 : -1.0;
for (int phase = 0; phase < np; ++phase) {
ws.surface_rates[phase] = sign * ws.well_potentials[phase];
}
}
well_copy.scaleSegmentRatesWithWellRates(well_state_copy);