Move the update of rs and rv after the phase transitions

The old rs and rv values are used in the phase transitions calculations.
The update of rs and rv to the state is therefore moved after the phase
transitions in order for the code to use the old values.
This commit is contained in:
Tor Harald Sandve 2014-11-05 12:35:32 +01:00
parent 16951bbd39
commit 662a2faf76

View File

@ -1420,12 +1420,6 @@ namespace {
rv = rv_old - drv_limited;
}
// Update the state
if (has_disgas_)
std::copy(&rs[0], &rs[0] + nc, state.gasoilratio().begin());
if (has_vapoil_)
std::copy(&rv[0], &rv[0] + nc, state.rv().begin());
// Sg is used as primal variable for water only cells.
const double epsilon = std::sqrt(std::numeric_limits<double>::epsilon());
@ -1479,6 +1473,14 @@ namespace {
}
// Update the state
if (has_disgas_) {
std::copy(&rs[0], &rs[0] + nc, state.gasoilratio().begin());
}
if (has_vapoil_) {
std::copy(&rv[0], &rv[0] + nc, state.rv().begin());
}
// Qs update.
// Since we need to update the wellrates, that are ordered by wells,