Commit Graph

5317 Commits

Author SHA1 Message Date
Arne Morten Kvarving
7c3aacd118 some cleanup in buildsystem 2019-02-15 11:03:08 +01:00
Joakim Hove
159ffeaef3
Merge pull request #548 from bska/flow-flow-restart
Add Support for Restarting Flow from ECLIPSE Compatible Restart File
2019-02-13 18:49:30 +01:00
Bård Skaflestad
c345aa3f4e Restart Output: Move Group Name Assignment to Separate Helper
Mostly for consistency.  Also, look up window index by group name.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
a51d18cab0 Restart Output: Adjust Whitespace
Mostly removing leading 'tab' characters, splitting long lines and
realigning '=' characters where appropriate.  Also make a few more
objects 'const'.

Finally, don't copy large objects (e.g., the Schedule) when we only
need to read from it.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
0d0b8b257f Well Data: Prune Disabled Code Blocks
These have not been used for a long time.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
c9331d7fed Save: Simplify Main Gateway Function
In particular, defer unit conversion to the member function

  RestartValue::convertFromSI()

and detect presence of multisegment wells using std::any_of().  We
don't need to know the exact number of MS wells to activate segment
output.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
849eb80e41 IWEL: Identify Items for Active and Requested Well Controls
This commit refines our understanding of IWEL items relating to well
constraints.  In particular Item 8 is the well's active control mode
as determined by the simulator from dynamic state variables.  On the
other hand, Item 16 is the constraint that is requested in the
simulation run input for prediction wells (keywords WCONINJE,
WCONPROD) while Item 50 is the requested constraint for wells
controlled by observed rates (WCONINJH, WCONHIST).

Special Note: This commit outputs the requested control mode to Item
8 and will need an update later once the simulator becomes aware of
the distinction.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
e685eccdc9 Restart: Save/Restore Historical Cumulative Production
This commit adds support for saving and restoring cumulative
production quantities like WOPTH, GWPTH, FGPTH, GGITH, and WWITH.
While here, also cater to the case of wells alternating between
injecting gas and injecting water.  This means that we'll save and
restore cumulative gas/water injection for all injectors,
irrespective of current injecting phase.

Update unit tests accordingly.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
169ec76605 Save/Restore: Support ECLIPSE Compatible Hysteresis Vectors
This commit adds an intermediate layer to the save/restore code that
will translate between Flow's hysteresis parameters and a compatible
subset of ECLIPSE's hysteresis model parameters when creating a
stricly ECLIPSE compatible restart file.  In particular we save and
restore Flow's KRNSW_OW and PCSWM_OW parameters in terms of the
SOMAX parameter using the relations

    KRNSW_OW = 1 - SOMAX
    PCSWM_OW = 1 - SOMAX

Similarly, we save and restore Flow's KRNSW_GO and PCSWM_GO
parameters in terms of ECLIPSE's SGMAX parameter using the relations

    KRNSW_GO = 1 - SGMAX
    PCSWM_GO = 1 - SGMAX

This does implicitly assume that KRNSW_OW = PCSWM_OW and that
KRNSW_GO = PCSWM_GO and will likely need refinement later.  On the
other hand, the current relations are sufficient for the Norne
model.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
b311fbb9d0 Save/Restore Connection Index and Pressure Values
Further analysis suggests Item 35 (index 34) of XCON is the
connection pressure.  Use this information to save/restore the
values of data::Connection::pressure.

While here, also fix a spelling error in LoadRestart.cpp.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
bfe2507184 Restart Facility: Output Suggested Next Timestep as TSINIT
This commit activates the support for storing Flow's suggested next
timestep size as the TSINIT item (zero-based index 1) of the restart
file's DOUBHEAD vector.  Local testing suggests that this value is
essential to even being able to restart Flow from a result set
generated by Flow itself.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
466693f1d0 Load Restart: Add Means of Retrieving Next Timestep From DOUBHEAD
This commit restores Flow's suggested next timestep size from the
TSINIT item of the DOUBHEAD vector pertaining to a particular
restart/report step.  If the item is defaulted, which typically
happens if the result set is created by ECLIPSE, then we don't try
to restore the stepsize and RestartValue::hasExtra("OPMEXTRA") will
be false.
2019-02-10 19:14:30 -06:00
Bård Skaflestad
ecca78af85 DOUBHEAD: Add OPM-Specific Method for Storing Next Timestep
This commit creates an OPM-specific extension of the DOUBHEAD vector
of a restart step.  We reuse the TSINIT item (zero-based index 1) to
store the next timestep.  Local testing suggests that ECLIPSE does
not use this value as part of restarting a simulation so this item
is a reasonable compromise for creating a mostly ECLIPSE-compatible
restart file that still enables communicating the suggested next
timestep if we're restarting Flow from a result set created by Flow.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
551f1f8c76 Connection Rates: Lookup Connections by (I,J,K) Index
This is more robust than the linear index.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
9e97dde466 Restore Cumulative Summary Quantities in Restart
This commit hooks the new helper function restore_cumulative() up to
the gateway restart function

    RestartIO::load()

