Commit Graph

57 Commits

Author SHA1 Message Date
Andreas Lauser
3b86bfd474 remove dangling file opm/parser/eclipse/Utility/tests/TableTests.cpp
somehow this fell through the cracks when doing the big tables overhaul.
2014-10-13 18:41:52 +02:00
Andreas Lauser
7ad309d3b3 move the table classes from .../Utility to .../EclipseState/Tables 2014-09-19 15:12:21 +02:00
Andreas Lauser
a057280492 tables: remove trailing underscores from the protected and private methods
opm-parser does not follow this convention...
2014-09-19 14:33:35 +02:00
Andreas Lauser
f6b2797e23 tables: make them instantiable exclusively by EclipseState
since tables can be tricky, we now enforce that the compiler bails out
if the user tries to instantiate a table class manually.

Note that a bit of trickery is needed to keep the low-level unit
tests working...
2014-09-19 14:33:35 +02:00
Andreas Lauser
e994d7314e endpoint scaling tables: make the bare-metal getColumn(index) method public
it is _strongly_ encuraged to use the properly named methods to access
the respective columns, but opm-core's current endpoint scaling code
makes it hard to use these...
2014-09-19 12:24:54 +02:00
Andreas Lauser
59d35de3af add table classes for RSVD and RVVD
these keywords are used by opm-core, albeit currently in a
"bare-metal" way.
2014-09-19 12:24:54 +02:00
Andreas Lauser
f544c926df tables: propertly handle defaults and monotonicity of columns
for some kinds of tables this means linear interpolation for some
columns, constant for other columns and some tables do not allow to
specify default. Since there is no clear rule, this patch involved
checking the reference manual for every single f****** table keyword
plus some guess-work if the reference manual is unclear about
monotonicity and/or defaults.
2014-09-19 12:07:06 +02:00
Andreas Lauser
fd6209a34d make it possible to evaluate some tables using linear interpolation
... and constant interpolation at the fringes. this kind of evaluation
in between sampling point only makes sense for tables where the first
column is strictly monotonic, though.
2014-09-19 12:07:06 +02:00
Andreas Lauser
1bbe775831 make all table classes default constructible
this allows to store them in std::vectors, but requires to call the
init() method after construction...
2014-09-19 12:07:06 +02:00
Andreas Lauser
0055703aef remove PvcdoTable
because PVCDO is not a table keyword.
2014-09-19 12:07:06 +02:00
Andreas Lauser
0d423b83f4 remove the PvtwTable
because PVTW is not a table keyword...
2014-09-19 12:07:06 +02:00
Andreas Lauser
f440f34788 remove RockTable
because ROCK is not a table keyword
2014-09-19 12:07:06 +02:00
Andreas Lauser
c5f78788e0 add the IMPTVD and IMKRVD keywords and table classes
basically they are just renamed copies of the EN* variants...
2014-09-19 12:07:05 +02:00
Andreas Lauser
b72df6f406 make ParserItems always defaultable
i.e. remove the defaultSet() method and its friends. this is required
to be able to specify defaults in DATA items like grid properties or
saturation tables. e.g.

SGL
10*0.1 10* 10*0.2 /

would not be possible without this. If no meaningful default for an
item is defined, float and double items get NaN, int items get -1 and
string ones get an empty string. The hope is that if these values get
used in the simulation, they will make the result obviously
incorrect. (Whether a data point of an item was defaulted can be
queried using item->defaultApplied(index).)
2014-09-15 12:17:03 +02:00
Andreas Lauser
e6fa1e01a8 DeckItem: add indices to the methods which allow to query the defaulted status
also, this renames DeckItem::setInDeck() to DeckItem::wasSetInDeck()
because the former method can easily be confused with a setter method
(which it is not, it is a 'getter').

note that there is a small semantical difference now: the old
signatures specified the status of the whole *item* while the new
variants are specific for a single *data point* of an item. Though at
this point the index passed to the methods is still disregarded..
2014-09-15 12:17:03 +02:00
Joakim Hove
61cdf7d402 Default: defaultApplied -> setInDeck()
The data values in a deck item can be in three different states, given
by the DeckValue enum in DeckItem.hpp. The three values are:

  SET_IN_DECK : The value has been set explictly in the deck.
  DEFAULT     : The value was not present in the input deck, but a default
                value has been supplied in the configuration and that value
                has been set.
  NOT_SET     : No value has been set for this item; it was not explicitly
                set in the deck and also not included in the configuration.

