This is used to compute the Euclidian product for the saturations.
Thes are ordered in an interleaved manner (all saturations for cell
with index 0, the all for index 1, ...). Up to now the implementation
assumed a different ordering: blockwise (all saturations for phase 0 first,
then all saturations phase 1, ...).
With this commit the computation uses the right assumption.
Using &stdwells.wells() throws an assertion for null pointers
without -DNDEBUG, but was used nevertheless. That prevented running
models without wells.
The wells pointer might be null and we need to access its number of
phases in the constructor to store it. With this commit we prevent that
storage and simply ask the well struct whenever we need the number of
phases. Of course the code using it needs to check that there are wells
but that is done in most parts of the opm-simulators currently
(MultiSegmentWells and Solvent are/might be an exception).
In that case we cannot call numPhases() on the wells as it produces
a floating point exception. As we do not use that information in this case
anyway, we simply use -1 instead to prevent the call.
This commit adds sequential solvers, including a simulator variant
using them (flow_sequential.cpp) with an integration test (running
SPE1, same as for fully implicit).
The sequential code is capable of running several (but not all) test
cases without tuning or special parameters, but reducing ds_max a bit
(from default 0.2 to say 0.1) helps with transport solver
convergence. The Norne model runs fine (esp. with a little tuning). A
parameter iterate_to_fully_implicit (defaults to false) is available,
when set the simulator will iterate with alternating pressure and
transport solves towards the fully implicit solution. Although that
takes a lot extra time it serves as a correctness check.
Performance is not competitive with fully implicit at this point:
essentially both the pressure and transport models inherit the fully
implicit model and do a lot of double (or triple) work. The point has
been to establish a proof of concept and baseline for further
experiments, without disturbing the base model too much (or at all, if
possible).
Changes to existing code has been minimized by merging most such
changes as smaller PRs already, the only remaining such change is to
NewtonIterationBlackoilInterleaved. Admittedly, that code (to solve
the pressure system with AMG) is not ideal because it duplicates
similar code in CPRPreconditioner.hpp and is not parallel. I propose
to address this later by refactoring the "solve elliptic system" code
from CPRPreconditioner into a separate class that can be used also
from here
The changes are:
- Make the WellOps struct public (needed by transport solver).
- Make it possible to store and retrieve total reservoir volume
perforation fluxes with getStoredWellPerforationFluxes(), controlled
by a flag set by setStoreWellPerforationFluxesFlag(), defaulting to
false (needed by pressure solver).