This commit introduces a new helper template class,
FlatTableWithCopy<RecordType>
which wraps a vector<RecordType>, provides constructors from
DeckKeyword and initializer_list<RecordType> and handles copying
tables for all-defaulted records.
We reimplement the PVTW, DENSITY, and GRAVITY tables in terms of
this helper class to reduce duplication. If the copy behaviour is
generally useful/needed we expect to replace the existing FlatTable
mechanism with the new helper.
Suggested by: Markus Blatt
The existing mechanism did not handle this case sufficiently well.
It is likely that we will have to polish this approach, but for now
use an explicit table copy to ensure that we have structurally
correct backing table data.
A simulation model may choose to give PVTW data as
PVTW
1.0 1.0 1.0e-5 0.2 0.0 /
/ -- record 2 (copied from record 1)
if, for instance, the oil and/or gas tables are different in regions
1 and 2, but the water is the same. In this case we must properly
copy record 1 into record 2 and essentially recreate the table.
To this end, decouple the 'PvtwTable' from the 'FlatTable' machinery
and make the former into an independent type containing vector<>
instead of inheriting from vector<>. Implement the default->copy
behaviour in the new PvtwTable::PvtwTable(const DeckKeyword&)
constructor.
The well list positions for individual wells (i.e,, IWLS) need not,
and typically are not, strictly increasing in the restart files.
Therefore we must only 'resize()' the well name vectors if the
'well_order' is strictly larger than the current size. Otherwise,
we lose information about which wells are in which well lists.
This commit adds support for the GEFF, WEFF, and WEFFG summary
vectors that report the efficiency factors at the well (WEFAC) and
group (GEFAC) levels. WEFFG additionally accounts for efficiency
factors in a well's superior groups in the group tree.
Faults are stored in an OrderedMap with the full string used during
construction even if that is longer than 8 characters. When later
these faults are e.g. modified whith MULTFLT using only the first 8
characters, the only message the user got was
```
An error occurred while creating the reservoir properties
Internal error: Key not found:
Unrecoverable errors while loading input: Key not found
```
With this patch we at least add some more context to the error
message:
```
Error:
An error occurred while creating the reservoir properties
Internal error: [/../EclipseState.cpp:362] Could not set fault transmissibility multiplier 5.23166e-10 for fault CFN2_05t: Key ABCD_05q not found. Similar entries are ABCD_05q_extended_width, UABCD_05q_extended_width.
```
Message now becomes:
```
Error: Problem with keyword MULTIREG
In /path/to/file.inc line 3
region operation on 3D field MULTZ with global storage is not implemented!
```
MULTZ is the only keyword that is stored in global representation
(i.e. with values for inactive cells, too) to allow the "PINCH ALL"
processing. This produced errors like:
```
Error:
An error occurred while creating the reservoir properties
Internal error: Region operations on 3D fields with global storage is
not implemented
```
With this change the error message has more information for the user
and might help to work around it:
```
Error:
An error occurred while creating the reservoir properties
Internal error: In file /path/to/file.inc line 3: MULTIREG region operation on 3D field MULTZ with global storage is not implemented!
```