1) Start of new class EclFile which includes one anonomus namespace with routines for reading binary eclipse format files
2) One very basic test of EclFile constructor included in test_EclFile.cpp
- testing that file exist, throwing an exception if not.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.