by changing the return type from "RestartValue" to

    std::pair<RestartValue, SummaryState>

with the pair's '.second' being restore_cumulative()'s return value.

Update callers including unit tests accordingly, specifically such
that the gateway function

    EclipseIO::loadRestart()

internally resets its Summary object's cumulative quantities using
'load().second'.  This is, strictly speaking, a violation of the
"const" qualifier on EclipseIO::loadRestart(), but the language
permits the usage because the 'impl' pointer in this case will be a
constant pointer to a mutable 'Impl' object.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
b3cfb4ee78 Load Restart: Add Means of Restoring Cumulative Quantities
This commit introduces a new helper function

    restore_cumulative()

which creates a SummaryState object containing a subset of known
cumulative quantities--notably cumulative phase and reservoir
voidage production and cumulative water and gas injection for
individula wells and groups--including FIELD.  This is the main
facility for resetting the simulator's notion of cumulative
production following simulation restart.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
bed76c330b Summary: Add Means of Resetting Cumulative Quantities
This commit introduces a new mutating operation on Summary objects,

    Summary::reset_cumulative_quantities(const SummaryState&)

which overwrites the values of cumulative ("total") summary
quantities with those of the input argument.  The only *intended*
use case is reinitialising cumulative quantities in the case of
simulation restart, but other uses may exist.

Add a test case to exercise the new interface.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
8f2a36593d Load Restart: Load Segment Vectors if Available
This commit extends RestartIO::load() to also pick up segment
related quantities (flow rates SOFR, SGFR, SWFR, and pressure SPR)
if these are available in the current restart file.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
5736dd6e9c Load Restart: Add Windowed Views into Well and Group Data
This commit adds two new helper classes, {Well,Group}Vectors which
simplify accessing the portions of {I,X}{CON,WEL,GRP} pertaining to
any individual connection, well or group.  These classes are both
implemented in terms of the existing helper functions

    getPtr()
    getDataWindow()
    getInteHeadElem()

but hide away the complexity of passing the correct maximum number
of connections and number of vector elements per connection, well or
group.

Reimplement the vector queries in terms of these helper classes to
(hopefully) reduce the mental load when reading the restart code.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
ff1b245b8f Restart Facility: Idenfity Certain Items in XGRP and RSEG
This commit adds a few identifiers for items in the XGRP and RSEG
restart vectors to enable restoring segment rates and cumulative
group production/injection quantities.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
e77bd172c5 Solution Output: Remove Special Treatment for TEMP
It is no longer needed as this aspect is handled further up in the
call chain.
2019-02-10 19:14:29 -06:00
Bård Skaflestad
0301d402a4 Load Restart: Chase Semantic Update of data::Connection
Commit ef606711 switched to saving data::Connection::index as the
global cell index of the reservoir connection.  Update restore layer
accordingly.
2019-02-10 19:14:29 -06:00
Joakim Hove
fde95a69d1
Merge pull request #641 from totto82/freeBC
Add input keywords for setting free boundary conditions
2019-02-08 18:18:14 +01:00
Joakim Hove
75d93f196d
Merge pull request #625 from joakim-hove/summary-udq
Summary udq
2019-02-08 17:03:36 +01:00
Tor Harald Sandve
62b826e14f Add input keywords for setting free boundary conditions 2019-02-08 13:27:12 +01:00
Joakim Hove
96c02c9d35 UDQ - hooked up to the Summary Output 2019-02-08 06:42:38 +01:00
Joakim Hove
3d4b467a2f Add UDQContext class to be used while evaluating UDQ keywords 2019-02-08 06:34:05 +01:00
Joakim Hove
7451e6618f Minor reformatting/white space change 2019-02-08 06:34:05 +01:00
Joakim Hove
cf0b7db534
Merge pull request #640 from bska/arraydim-consistency-checker
Add Array Dimension Consistency Checker (Take 2)
2019-02-07 18:37:55 +01:00
Bård Skaflestad
7986e99e61 Intehead: Use Maximum of Declared/Dynamic Sizes
This commit revises the output layer to size object arrays according
to the maximum of the static, declared maximum sizes (from WELLDIMS)
and the actual dynamic array sizes from the simulation run itself.

