the class is called "PffGridVector", which is short for "PreFetch
Friendly Grid Vector" ("Vector" in the sense of std::vector). The idea
is to store the data in question for the complete stencil of all
elements which makes the memory access pattern of the simulation much
more localized. this approach has the downsides that much more memory
is required to represent the data (for cartesian 3D grids this means
about factor 8 more), and that data cannot easily be changed for an
individual degree of freedom (because it would require to change the
representations of all stencils which contain the DOF).
also, use this new class to store the transmissbility values of
ebos. it is pretty easy to extent the number of quantities stored this
way, but it seems like the performance of linearization stays flat or
is slightly worse if the PffGridVector is used for more quantities...
besides enabling support for the modifier keywords, this should also
be slightly faster (because no traversal of a binary is needed for
every element anymore.)
unfortunately, this is necessary because
boost::alignment::aligned_allocator requires a fairly recent version
of boost (i.e., 1.56) while the oldest platform supported by OPM
(i.e., Ubuntu 14.04LTS) only ships boost 1.54. Anyway, I'm wondering
why there is no std:: version of this class in c++-2011...
these occured with the AVX proof of concept: when a variable that is
used by an AVX instruction is not aligned at a 32-byte boundary, the
program receives a (very non-obvious) segfault. this patch gets around
this by using (the GCC specific?) aligned_alloc() function and the
aligned_allocator from boost for heap objects
It was disabled because Dune::CpGrid::loadBalance() dropped all cells
which were disconnected from the main part of the grid. since the
problem was fixed in https://github.com/OPM/opm-grid/pull/245, let's
re-enable load balancing.
this code currently has the same limitations as the one in
opm-simulators: these geologic events may only change the porosity of
some cells or the values of the transmissibility, i.e., changes to the
grid topology are not possible.
i.e., if a phase is not present in the upwind DOF, it should not be
considered. this handles things analogous to the opm-simulators
code. (which uses the residual saturation of the phase for the
decision, but fundamentally applies the same logic.)
i.e., it now uses the PORV grid property from opm-parser and does the
accumulation of the disabled cells manually. This patch should be
equivalent to the opm-simulators PR #806
( https://github.com/OPM/opm-simulators/pull/806 ).
grid.cellCenterDepth() is the average of the Z-coordinates of the
element vertices which, for distorted elements, is slightly different
from the depth of the centroid.
IMO this is conceptually a change for the worse, but ECL likes to do a
lot of things inconsistently, so let's budge.
transmissibilities of 10^-20 can occur in real decks. (i.e., Norne;
although the face which belongs to the transmissibility is tiny it
nonetheless affects convergence for some reason.)
now it is always updated at the beginning of an episode. the reason
why this works is that both features do not affect the value of the
residual for the initial solution but only its derivatives. (if
something affects the values of some quantities which are needed to
calculate some parameters, then the first update needs to happen right
after the initial solution is applied and *before* the parameter is
determined.)
10 is a bit too little: the first time step of SPE9_CP now needs 13
iterations to converge. (before the transmissibility change of the
previous commit it was 8 iterations IIRC.)
this may not be the nicest way to calculate transmissibilities
(because the coordinate of the cell center can be located outside of
the cell) but at least the results are the same as the ones obtained
by flow on Norne.
updating them at the end of each time step may make more sense from a
physical POV, but flow updates it only after each report step, so
let's do the same...
before, if the pressure gradient was zero the interior DOF was assumed
to be the upstream one. On the other side of the face it was done the
same which meant that the upstream cell was different depending on
which cell was looked at. This did not have any effect on the value of
the flux (because the pressure gradient was zero anyway), but when AD
was used this resulted in non-symmetric derivatives. In principle this
is okay because the point where the pressure difference between cells
is zero is a kink and thus the flux derivatives there are
undefined. In practice this made comparing with flow quite difficult,
so let's change it...
this is useful if wells shall be handled externally (e.g. most
prominently the upcoming flow wrapper which uses ebos to linearize the
mass balance equations).
disabling the well treatment can be done by setting the DisableWells
property to "true".
the reason why this is needed now probably is because
std::is_convertible<Scalar, Evaluation> is false. While strictly
speaking, scalars can be converted to Evaluations by assuming them to
be evaluations of the constant function, this patch is IMO beneficial
anyway because it makes such conversions more visible.