If you ask for DeckItem->value which is in state NOT_SET you will get an
exception. The method setInDeck() can be used to check if a value has
been set explicitly in the deck; the method defaultApplied() will check
if a default value has been applied.

Observe that the system for handling defaults is not really well suited
for multi valued data items, as it is only a scalar state variable. In
the case of multi valued data items both defaultApplied() and
setInDeck() might return true.
2014-09-03 10:37:01 +02:00
Andreas Lauser
ad1dfab8d7 fix spurious GCC warnings
The root cause are pretty (too?) strict flags w.r.t. compiler
warnings. In this case, the offenders are "-Wmissing-declarations" and
"-Wtype-limits".
2014-06-02 13:01:56 +02:00
Arne Morten Kvarving
eef7b53fdd fixed: don't check for unsigned values being positive
they definitely are. quells warnings
2014-05-15 14:46:16 +02:00
Andreas Lauser
1909e22f48 fix the "number of table" calculation for multi-record tables
It turns out that the empty-record detection worked fine, but that the
last empty record of a keyword is ignored by opm-parser for reasons
which are not clear to me...

Now all unit tests pass.
2014-04-28 21:12:38 +02:00
Andreas Lauser
808e2d3717 rename SimpleTable to SingleRecordTable and SimpleMultiRecordTable to MultiRecordTable
because what's simple is in the eye of the beholder...
2014-04-28 18:29:44 +02:00
Andreas Lauser
de38673ce4 table tests: expand them considerably and actually run them
In the current version, the runTimeMapTest binary was run because of a
copy-and-pasto. oops.

Also, not all of the tests pass but that is because of another problem
of opm-parser for which I don't know a good fix: It currently seems to
be impossible to specify empty records if there are non-defaulted
items in the JSON keyword specification, but such empty records are
used as table separators by Eclipse...
2014-04-28 18:16:23 +02:00
Andreas Lauser
0713a3a767 add some comments to the capillary pressure retrival methods of S{g,w}ofTable
that's because the Eclipse capillary pressure definitions
inconsistent: SWOF specifies the "water-oil capillary pressure" as $p_o
- p_w$, while SGOF uses $p_g - p_o$ as the "oil-gas capillary pressure".
2014-04-28 17:05:31 +02:00
Andreas Lauser
4b2ab72eef add numTables() method to the table classes
For SimpleTable, that is simply the number of records in a keyword, for
MultiRecordTables, it is the number of _empty_ records.