When creating strictly ECLIPSE compatible restart files, this
maximum must always be the value from WELLDIMS, but Flow might
support sizes that are more lenient.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
6cc65ada59 Add Tool for Checking Array Dimensions
This commit introduces a new function,

    Opm::checkConsistentArrayDimensions()

that inspects various dynamic array/table sizes and compares those
to the maximum dimensions requested in the relevant *DIMS keywords
of the RUNSPEC section.

At present we check only items one through four of WELLDIMS since
those are directly relevant for the ECLIPSE-compatible output code.
We leverage the ErrorGuard to integrate into the existing mechanism
for terminating a simulation run if there's a parse failure.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
7bf635ef59 Parse Context: Add Keys for Items 1-4 of WELLDIMS
This commit introduces Parse Context keys that govern the parser's
behaviour in the case of a simulation run using dynamic sizes that
happen to exceed the maximum sizes declared in the RUNSPEC keyword
WELLDIMS.  The default action for these keys is DELAYED_EXIT1, which
reflects the fact that it is impossible to create ECLIPSE-compatible
restart files if the run exceeds those maximum sizes.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
c138e78ddb Group Tree: Prune Undefined Function
Member function GroupTree::groupTreeSize() was never defined (or
used).  Remove its declaration to reduce opportunity for confusion.
2019-02-07 14:29:08 +01:00
Bård Skaflestad
1bca0f6480
Merge pull request #637 from joakim-hove/long-keywords
Add ParseContext::PARSE_LONG_KEYWORD
2019-02-07 14:26:29 +01:00
Bård Skaflestad
16f6e3ee0c
Merge pull request #639 from joakim-hove/remove-warning
Temporarily remove warning about missing summary variables
2019-02-07 14:16:37 +01:00
Joakim Hove
d6a9ea162d Temporarily remove warning about missing summary variables 2019-02-07 12:07:19 +01:00
Joakim Hove
b900441ac6
Merge pull request #610 from jalvestad/restart_hyster
Add changes to correct problems/errors with Eclipse restarts from flow  with hysteresis and well crossflow
2019-02-06 16:45:17 +01:00
Joakim Hove
65b629e423 Add ParseContext::PARSE_LONG_KEYWORD
The ParserContext error mode PARSE_LONG_KEYWORD is used to handle keywords
longer than 8 characters. The lenient option is to only consider the first 8
characters.
2019-02-04 17:17:00 +01:00
Joakim Hove
76f709aa70
Merge pull request #635 from joakim-hove/multio
Read keywords MULTIN and MULTOUT
2019-02-04 12:52:10 +01:00
Joakim Hove
57d19c9cdb Read keywords MULTIN and MULTOUT 2019-02-04 09:55:40 +01:00
Bård Skaflestad
e9756c3ee5
Merge pull request #622 from joakim-hove/udq-units
UDQ - hook the configuration up in the Schedule object
2019-02-03 22:24:02 +01:00
Bård Skaflestad
19c81fad9c
Merge pull request #632 from joakim-hove/summary-pull
Change from push to pull when initializing ecl_sum object
2019-02-03 22:23:07 +01:00
Bård Skaflestad
ecca175ccd
Merge pull request #615 from joakim-hove/msim-actionx
Msim actionx
2019-02-03 22:19:54 +01:00
Joakim Hove
2caf82baff Move check for legitimate keywords to ActionX 2019-02-03 18:07:04 +01:00
Joakim Hove
d82be29745 ACTIONX: Works with WELOPEN and msim 2019-02-02 17:35:56 +01:00
Joakim Hove
8eb10b33ce Change from push to pull when initializing ecl_sum object 2019-02-02 17:21:41 +01:00
Joakim Hove
42d08db25b Add UDQ configuration as DynamicState<> to schedule 2019-02-02 17:09:44 +01:00
Joakim Hove
d7d3d2538a
Merge pull request #634 from sogoogos/patch-1
include `<cstdlib>`
2019-02-02 08:20:38 +01:00
Sogo Shiozawa
e0fad15f0a
include <cstdlib>
add `#include <cstdlib>` to support older version of clang.
2019-02-02 09:38:33 +09:00
Jostein Alvestad
4c2105f85c changes to correct problem / error on output of historical injection rates and cumulatives 2019-02-01 08:36:12 +01:00