Commit Graph

1015 Commits

Author SHA1 Message Date
Joakim Hove
5ff65747f3 Rename summary variable in test 2020-10-20 20:02:19 +02:00
Bård Skaflestad
3eef45e87d Capture Preferred Phase When Processing WELPI Keyword
This is to handle the case of an injector changing its injected (and
therefore preferred) phase (e.g., in WCONINJE or WCONINJH) at the
same report step as a WELPI CTF rescaling, but logically after the
WELPI action is applied.

For instance, this happens in the following setup:

    WCONINJH
       INJ2   WATER   OPEN  5500 /
    /

    DATES
      1 'JAN' 2020 /
    /

    WELPI
      'INJ2' 0.1E5 /
    /

    WCONINJH
       INJ2   GAS   OPEN   701627 /
    /

    DATES
      1 'FEB' 2020 /
    /

In this case, the WELPI for 'INJ2' is supposed to be interpreted as
the water-phase PI (preferred phase is 'WATER' when we read WELPI),
but since the injecting phase is reset to 'GAS' at the same report
step we risk misinterpreting the PI as pertaining to the 'GAS' phase
when calculating the well's effective/dynamic PI in the simulator if
we just use Well::getPreferredPhase().

Switch the the well's input PI from an optional<double> to an
optional<struct> that captures both the input PI value (SI units)
and the preferred phase when processing the WELPI data.  Provide a
way to query that information from the simulator and update unit
tests accordingly.
2020-10-19 11:09:00 +02:00
Bård Skaflestad
f84858279f WELPI: Don't Inadvertently Overwrite Scaling Eligiblity
Since the Well stores a pointer to its connections, rather than the
connections themselves, we must take care not change the existing
state of the connections' WELPI eligibility flag.  Do the update
check on a copy of the connections instead of the real connections.

Pointy Hat: [at]bska
2020-10-19 11:08:59 +02:00
Bård Skaflestad
f718cc1adc Injectors: Ensure "Preferred" Phase is "Injected" Phase
This needed to correctly interpret WELPI values when wells switch
from injecting Water to injecting Gas or the other way around.
2020-10-19 11:08:59 +02:00
Joakim Hove
134834cefa Pass VFP ALQ type to enable unit conversion for ALQ values 2020-10-16 12:16:33 +02:00
Joakim Hove
2644e3bd78 Add test (safety belt) for VFP dimension conversion 2020-10-16 12:16:33 +02:00
Joakim Hove
451eefbda5 UDQContext - differentiate between missing well and invalid variable 2020-10-16 11:24:21 +02:00
Joakim Hove
2d036144cc Raise OpmInputError for unbalanced quotes 2020-10-14 08:40:10 +02:00
Bård Skaflestad
6f20858d73 Record Event if WellConnections Change
This is different from COMPLETION_CHANGE which is unconditionally
recorded when processing COMPDAT.  This event is recorded only when
the Well's internal WellConnections structure actually changes and
informs clients that they may need to rerun any dynamic WELPI
scaling.  Such scaling will not be automatically forwarded onto the
new WellConnections structure.

This is arguably a hack.
2020-10-12 15:10:28 +02:00
Joakim Hove
36e03cf6b9 Use ParserKeyword::prohibits for COORD / GDFILE / ZCORN 2020-10-10 08:30:48 +02:00
Bård Skaflestad
fa7d8bc28c Add Support Infrastructure for WELPI Feature
This commit adds logic implementing the static parts of the WELPI
keyword.  We internalize the keyword data, record appropriate events
and provide hooks for dynamically adjusting the per-connection
transmissibility factor (Connection::CF()) when those events occur.
We implement support at three levels

  - WellConnections:
    Add new public member functions prepareWellPIScaling and
    applyWellPIScaling which, respectively, creates bookkeeping
    data to track those connections which are subject to CF scaling
    and actually applies that CF scaling.

  - Well:
    Add new data member 'productivity_index' which holds the 'WELPI'
    data value from the input keyword (converted to SI) and new
    member functions updateWellProductivityIndex and
    applyWellProdIndexScaling.  The first follows the 'update*'
    protocol (return 'true' if state change) and assigns new values
    to 'productivity_index' while the second uses the stored PI
    value and a dynamically calculated effective PI value to rescale
    the pertinent connections' CF value.

  - Schedule:
    Add new member function handleWELPI which internalizes the WELPI
    keyword and its data and records WELPI events for subsequent
    playback in the simulator layer.

