The function used integer abs() instead of fabs(), in C abs() only
takes integers so this is an error. Also needed to add comparison
with absolute tolerance to get reasonable behaviour (comparing 0 versus
0.0000000000001 is ok here).
this caused the hysteresis saturation shifts to be initially wrong and
was probably the source of a lot of my confusion w.r.t. the saturation
scaling and hysteresis shift code. I guess this also fixes a valgrind
complaint, but I haven't checked...
"old" == "gcc 4.4". the standard c++ library of this compiler seems to
invoke the copy operator when creating objects in a vector, whereas
newer versions of the library don't. The problem is that std::unique
pointer cannot be copied because it is -- err -- unique and thus the
implicit copy operator for the SatFuncMultiplexer class gets deleted
by the compiler.
the fix is to introduce a "fake" copy operator which does not do
anything but is present to make std::vector of stdlibc++-4.4
happy. this is obviously not very elegant, but I could not come up
with a better solution. (another fix would be to use raw pointers
instead of std::unique_ptr, but IMO this does not qualify as
"better".)
basically, we now store a pointer to the base class and convert this
to the concrete incarnation of the saturation function. the only
disadvantage of this is that it requires to allocate the concrete
objects dynamically, i.e., there's another layer of indirection. On
the plus side it saves a few bytes per object and it makes things
quite a bit simpler, so it is a win IMO.
thanks to [at]atgeirr for suggesting this.
this makes it possible to switch to different saturation functions
again. So far the only supported function besides the default one is
the one which implements the "Stone 2" model.
this means the following changes:
- the "SatFuncGwseg" class is converted
- for now, Gwseg is the only saturation function supported by
SaturationPropsFromDeck. (will be changed in later commits.)
- the funcForCell() method of SaturationPropsFromDeck is removed as it
just occludes things
in any reasonable simulator which reads an ECL deck the deck is going
to decide which saturation function is to be used and not the outside
code. also, the table this which function will be using is not really the
calling code's business. (for any reasonable deck it is always going to
be a non-uniform table so it makes a lot of sense to avoid unnecessary
complexity IMO.)
this patch temporarily removes the ability to use anything except the
ECL default saturation function ("Gwseg"). this ability will be
restored later in this patch series.
namely BlackoilStateToFluidState which takes a BlackoilState object
and exposes it as a opm-material like fluid state object. Similar for
ExplicitArraysFluidState, which takes raw arrays.
since fluid states are a local API, the index of the cell to be used
for these two classes must be set externally. The advantage of this
concept is that it is possible to make "saturation functions" which
not only depend on saturations but also on arbitrary other quanties
(like temperature or phase composition) without having to change the
API of the "saturation" functions.
* output is to be formatted or not (FMTOUT keyword, default if keyword not present is unformatted)
* Whether restart file should be written for a specified report step
* whether restart files are to be unified or not (UNIFOUT keyword, default if keyword not present is multiple)
* whether an EGRID file should be written (GRIDFILE, NOGGF keywords)
* whether an INIT file should be written (INIT keyword)
* Removed former setting for interval writes to disk (from params)
Bård spotet a bug after PR #805 was merged. Indead returning
-numeric_limits<type>::min() does not make sense for integral
values. This commit resorts to returning numeric_limits<type>::min().
Kudos to Bård for his attention.
The only stage where parallelism changes the adaptive time
stepping is when some inner products on the saturation and
pressure are computed.
This commit makes this part parallel by added an additonal boost::any
parameter to the time stepping and the controller. Per default this
is empty. In a parallel run it contains a ParallelIstlInformation object
encapsulating the information about the parallelisation. This then used
to compute the parallel inner product.
This behaviour does not work for computing a global inner product.
Therfore this commit introduces a new function to the functor that
returns an appropriate initial value.
Previously we hardcoded float. Now we use the result_type of
the binary_function without any qualifiers. With any cv or reference
qualifiers std::numeric_limits uses a default implementation which
produces nonesense (e.g. numeric_limits<const int>::max() returns 0).
Previously, we used the setStatus method to set wells that do not
exist on the local grid to SHUT. Or at least this is what I thought
that ```well.setStatus(timestep, SHUT)```. Unfortunately, my
assumption was wrong. This was revealed while testing a parallel run
with SPE9 that threw an expeption about "Elements must be added in
weakly increasing order" in Opm::DynamicState::add(int, T). Seems like
the method name is a bit misleading.
As it turns out the WellManager has its own complete list of active
wells (shut wells are simply left out). Therefore we can use this
behaviour to our advantage: With this commit we not only exclude shut
wells from the list, but also the ones that do not exist on the local
grid. We even get rid of an ugly const_cast.
Currently, I have running a parallel SPE9 test that has not yet
aborted.
In this case the parallel index set might represent N entries (this might be the number of
cells of grid). Nevertheless, there several (n) equations/unknowns attached to each index.
In this case we construct a larger index set representing N*n unknows, where each unknown
is attached to an index.
This change only affects parallel runs.
In a parallel run each process only knows a part of the grid. Nevertheless
it does hold the complete well information. To resolve this the WellsManager
must be able to handle this case.
With this commit its constructor gets a flag indicating whether this is
a parallel run. If it is, then it does not throw if a well has cells that
are not present on the local part of the grid. Nevertheless it will check
that either all or none of the cells of a well are stored in the local part
of the grid.
Wells with no perforated cells on the local will still be present but set to SHUT.
This commit adds a verbose flag to the constructor of
ParameterGroup to allow for deactivating any
output to std:cout. This is handy for parallel runs where we only
want to print statistics on one process.
This commit adds a verbose flag to the constructor of
SimulatorReport to allow for deactivating any
output to std:cout. This is handy for parallel runs where we only
want to print statistics on one process.
This is mostly infrastructural code (Opm::Spline,
Opm::TriDiagonalMatrix, property system and the cubic polynomial
inversion code) that is only used by opm-material and eWoms. The
original intention of bringing this code into opm-core was to allow
other modules to start to use this easily. Since nothing in this
direction happened during the last one and a half years, the code only
represents baggage in the opm-core context and should thus be moved to
their consumer modules to make the life of everyone involved simpler.
It does not make sense to report transport and pressure separately
for fully implicit solvers. It still makes sense to separate solver
from init and output though.
The ert ecl_sum class is avare of time units; for FIELD and METRIC units
the time in the summary files is stord in days, for LAB units it is
stored in hours. From EclipseWriter this is managed by a bool flag
'time_in_days'.
A new method ParameterGroup::unhandledArguments() is available to
access the list of unhandled arguments. Before, when such arguments
were encountered they were ignored and a warning was printed to
standard out.
Apart from the lack of a (potentially misleading) warning, this
should not change the behaviour of existing clients of the class.
This commit updates the source code comment about using operator[] to
initialize the unordered map. Thanks to Bard's persistence we found
out that the cause is not the construction of the key value of type
std::string from const char* but the mapped type being a (mutable)
char* (due to C?).
This completes the PR #784.
g++-4.4 has problems converting const char* to char*
which it thinks is needed for constructing std::string.
Using operator[] circumvents this problem.
The compiler error fixed here was:
/usr/include/c++/4.4/bits/stl_pair.h: In constructor ‘std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&) [with _U1 = const char*, _U2 = const char*, _T1 = const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _T2 = char*]’:
/home/mblatt/src/dune/opm/opm-core/opm/core/linalg/LinearSolverPetsc.cpp:40: instantiated from here
/usr/include/c++/4.4/bits/stl_pair.h:107: error: invalid conversion from ‘const char*’ to ‘char*’
make[2]: *** [CMakeFiles/opmcore.dir/opm/core/linalg/LinearSolverPetsc.cpp.o] Fehler 1
basically, the unit system was reversed for rates and a
UnitSystem::UnitType object was implicitly casted to bool for the
bottom hole pressure monitor. (if the BHP monitor worked, it was only
by accident...)
I'd prefer to pass it for consistency reasons (because basically every
other class which takes an EclipseState object also requires a deck
object), but some people seem to have a very strong option about
this...
or more accurately: "use FIELD or METRIC units", LAB and PVT-M units
are still unsupported, but they seem to be pretty exotic and are also
not supported by opm-parser either...
note that this patch requires an API change (with the usual
consequences for all downstream modules which use this class) because
the deck needs to be passed to EclipseWriter. If somebody knows a
canonical way to get the names of the written units from EclipseState,
this is API change is not required.
I used "TEMP" as the name of the field of the UNRST files, but that is
just a guess. (I don't have access to any results of a thermal run of
the "It Defines The Truth (TM)" simulator.)
instead, we will be going with wrapper classes around the PvtInterface
in the next commits. this considerably reduces the amount of
copy-and-paste required for temperature support.
Currently the keyword EQUIL is not supported by the fully
implicit blackoil simulator when using CpGrid. This
commit is a first step towards this as it makes the
implementation of initStateEquil generic.
Well, you never know. There are containers that use a signed integer
for storing its size. This results in a warning about comparing signed with
unsigned integers. This commit prevents this by explicitly casting the size
to std::size_t.
Due to the size of the overlap layer and the discretization scheme
the rhs might not contain correct values for overlap cells. This
commit makes sure they are correct by an additional communication step.
-max time step parameter
PIDTimeStepControl --> TimeStepControl:
- added simple iteration count time step control
- bug fix in PIDAndIterationCountTimeStepControl
AdaptiveTimeStepping: apply the above changes.
this is implemented such that if the simulation is unchanged,
viscosities are assumed to be not temperature dependent. (only if
pvtObject->set{Oil,Wat}visctTables() is called, temperature dependence
is considered.)
The original version of the code wrote 14 items per connection to the
ICON array, however when loading restart information the ERT well loader
currently expects to find segment information in item 15. Will now write
an additional segment id item for each connection.
In addition the code has been refactored to use operator[] to set
elements instead of push_back() which was used previously.
One would think that such an assumption is safe in any case,
wouldn't one? But foen Eigen'S container this does not hold.
They do not provide STL compliant iterators, and access to them.
With this patch make the even stricter assumption that the containers
are random access and use operator[] instead of iterators.
As there are no functors for computing the minimum and maximum,
we convert the std::max and std::min function pointers to
functors (which is not really nice.) Previously we were somehow
tricked into using std::greater and std::less, which of course do
return true or false and not what we need. Additionally, do more
excessive testing with different ranges.
We need to compute quite a few global reductions in the
Newton method of opm-autodiff. This commit adds the functionality
to compute several reductions combined using only one global
communication. Compiles and test succeeds with one or more process.
The non-template class MinpvProcessor contains all function
definitions inside of the header file without inlining. The
results in the symbols being in the library of opm-core and
in case of using CpGrid an addtional occurence in other
libraries (opm-autodiff?).
This commit changes this by simply inlining all these functions.
Note that another (better?) option would be to move at least
the bigger once into a cpp file.
With this commit the WellsManager will check the status of completions
before adding them to the internal struct wells
datastructure. Completions can be in the four states:
OPEN, SHUT, AUTO, POPN
Completions with state == SHUT will be ignored, wheras the wellsmanager
will throw if the states AUTO or POPN are encountered. The WELOPEN
keyword can also have the value 'STOP'; for completions that is
translated to 'SHUT' by Schedule object.