Commit Graph

195 Commits

Author SHA1 Message Date
Joakim Hove
15bd99b44c Add class WellOrder to keep track of well insert order 2021-01-25 06:50:08 +01:00
Joakim Hove
ecce98a307 Revert "Use std::map for groups" 2021-01-19 12:40:01 +01:00
Joakim Hove
55cec7dd4d Use std::map for groups 2021-01-18 09:13:35 +01:00
Joakim Hove
d3a1f6521f Change test to check for existence 2021-01-15 12:29:01 +01:00
Joakim Hove
8cd442e5b2 Use full well objects instead of well names 2021-01-15 12:25:27 +01:00
Joakim Hove
d7345edc95 Use ScheduleState to manage VFP tables 2021-01-14 21:28:19 +01:00
Joakim Hove
c20417d69b Handle well test configuration with ScheduleState 2021-01-12 14:02:15 +01:00
Joakim Hove
aebbc56b07 Make sure ScheduleState time_points are clamped to std::time_t 2021-01-12 13:06:04 +01:00
Joakim Hove
e445bf738c Manage events with the ScheduleState machinery 2021-01-11 20:05:46 +01:00
Joakim Hove
5f78173afb Use ScheduleState for oil vaporization properties 2021-01-08 07:39:23 +01:00
Joakim Hove
f424aba75d Internalize nupcol in ScheduleState 2021-01-07 11:57:52 +01:00
Joakim Hove
aaacdd6c57 Add class ScheduleTStep 2021-01-06 19:08:00 +01:00
Joakim Hove
8cd9065b61 Add class ScheduleDeck 2021-01-05 19:36:00 +01:00
Joakim Hove
7a4bdd4ab5 Update report number in comment 2021-01-04 11:28:16 +01:00
Joakim Hove
8bc16ab7fe Rewrite TimeMap::operator[]
- Access to the historical period for a restarted run will not be caught.
- Access to underlying timepoint will be based on at()
2021-01-04 11:28:08 +01:00
Joakim Hove
cc772aa1df Use raw string deck input strings 2021-01-01 21:22:12 +01:00
Joakim Hove
cf244a293e Add time range to WellStatus 2020-12-08 20:01:55 +01:00
Joakim Hove
2e832f0fbe Changes to Well status implementation
o The status of a well is maintened as a small object which is managed by a new
   std::shared_ptr member in the well objects. The consequence of this is that
   several well objects can share the same underlying status object. The
   advantage of this is that runtime (i.e. ACTIONX) updates of well status will
   affect the correct set of wells.

 o The general Schedule::updateWell() will use the DynamicState::upadte_equal()
2020-12-08 09:36:45 +01:00
Joakim Hove
53cd73c2d7 PAvgCalculator to calculate WBP? pressures 2020-11-30 10:42:15 +01:00
Joakim Hove
d4513d214f Internalize WPAVE and WWPAVE keywords 2020-11-12 23:59:10 +01:00
Joakim Hove
2b24fba2c5 Merge pull request #2078 from joakim-hove/gliftopt-has
Add methods GasLiftOpt::has_well() and GasLiftOpt::has_group()
2020-11-05 12:41:21 +01:00
Joakim Hove
6c449a48b1 Merge pull request #2069 from joakim-hove/udq-wlist
Udq wlist
2020-11-03 11:22:02 +01:00
Joakim Hove
19090c2827 Add methods GasLiftOpt::has_well() and GasLiftOpt::has_group() 2020-11-03 08:47:15 +01:00
Joakim Hove
9844b73bdb Add functions to get/query connections from global index 2020-11-02 07:57:19 +01:00
Joakim Hove
7ef7e3017e Add class WellMatcher and use it UDQ evaluation 2020-10-30 22:17:59 +01:00
Bård Skaflestad
94af88c3a1 Switch Back to Consuming Strictly SI Convention PI Values
Heed advice from [at]joakim-hove to keep client code as close to
strictly SI as possible.  We must nevertheless continue to store the
raw (input/output units) requested PI value internally as this is
the only way to ensure that both the client and implementation has
consistent view of the well's preferred phase.  This means pushing
the unit conversion into Well::getWellPIScalingFactor().

Thanks to [at]joakim-hove for pointing out that the Well already
maintains an internal UnitSystem data member which makes the process
of converting the PI units trivial.
2020-10-30 15:16:31 +01:00
Bård Skaflestad
354351daee Record General Event When Processing WELPI
This commit ensures that we record a general, Schedule-level

    WELL_PRODUCTIVITY_INDEX

event in addition to the well-specific event already recorded when
we encounter a WELPI keyword.  We need this information in order to
trigger a PI calculation across all MPI processes in opm-simulators.
2020-10-30 15:16:31 +01:00
Bård Skaflestad
54e2eb5597 Store Raw WELPI in Well::productivity_index
This makes the interface less convenient to use, but it is the only
way to guarantee that we have a consistent notion of preferred phase
for injectors.  The downside is that the users of

    Well::getWellPIScalingFactor()

must convert the argument to raw/input units before calling the
function.
2020-10-30 15:16:31 +01:00
Joakim Hove
ed5d20d90e Add utility functions to query/get completion data 2020-10-28 16:00:56 +01:00
Bård Skaflestad
5b4a1c0bad Remove WELL_CONNECTIONS_UPDATED Event
With the introduction of Schedule::applyWellProdIndexScaling(), this
special-purpose event type is no longer needed and only causes
confusion.
2020-10-19 19:16:17 +02:00
Bård Skaflestad
26ef5d01a2 Apply WELPI CTF Scaling at Schedule Level
This commit adds a new member function

  applyWellProdIndexScaling(well_name, report_step, scalingFactor)

which applies WELPI-based CTF scaling (by scalingFactor) for all
pertinent report steps from 'report_step' and until the end of the
simulation run.  We use the 'scalingApplicable' array to communicate
connection eligibility between report steps and only apply the
scaling if the internal connections pointers differ between report
steps.
2020-10-19 19:16:16 +02:00
Bård Skaflestad
cfa5dd80cc Enable Applying WELPI CTF Scaling Across Time Direction
This commit adds a new in/out parameter, scalingApplicable, to the
applyWellProdIndexScaling functions.  This parameter carries time
(history) information on whether or not a particular connection is
eligible for WELPI-based CTF scaling.  Entries are marked ineligible
(false) and left untouched on subsequent calls if the corresponding
connection is ineligible at any point--e.g., as a result of new
COMPDAT entries.

This ability enables implementing WELPI CTF scaling at the Schedule
level which is the only level that has sufficient time information
to identify all the unique Well/WellConnections object combinations.
2020-10-19 19:16:15 +02:00
Bård Skaflestad
dabf988aa7 Split WELPI Application Into Two Parts
First part, implemented in a new member function

    Well::getWellPIScalingFactor

calculates a CTF scaling factor from stored WELPI information and a
dynamically calculated well-level PI value.  The second part, using
the original name applyWellProdIndexScaling, applies an externally
calculate CTF scaling factor to all eligble connections.

This is needed to enable applying multiple scalings across the time
direction.  Update unit tests accordingly.
2020-10-19 19:16:12 +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
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
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