This commit makes the TRANNC INIT file output conditional on the vector
being non-empty. Previously we would alway output that vector even if
it did not contain any non-neighbouring connections.
This commit extends the previous support for writing scaled end-points
(and scaled function values) to outputting the sentinel value -1.0e+20
for those items (cell values) that have been defaulted in the input.
This operation does not apply if the simulation run specifies FILLEPS,
in which case we always output the actual scaled end-points, whether
taken from explicit assignment or derived from table values.
The overall approach is to pass an additional flag (needDflt) to
function writeDoubleCellProperties(), which then dispatches to two new
helper functions
writeCellPropertiesWithDefaultFlag()
writeCellPropertiesValuesOnly()
The former then expects a three-argument callable (lambda), the second
of which is the compressed version of the Property<T>::wasDefaulted()
value. This is then used to infer for which elements to output the
sentinel value. The ValuesOnly() property writer is the previous
version of writeDoubleCellProperties() and is mainly used to support the
FILLEPS operation.
This commit ensures that we set the correct end-point scaling flags in
LOGIHEAD (items 17..20, zero-based indices 16..19) according to the
run's requested end-point scaling behaviour. This in turn enables the
ResInsight postprocessor to distinguish between scaled and unscaled
saturation function curves in its "RelPerm" plot window.
Note that in order to set the correct flags and to not impact the
restart files, we've elected to copy the CreateLogiHead function here.
This incurs non-zero technical debt. We should seek to reunify the two
implementations to the extent possible.
This commit extracts the hard-coded list of end-point scaling vectors
out to a new helper class, ScalingVectors, and makes the specific list
dependent on the run's active phases. This means, in particular, that
we won't output water vectors unless water is an active phase and
similarly for gas and oil.
The added logic of active phases only was complicated enough to warrant
an encapsulating scope.
This commit introduces a new helper function,
writeSatFuncScaling()
that will extract scaled end-point arrays like SWL, SGCR, SOWCR,
KRORW, and PCG and output these to the INIT file. We support both
the drainage and imbibition keywords, but do not support the
directional versions of these keywords at this time.
Note that this first draft uses the keyword values directly from the
Eclipse3DProperties container. Therefore, the output behaves as if
the input deck always specifies the 'FILLEPS' option. Outputting
only the values that were specified in the input will be the subject
of future work.
This commit introduces a new helper function,
writeCellProperties()
that accepts a list of properties to output as well as a property
container (GridProperties<T>), an EclipseGrid and call-back write
function for individual properties. The helper invokes the callback
for each property that exists in the property container, passing it
the property description and the property values compressed to
active cells.
Reimplement function writeDoubleCellProperties() in terms of the new
helper.
This commit introduces a new helper function
void GridProperty<>::setElement(i, val, dflt)
that handles paired assignments to 'm_data' and 'm_defaulted'[%].
This simplifies the bookkeeping and implementation of the various
assignment and value operations.
While here, also add a unit test to demonstrate expected behaviour
of the m_defaulted flag. The only really questionable setting is
what happens if the deck applies a relative operator (e.g., ADD or
MULTIPLY) to a value that would otherwise be defaulted. In the
current implementation the m_defaulted flag will remain set in this
case, but it arguably should be switched to unset (false).
[%]: Suggested by [at]akva2
This commit adds a comment block to the new
setPostProcessor
member function, explaining the reasoning behind its excistence and
remarking on the fact that the ability to replace the post-processor
is essentially a hack. The hack suggests that we need to rethink
our handling of (3D) grid properties.
This commit calls the SOGCR post-processor hook if the simulation
run uses SGOF. In this case we need to subtract (scaled) connate
water saturations from defaulted SOGCR values.
This revealed a problem in one of the unit tests which used the
incorrect critical oil saturation due to a missing SGOF record.
This commit adds a new member function
Eclipse3DProperties::adjustSOGCRwithSWL
which mutates the SupportedKeywordInformation of the various *SOGCR*
keywords created by makeSupportedDoubleKeywords(). Specifically,
adjust*() installs new post-processors for the critical oil-in-gas
saturations--post-processors that subtract the (scaled) connate
water saturation from the defaulted SOGCR. This is only applicable
if the simulation run uses Family I (SWOF/SGOF) saturation function
keywords, because the SGOF table is implicitly defined in terms of
the connate water saturation.
This is a special purpose hook that is mainly intended to add a
post-processor after the keyword information is established only if
certain conditions are satisfied (e.g., if certain keyword relations
like the run using 'SGOF' tables hold).
Immediate use case is to install a post-processor for SOGCR to
subtract the scaled connate water saturation from defaulted SOGCR
values if the simulation run uses family I (SWOF/SGOF) saturation
function descriptions.
This commit alters the post-processor API to accept a vector<bool>
of defaulted flags (true if defaulted, false if explicitly
assigned). This, in turn, enables running the post-processor only
on defaulted (or assigned) property values.
Update existing post-processor implementation to honour the new
calling conventions.
This commit adds a new data member (GridProperty<T>::m_defaulted)
that keeps track of whether or not a particular data item has been
implicitly assigned from the input deck. GridProperty::setDataItem
assigns 'false', while the constructor initialises 'm_defaulted' to
true for all Cartesian cells.
The main objective is to be able to apply a post processor only to
those cells for which the input deck does not supply an explicit
value.