Commit Graph

159 Commits

Author SHA1 Message Date
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
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
Williham Williham Totland
c43600337b Throws exception with nesting, and generalises tests to account for same. 2020-10-05 11:06:19 +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
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
e65880aafb Use Schedule::restart_groups() 2020-06-25 14:18:19 +02:00
Joakim Hove
f6d160db32 Add convenience method Schedule::restart_groups() 2020-06-24 12:53:09 +02:00
Atgeirr Flø Rasmussen
80f6a5d1ed Add failing test for NUPCOL in RUNSPEC. 2020-06-10 13:17:04 +02:00
Joakim Hove
64fb589ec6 Use string based parent *name* in GTNode instead of pointer 2020-05-07 20:08:39 +02:00
Joakim Hove
7fe89422e2 Internalize keywords for gas lift optimization 2020-05-07 16:29:42 +02:00
Joakim Hove
9a4c8f754e Change type of new value argument in WELTARG to UDA 2020-05-04 08:29:34 +02:00
Joakim Hove
ef77be1508 Refactor ScheduleTests to use fixture function 2020-05-04 08:29:34 +02:00
Joakim Hove
d37aa1116d Add function Schedule::changed_wells() to use in WELSPECS reporting 2020-04-21 13:18:49 +02:00
Joakim Hove
ab2e5cc310 Add three argument (year, month, day) constructor TimeStampUTC 2020-04-04 16:20:13 +02:00
Joakim Hove
07843654b1 SKIPREST: Make sure e.g. VFP tables are loaded even under SKIPREST 2020-04-01 08:23:15 +02:00
Joakim Hove
6fb2989708 WPIMULT: directly multiply the connection transmissibility factor 2020-03-31 16:53:28 +02:00
Joakim Hove
5444eade2f Use std::shared_ptr<Python> for Python argument in Schedule 2020-03-31 10:26:55 +02:00
Joakim Hove
50fb51d56e Add Python arg to Schedule constructor 2020-03-27 12:43:18 +01:00
Bård Skaflestad
8d2cc14ad0 Active Well Control Output: Place Duplicate Implementation in Well
Will become shared backend for output to restart and summary files.
Add unit tests to exercise the new functions.
2020-03-20 22:07:04 +01:00
Joakim Hove
f87369713b Add global_index to Connections 2020-03-19 22:14:06 +01:00
Joakim Hove
acd73b76ea Remove unused method WellConnections::inputSize() 2020-03-18 15:36:17 +01:00
Joakim Hove
96d2cd59b3 Move Connection::Order member from Well to WellConnections 2020-03-18 14:28:53 +01:00
Joakim Hove
1b2fadcdc4 Move enum Well:InjectorType to new file ScheduleTypes 2020-03-03 09:09:11 +01:00
Arne Morten Kvarving
710a94709e changed: simplify OilVaporizationProperties
there is no vappars per pvt region. do not store it as such either.
2020-03-02 09:32:40 +01:00
Tor Harald Sandve
83a8a9f4fe add test for production control from WELTARG 2020-02-21 12:39:58 +01:00
Joakim Hove
aed8c78af5 Move RestartConfig from EclipseState to Schedule 2020-02-19 12:35:07 +01:00
Arne Morten Kvarving
143c8ec3bf changed: avoid use of boost::multi_array in VFPInjTable 2020-02-17 13:08:14 +01:00
Bård Skaflestad
19ecc3d30e Consider Active Phases When Initializing Satfunc Endpoints
This commit passes the run's notion of its active phases, an object
of type Opm::Phases, through to the initialisation layer for the
saturation functions' scaling properties.  In particular, this
allows us to discriminate between the phases and to not index into
tables or properties that would not be appropriate (e.g., maximum
gas saturation (SGU) in a simulation run without active gas).

Moreover, we now have enough information to know to look for SOF2 in
two-phase run using family II saturation function keywords.  These
changes are necessary in order to extend Flow's support for the
FILLEPS output request to two-phase runs.
2020-01-29 16:34:15 +01:00
Joakim Hove
63e99fb807 Make mutable accessors in TimeMap private 2020-01-22 16:23:37 +01:00
Bård Skaflestad
8f182db27a Rework RFT Config to Handle More Cases
Generally, this commit captures more of the surrounding context of
calls to the updateRFT() and updatePLT() member functions.  We need
this additional context in order to handle the conflicting semantics
of output requests WRFT and WRFTPLT:FOPN.  The former generates RFT
output when the well opens if this event does not happen earlier in
the simulation schedule than the output request.  Otherwise no RFT
data is emitted.  The latter outputs RFT data at request time if
well opens no later than the request; otherwise at well-open time.

