We have switched to WarnAndContinueOnError instead of ThrowOnError,
to reduce the annoyance factor when suffering from a minor error in
a long simulation run.
Specifically: Remove an unused header (stdio.h), replace <stdlib.h> by
its C++ counterpart (<cstlib>), and reference malloc() and free() from
the std:: namespace.
With columns containing an odd number of cells, middle cell would
get solved twice, and the second time with incorrect s0.
We still solve twice, but with correct s0.
- Using [0,1] interval instead of [smin, smax] interval to handle compressible case.
- Using new version of Regula Falsi function which exploits initial guess.
- TransportModelTwophase no longer takes pore volume in constructor, but in
the solve() and solveGravity() calls.
- Residual function uses compressibility term (not yet for gravity residual).
- spu_2p now takes a new parameter "init_p_bar", and ReservoirState class
accepts initial pressure as a constructor argument.
- Moved parts of initialization around, since pore volume now depends on
state (pressure).
The code attempts to improve #iterations in the Gauss-Seidel-like
multicell solver by improving ordering. In general, experiment failed
to improve #iterations, except for one: totally random order was the
best (for the 100x100 case tried)!
This is for the experimental change of the graph topology, putting the
connections in the graph sorted by flux magnitude. Currently the
changes are in the file, but commented out until further experiments
have been done.
- Added solveMultiCell() virtual method.
- TransportModelInterface::reorderAndTransport() now calls solveMultiCell()
instead of aborting if encountering multi-cell components.
- Implemented solveMultiCell() in TransportModelTwophase by solving
each cell individually with solveSingleCell() and repeating until
saturation change is small (hardcoded 1e-9 for now).
- Using new solve() method in spu_2p.
- solve() implemented in terms of protected superclass method reorderAndTransport().
- Removed unused code being replaced by solve().