once again it was broken by a change in opm-parser for which the
original authors not care to fix the mess they caused in ewoms. this
time the culprit was OPM/opm-parser#677.
this is required because that property is "drive-by created" when
initializing the grid and the code in opm-autodiff ignores it. (and is
slightly inconsistent with what opm-parser does...)
only if hysteresis is enabled. This is necessary because after the
hysteresis update the same primary variables will result in a (usually
only slightly) different thermodynamic state than before the update.
the stencil can now be updated only for the primary degrees of freedom
and output modules can specify that they do not need extensive
quantities (which allows to speed up the writing code if none require
them.)
Also, all loops over the grid are now threaded (or rather, are
supposed to be), so openMP should be better utilized during the
linearization stage.
i.e., there is now a base class for the EclGridManagers and one class
for each type of grid (Dune::ALUGrid, Dune::PolyhedralGrid and
Dune::CpGrid). Selecting the concrete grid type is now done by
deriving the EclProblem's type tag from the type tag of the respective
grid manager.
for large problems with many wells the performance impact of this is
probably even measureable.
Also, this patch makes it possible to access the well manager outside
of the problem. In the normal case, this should be rarely needed, but
it can come in handy for debugging purposes.
the EQUIL init code from opm-core chokes hard if any Dune grid other
than Dune::CpGrid is passed to it. Until opm-core gets its act
together or EQUIL init is properly implemented within eWoms, let's
just disable EQUIL initialization in ebos (and print a warning) if
ALUGrid is used.
before, it could have been written multiple times if the first time
step of the simulation failed and the timestep was repeated with a
smaller step size.
obviously if the switching variable is interpreted as x_g^O, the gas
phase is present, because in this case it is the only phase. Also,
when the oil phase appears, the gas saturation is 1-Sw, not 1. (the
last issue only happened in the vaporized case because the switch
variable would never get the meaning of "oil component's mole fraction
in the gas phase".)
the mistake was that I assumed that this was specified by the ROCKTAB
keyword; It is not! (It's specified via PVTNUM or SATNUM depending on
the value of the third item of the ROCKOPTS keyword. for now, let's
only use the PVTNUM.)
the missing piece was determining if the wells have changed between
report steps. This patch adds a simple way to determine this, but it
relies on low-level properties of opm-parser it does not
guarantee. (concretely, these details are that the same well objects
are returned in the same order if nothing changes. Since IMO this is a
pretty reasonable assumption, we use this approach instead of a more
complicated one until opm-parser provides a "change determination API"
for wells...)
note that this patch may increase the number of iterations required
for the simulation because the linear system of equations which is
solved in the first iteration of a time step actually corresponds to
the second to last solution of the previous time step. This means that
that linearization recycling usually only works well if the tolerance
of the Newton-Raphson solver is "sufficiently" low. ("sufficiently"
means that the linearization errors made due to using the "wrong"
solution for the first iteration can be neglected compared to the
differences because of the change of the solution in this iteration.)
therefore, use this feature at your own risk...
it often causes quite substantial headaches but does unfortunately not
normally lead to a substantial speedup. (at least not in its current
incarnation.)
in particular, the ECL schedule is now used to determine the episode
length on restart. this code is still quite shaky IMO, although it
seems to work for now.