Commit Graph

117 Commits

Author SHA1 Message Date
Arne Morten Kvarving
3875736795 implement support for FBHPDEF 2023-11-07 10:32:38 +01:00
Bård Skaflestad
416dadd33f Support Changing Selected Well Properties Through WELSPECS
This commit enables updating individual well properties for one or
more wells using the WELSPECS keyword.  In particular, this revised
logic enables changing the controlling group without affecting any
other well property such as the location of the well head or the
well reference depth.

Defaulted properties do not affect change in Well::update*().  This,
in turn, begets a change to the logic of how we update the reference
depths.  Previously, we always interpreted a defaulted reference
depth item as

    Compute the reference depth from the location of the well's
    reservoir connections

We now alter this interpretation slightly to mean

    Don't recompute the reference depth if the input has already
    assigned a numerical value for this property

If the input has never assigned an explicit numerical value for the
reference depth, then we continue using the original interpretation
of a defaulted reference depth item--e.g., to update the reference
depth as a result of new reservoir connections.

The simulation can request the original interpretation even after
having assigned a numeric reference depth, by entering a new
WELSPECS keyword specifying a negative value for the the reference
depth item.

To this end, introduce a new data member in the Well class,

    bool Well::derive_refdepth_from_conns_

which tracks whether or not the reference depth has been assigned an
explicit numeric value.

As an example, this new WELSPECS behaviour enables using something
like

    ACTIONX
      A  1 /
      WOPR 'P*' < 123.4 /
    /
    WELSPECS
      '?' 'LOWPRESS' /
    /
    ENDACTIO

as a way to move all wells matching the pattern 'P*', and with a low
oil production rate, to the group 'LOWPRESS'.  This could, in turn,
apply a different set of group-level production controls to those
wells.
2023-10-25 09:19:00 +02:00
Arne Morten Kvarving
9ef643345d Schedule.hpp: forward Well 2023-01-18 11:01:41 +01:00
Arne Morten Kvarving
d135fada0a remove unnecessary <iostream> includes 2023-01-03 16:32:56 +01:00
Arne Morten Kvarving
5df933460b changed: remove (basically) empty Well(Injection|Production)Properties.hpp 2022-08-11 11:47:54 +02:00
Joakim Hove
0a59bd8f61 Filesystem rename EclipseState/Schedule/ Schedule/ 2022-01-02 14:32:14 +01:00
Joakim Hove
aede532b9a Filesystem rename parser/eclipse/ input/eclipse 2022-01-02 14:32:14 +01:00
Bård Skaflestad
8306b7039f Extract Existence Predicate for Well BHP Reference Depth
This commit adds a new member function,

    bool Well::hasRefDepth() const

that allows the caller to query whether or not a particular well has
an active value for the well BHP reference depth.  The most common
cause of this value being missing is that the depth item of WELSPECS
is defaulted while the well is not connected to any active cells.

This predicate allows client code, e.g., the restart output module,
to safely access reference depth values in the case of potentially
missing reference depths.
2021-12-17 12:45:55 +01:00
Daniel
b0f757eb50 Replace Deck::getKeyword(std::string) with operator[std::string] 2021-11-23 14:00:38 +01:00
Joakim Hove
ee105b7bbf Remove base class DeckViewInternal and create new class DeckView 2021-11-12 08:09:29 +01:00
Daniel
45dd77938b Removed constructor from ScheduleGrid, added perm prop to tests
Changed (BASE_SIM.DATA, BASE_SIM_THPRES.DATA, RESTART_SIM.DATA),  testblackoilstate3.DATA and testrft.DATA since they affect the tests in test_Restart.cpp, test_restartwellinfo.cpp and test_RFT.cpp respectively.
2021-11-04 11:29:12 +01:00
Joakim Hove
39938be2c3 Rename HandlerContext::runtime
When replaying the Schedule keywords due to ACTIONX only the actual ACTIONX
keywords should be involved with the runtime flag set to true. The rest of the
deck should be evaluated in the normal way.
2021-09-01 15:44:25 +02:00
Joakim Hove
4a415e7ebf Support DEPTH ordering in COMPDAT 2021-08-04 07:54:54 +02:00
Joakim Hove
b240f15ff8 Move eclipseControlMode function as static method in Well class 2021-06-22 10:32:46 +02:00
Joakim Hove
37f07a1b18 Remove stale class TimeMap 2021-06-10 14:12:12 +02:00
Joakim Hove
3205423fc5 Accept UDA input for ALQ in WCONPROD / WCONHIST 2021-03-04 14:01:28 +01:00
Joakim Hove
7b896359f6 Part 2: Use Opm::time_point 2021-03-03 15:13:34 +01:00
Joakim Hove
45bfe8da9f VFP Table updates
- Add member KeywordLocation to vfp tables
 - Improve error messages
 - Remove array_type typedef - use std::vector<double>
 - Use class based enums
 - Replace assert(x) -> if (!x) throw
