Commit Graph

5450 Commits

Author SHA1 Message Date
Joakim Hove
dbff25f79b Remove m_ prefix from local variables 2019-04-11 14:03:08 +02:00
Joakim Hove
4b657fc4cf Use reference instead of value 2019-04-11 14:03:08 +02:00
Joakim Hove
a4e66a5484 White space change 2019-04-11 14:03:08 +02:00
Joakim Hove
226bfbe524
Merge pull request #718 from joakim-hove/weltarg
Weltarg
2019-04-11 12:14:23 +02:00
Joakim Hove
164ab30fa1 The WELTARG treatment is moved out from Schedule.cpp 2019-04-11 12:13:43 +02:00
Joakim Hove
d5ce2b6a76
Merge pull request #713 from joakim-hove/cjson-update
Update cJSON library to version 1.7.10
2019-04-10 09:19:36 +02:00
Joakim Hove
2997338eb2
Merge pull request #712 from joakim-hove/udq-tokens
Internalize UDQ tokens in the UDQ define keyword
2019-04-09 18:29:27 +02:00
Joakim Hove
ebedc9b0b6
Merge pull request #711 from joakim-hove/prod-properties-refactor
Refactor WellProductionProperties construction
2019-04-09 18:27:04 +02:00
Joakim Hove
ac58d8428c Refactor WellProductionProperties construction
Use default copy constructor and handleWCONPROD() and handleWCONHIST() for
prediction and history wells respectively.
2019-04-09 17:25:00 +02:00
Joakim Hove
ba58cbc166 Update cJSON library to version 1.7.10 2019-04-09 00:34:49 +02:00
Joakim Hove
bd0c0f6356 Internalize UDQ tokens in the UDQ define keyword 2019-04-08 15:12:15 +02:00
Joakim Hove
de9a93377c
Merge pull request #710 from andlaus/implement_FILEUNIT
Implement FILEUNIT
2019-04-05 12:07:19 +02:00
Atgeirr Flø Rasmussen
55057540e2
Merge pull request #709 from bska/restart_msw_fix
RSEG: Index Results by Segment Number
2019-04-05 10:49:20 +02:00
Andreas Lauser
fe1272a2e6 add the FILEUNIT keyword
currently, this keyword is basically ignored: setting the unit system
of a file to something different than the deck unit system will cause
`Opm::checkDeck()` to produce a warning.
2019-04-04 16:55:19 +02:00
Andreas Lauser
c25275d0ee add parseContext and errorGuard parameters to Opm::checkDeck()
this requires a small downstream cleanup.
2019-04-04 16:55:19 +02:00
Bård Skaflestad
ffba48d7f2 RSEG: Index Results by Segment Number
This commit switches the segment result reload code to indexing the
RSEG vector primarily by the segment number from the input file.
The original scheme of using the linear index and extracting the
segment number from ISEG was based on a terrible misunderstanding [%].