To this end, switch the well_open_rft_name data member from an
unordered_set of well names into an unordered_map from well names to
RFT output request times.  With this additional information we can
use well_open_rft_time to infer the appropriate response to whether
or not to activate RFT output at well open time.  Moreover, we now
guarantee that no RFT output is ever activated before the first RFT
output request.

Switching the type of the well_open_rft_name data member also begets
an API update to the serialization related RFTConfig constructor and
to the return type of RFTConfig::wellOpenRftName().

We furthermore switch to caching the first RFT output event in a new
scalar data member, first_rft_event.  This caching, coupled with the
additional calling context mentioned earlier, means we are now able
to report a high-fidelity, constant time answer to the

    RFTConfig::firstRFTOutput()

request.  This, in turn, is very useful for the RFT output code.
Finally, we also add a couple of new, private member functions to
simplify updating first_rft_event depending on context.

As part of this update, member function

    RFTConfig::setWellOpenRFT(report_step)

will now use the minimum of all 'report_step' values to support the
WRFT keyword being specified more than once.

Finally, add a set of unit tests to exercise the various RFT output
request combinations.

While here, also switch to using unordered_map::find() and emplace()
where possible to limit repeated look-up of the same keys.
2020-01-14 15:58:34 +01:00
Joakim Hove
ecb5fce19b
Only active cells (#1298)
Use FieldProps implementation for 3D properties
2020-01-13 15:46:06 +01:00
Joakim Hove
35619721a3 Well::updateStatus can optionally update status of connections 2020-01-11 06:55:22 +01:00
Joakim Hove
b7cebb1907 Refactored the handling of BHP / THP 2020-01-06 15:28:04 +01:00
Joakim Hove
40ea92ac81 Reenable BHP testing 2020-01-06 12:05:51 +01:00
Joakim Hove
8573c947fa Temporarily bypass the unit conversion in handleWELTARG 2019-12-17 15:28:08 +01:00
Markus Blatt
a1471c80b5 Use ActiveGridCells when filtering connections. 2019-12-10 13:49:04 +01:00
Joakim Hove
198b208258 Test use of FieldPropsManager in WellConnections 2019-11-29 16:42:29 +01:00
Joakim Hove
e9b6ac54d9 Add PORO keyword to testdata 2019-11-28 20:06:39 +01:00
Tor Harald Sandve
5d28ff7d24 store well and group event in same map 2019-11-27 08:58:57 +01:00
Tor Harald Sandve
b109331163 add group events 2019-11-25 09:55:32 +01:00
Joakim Hove
6cc3b578f5 Use value::status to keep track of data status in DeckItem
With this commit the DeckItem::push_backDummyDefault() function will push back a
default value T( ). This will give a change in behaviour in downstream code
which has used getData<T> to get DeckItem data unchecked.
2019-11-17 17:23:42 +01:00
Joakim Hove
613ec70dab Rename Well2 -> Well and Group2 -> Group 2019-11-13 23:19:26 +01:00
Tor Harald Sandve
0771e555a7 Change default NUPCOL to 12 2019-11-08 10:44:32 +01:00
Bård Skaflestad
7e160cb99a Reimplement ScheduleTests in Terms of TimeStampUTC
Note that we have to reduce the year-range in the specific test

    createDeckWithDRSDTthenDRVDT

in order not to wrap around for system_clock.  This is a deficency of
the new time-service protocol.
2019-10-16 20:03:08 -05:00
Joakim Hove
a55f691581 Improvements to GuideRate 2019-09-30 14:14:09 +02:00
Steinar Foss
11d1c7d634 python: DeckKeyword constructor, w/ ParserKeyword arg.
parserkeyword can create deckkeyword.

python parserkeyword: removed create_deckkeyword.

DeckKeyword: member parser_keyword is shared_ptr.

python DeckKeyword constructor.

python: no exposure of ParserKeyword.

DeckKeyword: shared_ptr<ParserKeyword> -> ParskerKeyword.

python/cxx/deck_keyword.cpp: cosntructor takes arg const ParskerKeyword&.

test_parser.py: simplified test_pyinut.

...
2019-09-23 23:27:03 +02:00
Atgeirr Flø Rasmussen
a5e897bdc7
Merge pull request #1039 from akva2/janitoring
fixed: remove unused variable
2019-09-23 15:59:32 +02:00
Arne Morten Kvarving
b41865d268 fixed: remove unused variable 2019-09-23 15:36:45 +02:00