OPM/opm-autodiff — pull request #227 by totto82 (2014-11-06 13:52:25+00:00)
Title: Fixes in updateState

This PR address 3 things in updateState.

1) The update of rs and rv is moved after they are used in the phase-transition calculations.
2) The oil/gas is kept saturated (Sg is used as variable) for cases that hadGas/hadOil, respectively.
3) The same relative threshold is used for the drv update and drs.

Tested on SPE 1, SPE 3 and SPE 9.
For SPE 1 the total number of non-linear equations goes up with fix 1), but 1) is a bug and should be fixed anyway.

For SPE 3 the newly merged change in the data file is needed in order for the simulator to converge.

For SPE9, fix 2) is needed in order for it to converge. The hadGas/hadOil criteria is a copy from MRST, there the condition for hadOil is: hadOil = so < 0 and so_old>threshold. But as so earlier is fixed for negative value the first condition is never true. In earlier versions of OPM the conditions for hadOil was so < 0 and so_old > threshold, but this was changed to so <= 0, when so was hard-coded to be non-negative.

The results for all the SPEs matches in the eyeball norm. I have only looked at the well results.

The test for Norne is running right now. With two more fixes that address the partial copying and the crossflow the norne is currently running smoothly until 1152 days. I will add a comment on how far the Norne model runs when it is finished.