This is the second half of commit 0a730d94 (PR #697)

[%] Pointy Hat: @bska
2019-04-04 15:26:15 +02:00
Joakim Hove
dbfad81253
Merge pull request #700 from bska/print-pvtfunc-to-init-pt1
Structurally Correct PVT Tables in INIT File (Part 1)
2019-04-04 15:11:20 +02:00
Joakim Hove
a0aafc5d5b
Merge pull request #672 from jalvestad/restart_conn_test
Unit tests for writing well connection data to Eclipse Compatible restart file
2019-04-04 15:06:00 +02:00
Andreas Lauser
9afaa32ca7 checkDeck(): only require a const reference to the deck 2019-04-04 14:17:30 +02:00
Bård Skaflestad
68a254ffdc Create Prop-Func Table: Elucidate Motives for Unusual Loop Counters
Thanks to my colleague Francesca Watson for wording assistance.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
4dafe9456a Create Prop-Func Table: Switch to std::function
This commit switches to using the explicit type std::function rather
than an implied callable entity whose interface is defined only in a
comment.  That adds compiler type checking at the cost of (possibly)
introducing virtual function calls.  The size overhead in the object
file is mostly negligible in Release mode.

Suggested by: [at]joakim-hove
2019-04-04 14:11:07 +02:00
Bård Skaflestad
8e49c35c18 Create Prop-Func Table: Prune Vacuous Assignment
Left over from when the function was extracted from the saturation
function code.  While here, fix an incorrect comment that mistakenly
implied that the primary key of PVTO is pressure rather than the
dissolved gas/oil ratio (Rs), and correct a type in 'composition'.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
25d7b538aa Tables: Add Structurally Correct Gas PVT Output from PVTG
This commit expands the private member function

    Tables::addGasPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVTG
(wet gas) input table data when gas is an active phase in a
simulation run.  Specifically, the main result array has the columns

    [ Rv, 1/Bg, 1/(Bg*mu_g), d(1/Bg)/dRv, d(1/(Bg*mu_g))/dRv ]

and the ancillary table (base pointer JBPVTG) holds the gas pressure
nodes.

Note that while we do create structurally correct output tables, we
do not fill in undersaturated states that have been defaulted in the
input table.

The number of table rows in the main table is equal to number of PVT
regions times the number of declared pressure nodes (TABDIMS item 4,
NPPVT) times the number of declared composition nodes (TABDIMS item
6, NRPVT).  In other words, the main result array is expanded to
fill NRPVT rows per gas pressure node per PVT region.  Fill value
-2.0e+20.  We have verified the results with ECLIPSE 100.  The
ancillary table is expanded to the number of declared pressure nodes
for each PVT region.  Here the fill value is +2.0e+20.

As an OPM extension, we will use the maximum number of active
composition and pressure nodes across all PVTG tables if the
declared maximum pressure nodes in TABDIMS is too small.  This will
create TAB vector representations that are not compatible with
ECLIPSE, but which will nevertheless be useful in the context of
ResInsight's flux calculation.

Add unit tests for all gas-related PVT tables.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
877ff028be Tables: Add Structurally Correct Gas PVT Output from PVDG
This commit expands the public member function

    Tables::addPVTTables(const EclipseState&)

to call into a new private member function

    Tables::addGasPVTTables(const EclipseState&)

which will create structurally correct TAB vector entries from the
PVDG (dry gas) input table data when gas is an active phase in a
simulation run.  Specifically, the result array has the columns

    [ Pg, 1/Bg, 1/(Bg*mu_g), d(1/Bg)/dPg, d(1/(Bg*mu_g))/dPg ]

The number of table rows is equal to number of PVT regions times the
number of pressure nodes declared in input keyword TABDIMS (NPPVT,
Item 4).  In other words, the result array is expanded to fill NPPVT
rows per PVT region.  Fill value +2.0e+20.  We have verified the
results with ECLIPSE 100.

As an OPM extension, we will use the maximum number of active
pressure nodes across all PVDG tables if the declared maximum
pressure nodes in TABDIMS is too small.  This will create a TAB
vector that is not compatible with ECLIPSE, but which will
nevertheless be useful in the context of ResInsight's flux
calculation.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
c5eca4b1e4 Tables: Add Structurally Correct Oil PVT Output from PVTO
This commit expands the private member function

    Tables::addOilPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVTO
(live oil) input table data when oil is an active phase in a
simulation run.  Specifically, the main result array has the columns

    [ Po, 1/Bo, 1/(Bo*mu_o), d(1/Bo)/dPo, d(1/(Bo*mu_o))/dPo ]

and the ancillary table (base pointer JBPVTO) holds the composition
nodes.

Note that while we do create structurally correct output tables, we
do not fill in undersaturated states that have been defaulted in the
input table.

The number of table rows in the main table is equal to number of PVT
regions times the number of declared composition nodes (TABDIMS item
6, NRPVT) times the number of declared pressure nodes (TABDIMS item
4, NPPVT).  In other words, the main result array is expanded to
fill NPPVT rows per Rs node per PVT region.  Fill value +2.0e+20.
We have verified the results with ECLIPSE 100.  The ancillary table
is expanded to number of declared composition nodes for each PVT
region.  Fill value +2.0e+20.

As an OPM extension, we will use the maximum number of active
pressure and composition nodes across all PVTO tables if the
declared maximum pressure nodes in TABDIMS is too small.  This will
create a TAB vector representations that are not compatible with
ECLIPSE, but which will nevertheless be useful in the context of
ResInsight's flux calculation.

Add unit tests for all supported oil-related PVT tables.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
b4915e7b55 Tables: Add Structurally Correct Oil PVT Output from PVDO
This commit expands the private member function

    Tables::addOilPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVDO
(dead oil) input table data when oil is an active phase in a
simulation run.  Specifically, the result array has the columns

    [ Po, 1/Bo, 1/(Bo*mu_o), d(1/Bo)/dPo, d(1/(Bo*mu_o))/dPo ]

The number of table rows is equal to number of PVT regions times the
number of pressure nodes declared in input keyword TABDIMS (NPPVT,
Item 4).  In other words, the result array is expanded to fill NPPVT
rows per PVT region.  Fill value +2.0e+20.  We have verified the
results with ECLIPSE 100.

As an OPM extension, we will use the maximum number of active
pressure nodes across all PVDO tables if the declared maximum
pressure nodes in TABDIMS is too small.  This will create a TAB
vector that is not compatible with ECLIPSE, but which will
nevertheless be useful in the context of ResInsight's flux
calculation.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
b2a37d1e54 Tables: Add Structurally Correct Oil PVT Output from PVCDO
This commit expands the public member function

    Tables::addPVTTables(const EclipseState&)

to call into a new private member function

    Tables::addOilPVTTables(const EclipseState&)

which will create structurally correct TAB vector entries from the
PVCDO input table data when oil is an active phase in a simulation
run.  Specifically, the result array has the columns

    [ Po, Bo, Co, mu_o, Cv ]

in which 'Co' denotes the oil compressibility and 'Cv' denotes the
oil viscosibility.  The number of table rows is equal to number of
PVT regions times the number of pressure nodes declared in input
keyword TABDIMS (NPPVT, Item 4).  In other words, the result array
is a copy of the input table but expanded to fill NPPVT rows per PVT
region.  Fill value -1.0e+20.  We have verified the results with
ECLIPSE 100.

At present the function is not called by Flow's INIT file writer.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
466341fa0f Tables: Add Structurally Correct Water PVT Output
This commit adds a new public member function

    Tables::addPVTTables(const EclipseState&)

that calls into a new private member function

    Tables::addWaterPVTTables(const EclipseState&)

to create structurally correct TAB vector entries from the PVTW
input table data when water is an active phase in a simulation run.
Specifically, the result array has the columns

    [ Pw, 1/Bw, Cw, 1/(Bw * mu_w), Cw - Cv ]

in which 'Cw' denotes the water compressibility and 'Cv' denotes the
water viscosibility.  Column 4 and 5 follow ECLIPSE 100 conventions.
Number of table rows equal to number of PVT regions.  This result
array differs from the existing Tables::addPVTW() member function in
the treatment of viscosity and viscosibility data.  We have verified
the results with ECLIPSE 100.

At present the function is not called by Flow's INIT file writer.

Add a unit test to exercise the new member function.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
c279184229 Tables: Make Table Constructor More Generally Callable
In particular, expose the internals of

    SatFunc::detail::createSatfuncTable()

as a new free function, createPropfuncTable().  The latter knows
about sub-tables as present in live oil (PVTO) and wet gas (PVTG)
input data and will loop over all primary keys of a single table
(i.e., region) before advancing to the next table.

The primary purpose of createPropfuncTable() is to support creating
the normalised (ECLIPSE 100 style) INIT file tables for PVT data.
2019-04-04 14:11:07 +02:00
Bård Skaflestad
bd73bb6c55 Linearised Table: Add Constructor with User-Defined Fill Value
Reimplement original constructor in terms of the new constructor.
The main purpose of the new constructor is to support PVT tables
which use a fill/padding value different from 1.0e+20.
2019-04-04 14:11:07 +02:00
Joakim Hove
78170ccfce
Merge pull request #704 from joakim-hove/rft_config
Add class RFTConfig
2019-04-04 14:05:07 +02:00
Joakim Hove
7852e584f9 Slight reorganisation to avoid possible memory leak 2019-04-03 19:46:08 +02:00
Joakim Hove
a9bb73559d Use RFTConfig instead of per well RFT configuration 2019-04-03 19:46:08 +02:00
Joakim Hove
be36439600 Add class RFTConfig to manage when RFTs should be created 2019-04-03 19:46:07 +02:00
Joakim Hove
9e40f3be4f Add DynamicState::find_if() 2019-04-03 19:46:07 +02:00
Joakim Hove
0d172c9a1c
Merge pull request #705 from totto82/fix_well_event2
update well event also for WCONINJH
2019-04-02 17:51:00 +02:00
Joakim Hove
ad6c98e0da
Merge pull request #706 from totto82/fix_overburd
Fix the unit of the overburden pressure
2019-04-02 17:50:17 +02:00
Tor Harald Sandve
8fb0e1e222 Fix overburden units 2019-04-02 13:42:38 +02:00
Tor Harald Sandve
d7bd8d25cd update well event also for WCONINJH 2019-04-02 13:40:47 +02:00
Bård Skaflestad
d0d6d57472
Merge pull request #695 from joakim-hove/data-type-UDA
Input Data type uda
2019-04-01 19:53:22 +02:00
Joakim Hove
0923ffeef2 Replace std::endl with \n in code generator 2019-04-01 18:32:06 +02:00
Joakim Hove
7a158fc45c Use UDA datatype in the keyword configuration 2019-04-01 18:32:06 +02:00
Joakim Hove
fdac0f576c Add input type UDA -> double 2019-04-01 18:32:06 +02:00
Joakim Hove
e6aecbd7ac ParserItem: differentiate between input type and internal data type
Differentiate between the input type, as specified in the json configuration
file, and the internal native type used to store data. This is a many-to-one
mapping, where e.g. both the input types STRING and RAW_STRING map to the
internal datatype std::string.

Additional changes:

 - Have removed several ParserItem() constructors.
 - The size_type::SINGLE is default for a ParserItem, and not set explicitly in
   the generated ParserKeywords.cpp file.
 - Have removed a call to boost::lexical_cast<> - just use std::to_string()
2019-04-01 18:32:06 +02:00
Jostein Alvestad
5083db3715 Has added name for integer shift values as requested 2019-04-01 16:09:30 +02:00
Jostein Alvestad
1247309b3f Corrections / improvments according to comments from maintaniners 2019-04-01 14:52:27 +02:00
Jostein Alvestad
a1365ffc99 Added test to account for inactive well connections
That is handling of well connections that are defined by COMPDAT
and that become inactive of some reason.
2019-04-01 14:52:27 +02:00
Jostein Alvestad
4b62303f36 Added unit tests for the writing of well connection data
That is writing well connection data to eclipse compatible restart file
2019-04-01 14:52:26 +02:00
Jostein Alvestad
d7249ea6e6 Initial work on unit tests for well connection data to restart file
Establish framework and test data
2019-04-01 14:52:25 +02:00
Joakim Hove
810aa6970b
Merge pull request #702 from joakim-hove/udq-summary-bug
Section keyword 'SUMMARY' was incorrectly identified as UDQ a keyword
2019-03-29 17:12:36 +01:00