OPM/opm-autodiff — pull request #108 by andlaus (2014-03-24 13:01:57+00:00)
Title: FullyImplicitBlackoilSolver: unify the state conversion routines

Note: I'm not really sure if constantState() or variableState() should be removed, but i'm sure as hell that one of them is superfluous! With this patch applied the residuals for the simulation get smaller for the initial residual of a timestep just like it is supposed to be. One thing which should probably discussed is what exactly the residual is supposed to express: As it stands now, it is "incorrect amount of conservation quantity per second for each cell". IMHO it would make more sense to switch the conserved quantity to a "per cubic meter" basis and also to use physically conserved quantities like mass instead of "surface volume of component" (which, of course, can be converted to mass by multiplication with a constant), since the current approach easily leads to setting wrong tolerances IMO. That is because surface volume of gas is a distinctly different than the surface volume of water or oil (i.e., about three orders of magnitude for the same amount of mass). Here's the patch's commit message:

The variableState() and constantState() were inconsistent, so we now
only have one method for the BlackoilState -> SolutionState
conversion.

this lead to a _really_ bad copy-and-pasto: Since these methods were
inconsistent, they lead to a difference in the accumulation term for
the first iteration of each time step. This in turn had two consequences:

1) If the time step size was decreased, the residual _increased_
because when using an implicit Euler time discretizationm, the
accumulation term is divided by the time step size which meant that
using smaller time steps lead to a larger residual which caused much
havoc...
2) the solution of a time step converged to a value which was
consistent with the one represented by constantState() instead of the
one expressed by variableState(). I guess the latter was the desired
one, because the method took more cases into account.

Anyway, constantState() is now gone and variableState() has been
renamed to blackoilToSolutionState()...