this patch makes supporting multi-PVT easier and cleaner.
2014-04-28 17:05:31 +02:00
Andreas Lauser
406f294026 add table utility classes for the PLY{ADS,MAX,ROCK,VISC} and TLMIXPAR keywords
these are not really used as tables in the current opm-polymer code,
but the Eclipse RM says they are tables, so we should add these
classes...
2014-04-14 16:18:37 +02:00
Joakim Hove
6a1b887323 Merge pull request #178 from joakim-hove/data-with-default
Data with default
2014-04-11 13:45:02 +02:00
Joakim Hove
f59fd25668 Added boolan flag scalar = true to DeckItem.
The purpose of this flag is to keep track of whether a keyword is
supposed to have only one element, i.e. scalar, or several. The
defaultApplied method only makes sense in the case of scalar items, this
method will now throw if it is called on a non-scalar item.
2014-04-11 13:42:22 +02:00
Andreas Lauser
7eb19083ea add PVCDO keyword and fix typo pvdco -> pvcdo
this is used in opm-core but I doubt that these code paths have
actually been tested recently because the parser would have thrown up
as soon as it had encountered PVCDO...
2014-04-11 11:57:32 +02:00
Atgeirr Flø Rasmussen
3ab6a5388c Suppress unused argument warnings. 2014-03-03 11:06:44 +01:00
Andreas Lauser
b43859a2ad use raw values for context dependent rates in the wrapper of WCONINJE 2014-02-27 13:35:51 +01:00
Andreas Lauser
c972e6c0c1 GconinjeWrapper: return raw instead of SI rates
the wrapper could be a bit more sophisticated and do the conversion
internally, but the new wells management code seems to ignore the
wrapper anyway, so there is no real point in investing time into that
(yet).
2014-02-13 14:23:56 +01:00
Joakim Hove
e4c60e6aa1 Merge pull request #112 from andlaus/another_typo
fix another missibility typo
2014-02-06 22:25:51 +01:00
Joakim Hove
1447a8b05e Merge pull request #115 from andlaus/add_endpoint_scaling_stuff
add keywords used by the opm-core endpoint scaling code
2014-02-06 21:13:05 +01:00
Andreas Lauser
c41be6c91a add keywords used by the opm-core endpoint scaling code
plus some wrappers/tables
2014-02-06 18:44:10 +01:00
Kristian Flikka
15682a71df Merge pull request #114 from joakim-hove/valgrind
Valgrind
2014-02-06 16:39:30 +01:00
Andreas Lauser
3a73a2c2b5 fix another missibility typo
this one was not fixed in @bska's PR because my branch for ROCKTAB was
not merged back then. /me is confused by too many things going on at
once...
2014-02-06 00:21:01 +01:00
Joakim Hove
c38e079a6d Merge pull request #111 from andlaus/better_rocktab
add a utility class for the ROCKTAB keyword
2014-02-05 15:47:42 +01:00
Andreas Lauser
d5bedde8a7 add a utility class to handle ROCK tables
So far, this only considers Eclipse R100...
2014-02-05 15:20:56 +01:00
Andreas Lauser
6eab8d62b1 add a utility class for the ROCKTAB keyword
this one is a bit more complicated than a plain SimpleTable as the
number of columns depends on the deck. (to be precise, it depends on
the presence of the RKTRMDIR keyword which is also added in this
patch.)
2014-02-05 15:04:04 +01:00
Bård Skaflestad
9bfd5b92d7 Fix spelling.
The connection "strength" (conduction factor) is called
"transmissibility" (double 's'), not "transmiscibility" ('sc').
2014-02-05 13:39:28 +01:00
Arne Morten Kvarving
4a9c18ac9f run tests through valgrind 2014-01-27 15:16:34 +01:00
Joakim Hove
581bf74e9a Changed int -> size_t many places. 2014-01-24 09:41:32 +01:00
Joakim Hove
4b35f79a35 Changed integer type int -> size_t throughout. 2014-01-17 08:13:08 +01:00
Andreas Lauser
9332f0edd1 PVTO: Add unit test and make the function names of the table class consistent with PVTG 2014-01-16 15:22:33 +01:00
Andreas Lauser
1c39df2d57 improve unit test for PVTG
now the data is parsed from a string specified in the source file
instead of a separate file, the PvtgTable utility class is tested and
the order of the fields in the JSON definition of PVTG is the same as
for that of PVTO.
2014-01-16 13:23:13 +01:00
Andreas Lauser
27efd0d1fa implement multi-region full tables
detecting empty records is still pretty hacky: When calculating the
number of flat items, we stop at the first item for which the default
was applied.

Also, this patch corrects the names of the columes used by the PVTG
keyword. (the first column is pressure, then comes Rv.)
2014-01-16 13:12:40 +01:00
Andreas Lauser
8d2ea3e0cd add wrapper classes for more eclipse keywords
these are convenient to convert everything required to rip out the old
parser of sim_fibo_ad. the concrete keywords are:

 - COMPDAT
 - EQUIL
 - GCONINJE
 - GCONPROD
 - GRUPTREE
 - WCONINJE
 - WCONINJ
 - WCONPROD
 - WELOPEN
 - WELSPECS
 - WGRUPCON

in the medium term it would be nice if these wrapper classes could be
automatically generated from the JSON keyword descriptions.
2014-01-15 15:44:38 +01:00
Andreas Lauser
93523a9a54 add wrapper class for "WCONINJ" 2014-01-15 15:44:38 +01:00
Andreas Lauser
f38e09f450 add a wrapper class for the "SPECGRID" keyword 2014-01-15 15:44:38 +01:00
Andreas Lauser
032916c1bd fix more of the annoying sign comparison warnings
hopefully all of them.
2014-01-15 12:52:12 +01:00
Andreas Lauser
0ed659de10 add a wrapper for records of the WELSPECS keyword 2014-01-15 12:52:12 +01:00