of the matrix internal allocators.
This fix also avoid the copying of the BCRSMatrix by providing a contructor that creates
the DuneMatrix for a given Eigen SparseMatrix.
Using a different construction method for the sparse matrix
used makes the methods a little faster. There is probably
still room for improvement by refactoring to avoid the
sparse matrix products.
New parameters are:
- cpr_use_amg (default false) if true, use AMG preconditioner for elliptic part
- cpr_use_bicgstab (default true) if true, use BiCGStab (else use CG) for elliptic part
The 'props_' table of PVT functions has one entry for each active
phase. Fix four instances of indexing into the table using the
canonical rather than active phase indices.
This is necessary, but not sufficient, to run two-phase problems
without a "dummy" third phase.
First the change in oil saturation is calculated from changes in water
and oil saturation. Then oil saturation is updated based on this change
instead of just fixed to 1-sw-sg. With this change the oil saturation is
less sensitive towards numerical errors that may cause very small oil
saturations. Witch again may cause the simulator to think that the gas
phase is saturation with vaporized oil when it is not.
Currently, there are two abstract interface for the grids. One that
usually returns pods and arrays of them that also can be used by C
and is used also in opm-core, and one that returns Eigen datastructures
needed within opm-autodiff.
This commit adds a postfix ToEigen to those functions (faceCells, and
cellCentroidsZ) one could imagine to also return pods and arrays of them.
This should at least resolve the confusion about the two faceCells functions.
The next step will be issue #192Fixes#176
Now it takes a std::vector instead of an Eigen::Array, more importantly
it expects one element per face, not interior face. The mapping now takes
place in setThresholdPressures().
This fixes the following bugs:
- No longer overwrite the matlab-output files each step.
- Create output also for the initial state.
- Change filenames of matlab-output by one (initial state is 000.txt,
final state is NNN.txt and not (NNN-1).txt for total of NNN steps).
- Eclipse binary output matches eclipse output (includes the same
steps including initial state) for the same case.
Also added several comments outlining the parts of the run() function.
Total time will be written to walltime.txt, and single step times to
step_timing.txt (changed suffix from param to txt). This did not work
properly before this fix (step_timing file was overwritten each step).
When this kw is active, BlackoilPropsAdFromDeck now modifies rvSat
and rsSat curves cell-wise by a power of (sat_oil_cell /
sat_oil_cell_historical_max). Currently, the associated jacobians do
not reflect terms of type d/d_sat_oil, but code for doing this is given
as comments to BlackoilPropsAdFromDeck::applyVap(ADB& r, ...).
This commit replaces an if-else-based query of the primaryVariable_
with the equivalent switch() statement for uniformity with the rest
of the implementation.
This commit introduces support for the RESV control mode of
prediction (WCONPROD) and history-matching (WCONHIST) alike. The
implementation uses class SurfaceToReservoirVoidage<> to compute
coefficients that convert component rates at surface conditions
(i.e., the primary degrees of freedom in the well residual) to phase
rates at reservoir condition. The resulting coefficients can be
entered directly into system matrix of the linearised residual.
Note: We abuse the "distr" mechanism of struct WellControls to store
the conversion coefficients. This may require refactorisation and
clarification at a later stage. In the meantime, it allows for
transparent assembly of well equations--irrespective of surface- or
reservoir (voidage) rates.
Note: We do not yet support injectors controlled by total reservoir
voidage rate--either in history-matching (WCONINJH) or
prediction-scenario capacity.
This commit changes the API of class SimulatorFullyImplicitBlackoil<>
in order to support wells controlled by (total) reservoir voidage
volume rates. Specifically, we switch to holding a mutable Wells
object (backed by a std::shared_ptr<>) in class Impl rather than a
reference to a WellsManager. This allows dynamically updating rate
distributions and targets of individual well controls. That, in
turn, is a prerequisite to supporting ECL-style "RESV" control
modes--be it in prediction or history matching capacity.
While in the process of API changes, also prepare for the second
stage of "WCONHIST/RESV" support: Accept a ScheduleConstPtr that
holds the input deck's notion of the history matching vs. prediction
controls. We need to distinguish the two in order to support the
exact semantics of "WCONHIST/RESV".
Update SimFIBO<> clients accordingly.
This was copy-pasted into the class at its inception (a94f1921) and
never used thereafter. If we need it we can bring it back in
modified form at a later stage.
This commit adds a simple facility for converting component rates at
surface conditions to voidage rates at reservoir conditions. It is
intentionally limited in scope and meant to be employed only in the
context of class FullyImplicitBlackoilSolver<> or something very
similar. In particular, class SurfaceToReservoirVoidage<> assumes
that it will be used to compute conversion coefficients for
component rates to voidage rates, and that those coefficients will
typically be entered into the coefficient matrix of a linearised
residual.
Add a trivial test just to demonstrate the setup and calling
process. This is not a feature or correctness test.
The solver (class FullyImplicitBlackoilSolver<>) gained the ability
to do control mode switching/updating in commit 4a22c56 at which
point using WellsManager::conditionsMet() ceased to be useful. This
is a preparatory step towards adding support for RESV-type control
modes.
If we need this type of behaviour in the Simulator*, we can bring it
back (in modified form) at a later time.
This is a relic of the way we originally handled gravity. The member
remained after the change, and is now a major time-consumption sink
due to the unfortunate fact that it is computed every time step
(unnecessary), and because the gravityOperator() function (now removed)
was very unperformant after changing to use the faceCells() function.
this means that the NTG, MULTPV and MULT[XYZ]-? keywords are now
supported.
Actually FAULTS and MULTFAULT are supported too, but that's abstracted
away by opm-parser's TransMult class. (Kudos to [at]joakim-hove for
implementing this.)
this is required to implement pore volume and permeability multipliers
as discussed with [at]bska and [at]joakim-hove.
Note that this implies that the DerivedGeology class can't be
instantiated anymore if there is no EclipseState object. Thus all code
paths and tests that don't load a deck are removed by this patch. If
this is undesireable, there are two options: First, don't require
EclipseState for DerivedGeology which would imply to make the about 10
required multiplier functions part of the
BlackoilPropertiesAdInterface, or second, one can copy-and-paste the
DerivedGeology class as it was before this patch, derive from a newly
introduced DerivedGeologyInterface and pass DerivedGeologyInterface
objects to the simulator. IMHO, the second solution would be a bit
better but it would involve substantial overhead to implement and to
maintain it.
Anyway, in the mean time simulators cannot be instantiated without
decks.
Commit 5112b8a misinterpreted the role of index 'i' and, as a result,
installed code that would only define one-sided gravity potentials of
the first cell (roughly)--albeit eventually using the geometry of the
last active cell.
This commit restores the original, intended behaviour.
Class FullyImplicitBlackoilSolver<Grid> already features a list of
"all" cells, built at object construction time. There's no need to
re-compute that list on every call to variableState() (when Gas is
active).
The "xvar" exists only if Gas is active. Therefore, we cannot
extract that variable from "vars" unless we know that Gas is an
active phase. Failing to do so would wrongfully increment 'nextvar'
whence the final BHP variable would be an out-of-bounds access.
Methods 'computeRelperm()' and 'computePressures()' *always* return
a three-element vector of phase properties. We must therefore
translate to canonical phase indices before indexing into the
results.
i.e. reading the grid properties from EclipseState instead of from the
raw deck. This requires that all deck files exhibit a GRID and a
SCHEDULE section or else EclipseState will throw in the constructor.