This commit adds the requisite backing storage and parser support
for capturing and transporting simulator-level calculation of phase
and mixture density value for purpose of summary file output. To
this end, make 'SegmentQuantity' into a template on a set of defined
items and make SegmentPhaseQuantity into a specialisation of this
template. Add a new specialisation, SegmentPhaseDensity, which
holds phase densities (oil, gas, water), and fluid mixture densities
with and without flowing fraction exponents.
These will be used to transport the values needed to output segment
level summary vectors
SDENx -- Phase density of phase 'x' (O, G, W)
SDENM -- Fluid mixture density without flowing fraction exponents
SMDEN -- Fluid mixture density with flowing fraction exponents
Mostly to aid future maintenance. While here, also re-indent the
other unit tables and add a type alias (UnitTable) to avoid spelling
out the 'unordered_map<>' type repeatedly.
In particular, add support for
SxFT - Cumulative flow of phase 'x'
SxFV - Free flow velocity of phase 'x'
SxHF - Free flow holdup fraction of phase 'x'
SxVIS - Phase viscosity of phase 'x'
The last three of these were added to the RFT file in 802a401a8,
but are also useful in the summary output file. In the interest of
avoiding duplicate logic, refactor the existing segment-related
quantity calculation/extraction in terms of callbacks.
```
Error: Unknown keyword: KEY6
Error: Unrecoverable errors while loading input: Problem with keyword
In <memory string> line 0
Unknown keyword: KEY6
```
does not tell the user where his/her error is.
This is now changed to
```
Error: Unknown keyword: KEY6
Error: Unrecoverable errors while loading input: Problem with keyword NE6
In /path/to/include/grid/file.inc line 7
Unknown keyword: KEY6
```
which gives the user a greater chance of finding out what is wrong.
For an include directive with a path with trailing whitespace, e.g.
```
INCLUDE
'/home/model/../include/file_trailing_ws.ext ' /
```
the current error message
```
Error: No such file: /home/model/../include/file_trailing_ws.ext
```
is changed to
```
File '/home/model/../include/file_trailing_ws.ext ' included via
INCLUDE directive does not exist. Note that the file name contains trailing whitespace.
```
This should at least make it easier to spot this error.
An alternative would be to trim the string, but people using quotes
should actually know what they are doing.
This commit implements the WPAVE keyword and its associate WBPn
well level report quantities. We support all valid settings of
WPAVE and WWPAVE. The various weighted averages are accumulated
through compensated summation of both the numerator and denominator
terms for the inner block, the direct/immediate level 1 neighbours,
and the diagonal level 2 neighbours. We combine those contributions
to the WBP, WBP4, WBP5, and WBP9 terms when we "commit" the
contributions (Accumulator::commitContributions()), per connection
for values weighted by the connection transmissibility factor, and
per well for values weighted by pore volumes.
We distinguish OPEN from ALL connections through callback functions
in the implementation of accumulateLocalContributions() and the per
connection weighting terms are provided as another set of callback
functions depending on the value of the inner block weighting factor
F1.
Depth correction (NONE, WELL, or RES) is affected through a separate
set of callback functions used in the implementation of
'connectionPressureOffset'.
We discover source locations in a two-step process. At WBPn
calculation construction time, we exclude only those cells that are
outside the model's dimensions. The user is then expected to call
member function pruneInactiveWBPCells(), typically at the
CalculatorCollection level, at a later time in order to prune
inactive cells. This two-step split is necessary because we do not
have a complete global view of the model's active cells in a
parallel run. It is very possible that the WBPn calculation on one
rank will require source values from another rank and that begets
this extra caution.
The user must call inferBlockAveragePressures() to compute the WBPn
values. Once completed, the result values may be extracted by
calling member function averagePressures(). We expect that the user
will provide a complete set of up-to-date source values when calling
this member function, both at the reservoir and the well connection
levels.
In particular, the inner block weighting factor F1 must not exceed
the value 1.0 and the CTF-vs-PV contribution weighting factor F2
must not be less than 0.0 or greater than 1.0.
Stop input parsing if either of these two conditions are violated.
The *_history() helper functions assumed that all wells would be
flowing. This is an incorrect assumption and would lead to, e.g.,
field-level observed rates being non-zero even if all wells were
stopped/shut.
This commit adds a check for non-flowing wells, and omits flow rate
contributions in that case.
Mostly for readability. While here, also switch to using compiled
item names instead of raw strings to access the DeckItems which
constitute the WPAVE and WWPAVE keywords.