2021-02-16 09:14:43 +01:00
Joakim Hove
579890177e Remove prod_index member from Well class 2021-02-11 15:57:42 +01:00
Joakim Hove
e7f72ddb8a Remove unsused argument report_step in Well::updateConnections() 2021-02-03 11:27:10 +01:00
Joakim Hove
df833aaed3 Internalize WPAVEDEP keyword with reference depth for WBP 2021-01-04 18:39:45 +01:00
Joakim Hove
cf244a293e Add time range to WellStatus 2020-12-08 20:01:55 +01:00
Joakim Hove
91275cc0a5 Automatically shut wells with no connections 2020-11-17 14:55:48 +01:00
Joakim Hove
9bec2673ad Explicitly delete UDAValue::operator=() 2020-10-30 17:19:02 +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
6f124fb478 Revert "Capture Preferred Phase When Processing WELPI Keyword"
There and back again.  We don't actually need the preferred phase at
the time of encountering the WELPI request.  [at]joakim-hove was
right, the preferred phase of an injector must reflect the state at
the same report step as the WELPI keyword.  In other words, if the
injected phase is reset at the same report step as a WELPI keyword,
then the new preferred phase must be that of the new injected phase.

This reverts commit 3eef45e87d.
2020-10-30 15:16:31 +01:00
Joakim Hove
b9bd1598d7 Changes to well reference depth
1. The well reference depth should *not* be updated when new connections are
   added with COMPDAT.

2. The well reference depth should be recalculated when the well is updated with
   the WELSPECS keyword.
2020-10-23 15:25:38 +02:00
Bård Skaflestad
91bb168ee5 Fix Shadowing Type Alias
The local 'WellPI' type alias shadowed the name of the test.
2020-10-19 21:16:55 +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
338a48708a Add Special Predicate to Check if Two Wells Have Same Connections
This commit adds a new special purpose predicate member function

    bool Well::hasSameConnectionsPointers

which checks if the internal WellConnections pointers of two Well
objects (*this and the input argument) point to the same object.
This, in turn, enables identifying when to apply dynamic WELPI CTF
scaling across the time direction the internalized connection
information.
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
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
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
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
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
Williham Williham Totland
6d2f8cca5c Adds type information to integer literals. 2020-09-29 13:54:21 +02:00
Arne Morten Kvarving
518c219838 remove unused variable 2020-09-14 12:23:31 +02:00
Joakim Hove
2f3ba50ca6 Add boolean flag to indicate whether a well has been an open producer 2020-09-09 15:07:55 +02:00
Joakim Hove
84ad5ef502 Internalize Gas inflow equation flag in Well - for reporting 2020-04-19 08:37:48 +02:00
Joakim Hove
3072f0dabe Add pvt_table as member for Well 2020-04-15 11:26:57 +02:00
Joakim Hove
278402b63e Check well status before checking active control 2020-04-01 10:28:05 +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
Joakim Hove
39eb327551 Remove stale boost includes 2020-03-25 18:18:25 +01:00
Joakim Hove
c7d3603184 Changes in WellConnection ordering
1. If the well is MSW the connections in the WellConnection class is sorted in
   output order in the ::order() method, and retained that way.

2. Add method WellConnection::output() which return a vector of connection
   pointers sorted in output order.
2020-03-25 10:54:21 +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
327625b713 Use the WellType class in Well and Schedule 2020-03-09 13:30:18 +01:00