Also add a set of unit tests to exercise the new features at all
levels.
2020-10-08 11:19:03 +02:00
Bård Skaflestad
de5e3d90cd Miscellaneous Cleanup Changes
In particular, include standard library headers as needed, fix
function declarations (operator<<() for Well::WellProductionProperties),
and make a few helper functions 'static' to avoid warnings of the
form "no previous declaration for".

For the Schedule's keyword handlers, also switch to storing member
function pointers directly instead of std::function objects.  This
saves space and does not incur function pointer conversions.  Use
std::invoke to call those handlers to avoid having to spell out the
'->*' operator.
2020-10-08 11:19:03 +02:00
Bård Skaflestad
a5a18fea9e Add Convenience Predicate WellConnections::empty
Replace expressions comparing size() to 0 with calls to empty().
2020-10-07 22:29:18 +02:00
Joakim Hove
a33fd2483f Updates to well control mode reported in IWEL
With this commit the IWEL[ActWCtrl] is assigned a value independently of the
wells OPEN / SHUT status.

With this PR the index enum value Status is used instead of the previously used
item11. Also numerical constants are introduced for eclipse status values for
Shut, Stop, Open and Auto.
2020-10-07 18:28:11 +02:00
Joakim Hove
23faea7b81 Merge pull request #1996 from wito/required-keywords
Required and Prohibited Keywords
2020-10-07 09:06:42 +02:00
Williham Williham Totland
90d980a4f6 Adds manipulation of the ParseContext to tests. 2020-10-06 09:58:46 +02:00
Bård Skaflestad
33d09936c3 Merge pull request #1719 from GitPaean/aquifer_keywords
adding aquifer summary keywords
2020-10-05 22:49:32 +02:00
Williham Williham Totland
7aba0cd976 Implements required and prohibited keywords. 2020-10-05 13:34:35 +02:00
Williham Williham Totland
c43600337b Throws exception with nesting, and generalises tests to account for same. 2020-10-05 11:06:19 +02:00
Williham Williham Totland
d0c5fa042c Adjusts the defaultMessage format string. 2020-10-05 09:26:25 +02:00
Williham Williham Totland
7a8347f1ab Unifies interface of OpmInputError::OpmInputError() 2020-10-05 08:26:51 +02:00
Kai Bao
aa639869be adding the development to test ANALYTICAL_AQUIFERS 2020-10-05 07:37:13 +02:00
Joakim Hove
0f21752a7e Add test for unsupported keyword in FieldProps operations 2020-10-05 07:28:07 +02:00
Kai Bao
31e5c494a8 adding aquifer keywords to the summary_ALL test in SummaryConfigTests 2020-10-05 00:28:11 +02:00
Kai Bao
e86e8796ec adding a small test for aquifer keywords 2020-10-02 22:32:23 +02:00
Tor Harald Sandve
8210bcde34 Merge pull request #1968 from hakonhagland/wglir
Add support for WGLIR.
2020-10-02 14:48:18 +02:00
Kai Bao
6093a80dff fixing the compilation due to interface change 2020-10-02 14:09:01 +02:00
Kai Bao
fd773423b0 adding the following aquifer summary keywords
AAQR, AAQT, AAQP
2020-10-02 13:18:51 +02:00
Joakim Hove
0ab50fbc95 Merge pull request #1977 from wito/test-warning-noise-fix
Test Compilation Warning Noise Fix
2020-10-02 07:56:14 +02:00
Joakim Hove
96ce078dfd Merge pull request #1983 from joakim-hove/private-fmt
Mkae sure fmtlib is not a dependency in the public api
2020-10-01 15:24:15 +02:00
Joakim Hove
fbf88e8ce1 Merge pull request #1984 from joakim-hove/remove-value
Remove homemade optional - use std::optional
2020-10-01 15:23:55 +02:00
Joakim Hove
6dc84b67df Remove homemade optional - use std::optional 2020-10-01 13:53:58 +02:00
Joakim Hove
8c351440e8 Mkae sure fmtlib is not a dependency in the public api 2020-09-30 18:17:57 +02:00
Joakim Hove
42f1278db3 Changes in restart TimeMap and Schedule::iterateSection
This commit changes two aspects of restarts where well and group information is
assembled from the restart file:

 o We require the restart date to be present in the Schedule file as a DATES
   keyword.

 o SKIPREST behavior is implemented unconditionally for restarts with restart
   files, even if the SKIPREST keyword is not present.
