This commit adds a new facility for creating the simulation runs'
INIT file. This is intended to replace the implementation of class
EclipseIO::Impl's writeINITFile. Initial structure taken from
current implementation of EclipseIO::Impl::writeINITFile().
This commit switches the file handling operations of the gateway
function RestartIO::save() to using the OutputStream::Restart
component. Briefly, this means replacing write_kw() function calls
with calls to Restart::write(), especially since the latter natively
handles PaddedString<8> data.
Space-padded vectors of N (usually 8) characters is the typical
representation of character data in ECLIPSE output files. Support
this type natively in the ECLIPSE IO library.
This commit introduces two functions,
LogiHEAD::pvtModel()
LogiHEAD::saturationFunction()
that set LOGIHEAD flags pertaining to a subset of activated
features. In particular, we add the ability to control whether or
not a particular run applies to a live/dead oil case, a wet/dry gas
case and/or whether or not a dead oil case is specified in terms of
constant oil compressibility (PVCDO keyword). Saturation function
flags identify attributes of end-point scaling and directionally
dependent and/or reversible relative permeability functions.
Add unit tests to exercise these features.
This commit removes the restriction that cumulative totals are not
output in the case of creating OPM Extended Restart files. There
was a reason why we did not do this when the new restart facility
was introduced, but that reason no longer applies.
This commit expands the public member function
Tables::addPVTTables(const EclipseState&)
to call into a new private member function
Tables::addGasPVTTables(const EclipseState&)
which will create structurally correct TAB vector entries from the
PVDG (dry gas) input table data when gas is an active phase in a
simulation run. Specifically, the result array has the columns
[ Pg, 1/Bg, 1/(Bg*mu_g), d(1/Bg)/dPg, d(1/(Bg*mu_g))/dPg ]
The number of table rows is equal to number of PVT regions times the
number of pressure nodes declared in input keyword TABDIMS (NPPVT,
Item 4). In other words, the result array is expanded to fill NPPVT
rows per PVT region. Fill value +2.0e+20. We have verified the
results with ECLIPSE 100.
As an OPM extension, we will use the maximum number of active
pressure nodes across all PVDG tables if the declared maximum
pressure nodes in TABDIMS is too small. This will create a TAB
vector that is not compatible with ECLIPSE, but which will
nevertheless be useful in the context of ResInsight's flux
calculation.
This commit expands the public member function
Tables::addPVTTables(const EclipseState&)
to call into a new private member function
Tables::addOilPVTTables(const EclipseState&)
which will create structurally correct TAB vector entries from the
PVCDO input table data when oil is an active phase in a simulation
run. Specifically, the result array has the columns
[ Po, Bo, Co, mu_o, Cv ]
in which 'Co' denotes the oil compressibility and 'Cv' denotes the
oil viscosibility. The number of table rows is equal to number of
PVT regions times the number of pressure nodes declared in input
keyword TABDIMS (NPPVT, Item 4). In other words, the result array
is a copy of the input table but expanded to fill NPPVT rows per PVT
region. Fill value -1.0e+20. We have verified the results with
ECLIPSE 100.
At present the function is not called by Flow's INIT file writer.
This commit adds a new public member function
Tables::addPVTTables(const EclipseState&)
that calls into a new private member function
Tables::addWaterPVTTables(const EclipseState&)
to create structurally correct TAB vector entries from the PVTW
input table data when water is an active phase in a simulation run.
Specifically, the result array has the columns
[ Pw, 1/Bw, Cw, 1/(Bw * mu_w), Cw - Cv ]
in which 'Cw' denotes the water compressibility and 'Cv' denotes the
water viscosibility. Column 4 and 5 follow ECLIPSE 100 conventions.
Number of table rows equal to number of PVT regions. This result
array differs from the existing Tables::addPVTW() member function in
the treatment of viscosity and viscosibility data. We have verified
the results with ECLIPSE 100.
At present the function is not called by Flow's INIT file writer.
Add a unit test to exercise the new member function.
Reimplement original constructor in terms of the new constructor.
The main purpose of the new constructor is to support PVT tables
which use a fill/padding value different from 1.0e+20.
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.
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.
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 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 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.
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.