This commit ensures that we don't issue misleading warning about
output creation directives such as
BASIC
FREQ
RESTART
that could be, and typically are, put into keywords like RPTRST and
RPTSCHED. Previously, we would interpret these directives as names
of cell vectors and we would get very confusing diagnostic messages
of the form
Keyword 'BASIC' is unhandled for output to file
which suggests that 'BASIC' is unsupported despite the output system
supporting the directive for quite some time. While here, also
apply the same reasoning to the vectors we always output such as
SWAT, SGAS, or PRESSURE.
This commit makes the 'groupData()' function return a
map<string, Opm::data::GroupData>
object instead of a
map<string, Opm::data::GroupConstraints>
object. The 'GroupData' structure adds a level of indirection to
the current per-group summary quantities that are directly assigned
by the simulator. While here, also move the assignment of the
current group constraints/control values out to a separate helper
to reduce the body of the per-group loop in 'groupData()'.
This is in preparation of adding support for reporting group-level
production/injection guiderates (Gx[IP]GR) to the summary file.
That way we can use the same code for both the 'writeOutput' and
the 'evalSummaryState' member functions. While here, also change
the declared types of 'wellData' and 'groupData' to 'auto' in
preparation of API updates for collecting group- and well level
guiderate data.
Finally, apply 'const' where possible.
Up to now We always assumed that cardDims[i]>1 holds. which it does for most
of the cases. But when e.g. simulating a vertical stack of 5 cells
flow would report the transmissibilities in the Z direction in TRANX
and output TRANZ as zero. Similar problems should be there for 2D grids.
With this commit we actually check whether there can be neighbours in
the X and Z direction to prevent this behavior.
Without this, rank 0 gets an empty case name, resulting in
buggy VTK output with filenames containing the genereric stem
"sim" rather than the case name as stem.
`NEW_PROP_TAG` is now a definition and not just a declaration.
Eliminate superfluous declarations, include headers with definitions.
Make one necessary forward declaration explicit.
This commit adds a very early, alpha-quality implementation of the
"horizontal subdivision" strategy (N < 0) of the EQUIL directive.
This in turn enables more accurate derivations of the initial fluids
in place.
Interactions with SWATINIT are completely untested, and the initial
Rs/Rv derivations in this context are possibly incomplete. More
work is likely needed in this area, but this does at least enable
more widespread testing.
The purpose of this function is to determine the vertical extent of
a set of cells. Counting the number of cells in the region is not
its responsibility.
This commit splits out the per-cell initial state derivation to two
separate helper functions, equilibrateCellCentres() and cellLoop().
The latter manages the per-cell assignments to pertinent data
members and calls an arbitrary "equilbration method" that is
provided as a callback and which calculates per-cell phase
pressures, phase saturations and mixing ratios (Rs/Rv).
In turn, the equilibrateCellCentres() uses the cellLoop() to affect
the existing equilibration procedure within a cell using values at
the depths of the cell centres only.
This commit introduces a new helper class,
Opm::EQUIL::Details::PhaseSaturations<>
that subsumes the responsibility of the existing helper function
Opm::EQUIL::phaseSaturations<>()
and generalises that functionality to arbitrary depth points within
single cells. This is in preparation of adding support for the N<0
case of the initial fluid in place procedure defined in the EQUIL
keyword. The class consumes an already equlibrated pressure table
for the pertinent equilibration region, calculates capillary
pressure values and inverts Pc curves to derive saturation values.
If the capillary pressure curves are constant within a cell, then a
simple depth consideration with respect to the implied sharp phase
interface is used to derive saturation values. We also preserve
existing support for SWATINIT-type initialisation of the water
saturation field.
Switch InitialStateComputer<>::calcPressSatRsRv() over to using the
pressure and saturation helper classes instead of the original
helper functions since this provides additional control. Also
remove those helper functions to reduce risk of confusion over which
method to use. Update the unit tests accordingly.
This commit is the first step of several that implements ECLIPSE's
"accurate fluid-in-place" model initialization procedure based on
subdividing the vertical range/extent of individual cells. This
first step puts the O/G/W phase-pressure calculation into a helper
class,
Opm::EQUIL::Details::PressureTable<>
through which phase pressure values can be calculated at abritrary
depths rather than just at the cell centre depths. In other words,
this helper class extends and subsumes the responsibilities of the
existing helper functions
Opm::EQUIL::Details::PhasePressure::assign()
Opm::EQUIL::Details::PhasePressure::oil()
Opm::EQUIL::Details::PhasePressure::gas()
Opm::EQUIL::Details::PhasePressure::water()
We still use the same ODE-based evaluation procedure for the phase
pressures and the equilibrateOWG() helper function still computes
the phase pressure values at cell centre depths only.
That, in turn, corresponds to the "N = 0" case (steady state) of the
basic equilibration facility.
Since unique_ptr<T, Deleter> takes two arguments it cannot strictly
speaking be used via a template template parameter that takes one,
even though the second has a default. GCC allows this anyway, but
not clang.
this was actually broken by an upstream change from return-by-reference
to return-by-value, but we were lucky, the return value was
kept in memory until end of block it seems.
now the serializer is 'standard', as in we only require basic types
+ stl containers. this should make the actual implementation pretty
pluggable. will ease replacing our serialization routines
with those in Dune 2.7 later.
this shall be used by users when they have a vector of types
with a serializeOp template. it cannot (at least not right now)
be part of the regular operator() as some vectors should go
directly to the underlying serializer (trivial types).
we can possibly find some traits magic for this later.
The InitialStateComputer::temperature_ array, previously used,
was of cartesian size, but used as if it only contained the
values of the cells of a region.
With this commit InitialStateComputer::temperature_ is a compressed local
array and we explicitly copy out only the region values when computing
RS/RV.
Closes#2423.
There are field properties that can usually be queried even if they
are not explicitly specified in the input
file (e.g. PVTNUM). Unfortunately, the ParallelEclipseState cannot
forsee which of these will be queried at startup and after the
loadbalancing only the master process is able to auto creates
these (easily). Hence this commit uses a fall-back if an unstored
keyword is queried. In this case we use get_global-* to auto create
the keyword and use functions of the cartesian mapper to extract the
relevant values on the process.
Of course this temporarily wastes space and we might want to resort to
a more memory savy approach later.
With the arrival of compressed field properties there is no need
to extract the global arrays just to compress them manually
afterwards. This change should remove commununication and
synchronization points.
There is not reason to it as a vector of cartesian size as we access
its entries by the compressed element index. This should save space
and speedup the lookup.
They are attached to the cells as well and are now distributed
during CpGrid::loadBalance. Due to this change we also rename
FieldPropsDataHandle to PropsCentroidsDataHandle.
The created data handle for the communication could in theory be used
with other DUNE grids, too. In reality we will need to merge with the
handle that ALUGrid already uses to communicate the cartesian indices.
This PR gets rid of using the get_global_(double|int) method in
ParallelEclipseState and reduces the amount of boilerplate code there.