2020-09-29 23:00:16 +02:00
Håkon Hægland
7db5d2fd5c Added WGLIR to SummaryConfigTests.cpp 2020-09-29 15:52:28 +02:00
Joakim Hove
2a812ab7ce Use OpmInputError 2020-09-29 15:37:14 +02:00
Joakim Hove
0512ab88b4 ParseContext will throw OpmInputError 2020-09-29 15:37:14 +02:00
Williham Williham Totland
6d2f8cca5c Adds type information to integer literals. 2020-09-29 13:54:21 +02:00
Joakim Hove
e01400fa18 Add KeywordLocation argument to ParseContext::handleError() 2020-09-29 09:56:07 +02:00
Joakim Hove
e8423d3b25 Merge pull request #1969 from wito/keyword-handler-try-catch
Exception Catch and Release
2020-09-29 09:54:41 +02:00
Joakim Hove
8848fde48e Collapse multi record operations on TRAN in one operation
The main content of this commit is that for keywords with multiple TRAN
modifications like

  MULTIPLY
     TRANX 1.50 1 10 1 10 1 1 /
     TRANX 2.50 1 10 1 10 2 2 /
  /

The different operations are collapes to one entry in tran calculator.

This commit also explicitly throws a std::logic_error() exception if TRAN
manipulations are attempted with the OPERATE keyword or one of the region
keywords ADDREG, MULTIREG, EQUALREG or OPERATER.
2020-09-28 21:44:21 +02:00
Williham Williham Totland
9a66acbb5d Extends OpmInputError to be initialisable from an existing exception. 2020-09-28 13:16:45 +02:00
Williham Williham Totland
742c90cabc Extends Opm::OpmInputError::OpmInputError() to accept additional format arguments. 2020-09-28 13:16:45 +02:00
Joakim Hove
8e55f3138b Add multi record test 2020-09-27 10:16:32 +02:00
Joakim Hove
b95fbc4919 Rewrite test to iterate over cartesian coordinates 2020-09-27 10:16:32 +02:00
Joakim Hove
b9f95089b9 Merge pull request #1949 from joakim-hove/error-prepare
Error prepare
2020-09-24 07:33:22 +02:00
Joakim Hove
2e20dc5d43 Merge pull request #1923 from totto82/co2storage
Add CO2STOR keyword in Runspec section
2020-09-23 14:36:18 +02:00
Markus Blatt
d60a91c3dd Merge pull request #1932 from blattms/tran-calculator-2
Adds a calculator for modifying transmissibilities.
2020-09-22 19:56:12 +02:00
Joakim Hove
b184b0e9e5 Merge pull request #1942 from joakim-hove/opm-error
Opm error
2020-09-22 18:01:14 +02:00
Tor Harald Sandve
f3e209b740 Add CO2STOR keyword in Runspec section 2020-09-22 14:53:35 +02:00