Commit Graph

581 Commits

Author SHA1 Message Date
Tor Harald Sandve
e26fd1227b Add method to get connectionMaterialLawParams
This method changes the saturation table idx in the original material
law parameter object. In the context of ECL reservoir simulators, this
is required to properly handle wells with its own saturation table idx.
In order to reset the saturation table idx in the materialLawparams_
call the method with the cells satRegionIdx after it has been used for
the well connection.

Hysteresis is not accounted for. Is is a open question how this should
be implemented. A warning is given if hysteresis is combined with a
modified saturation table idx for the connection.
2017-03-23 10:09:41 +01:00
Robert Kloefkorn
0a5a5f7eb1 [bugfix][EclMultiplexerMaterialParams] use shared_ptr instead of void* to store pointer to avoid
problems with copying of objects.
2017-03-22 17:23:14 +01:00
Robert Kloefkorn
1a4f382a52 [cleanup] newly created Evaluation files, now with {} in for loops to
make it through the review process.
2017-03-20 14:51:47 +01:00
Andreas Lauser
2f44918a2b dense AD: fix a few stupid bugs
e.g., looping over the wrong range or an infinite loop. also, the
dense-AD unit test is shortend to test one specialization and the
unspecialized class.
2017-03-17 20:48:39 +01:00
Andreas Lauser
bf771b09b4 auto-generate and specialize the whole Evaluation class
older compilers (-> GCC < 5) seem to have trouble with inlining here
which leads to sub-optimal performance. since it is not a big problem
to also generate the unspecialized Evaluation class, let's do that
instead. (for hand-written code, this would be a huge
consistency/maintainance problem, though.)
2017-03-17 17:25:49 +01:00
Andreas Lauser
cba7ad9530 specify the type for the data storage via EvaluationOps 2017-03-16 01:05:00 +01:00
Andreas Lauser
b91c9feca9 fix typo: 'devide' -> 'divide' 2017-03-16 00:08:01 +01:00
Andreas Lauser
c170647969 use code generation for producing the specializations if the dense AD Evaluation class 2017-03-16 00:05:52 +01:00
Robert Kloefkorn
db46b907a2 Evaluation: specialize evaluations for used number in Blackoil setting
to increase performance. Also, change from unsigned to int because it's
better supported by compilers.
2017-03-14 14:49:24 +01:00
babrodtk
64bdc84a9f Add option to store/restore hysteresis parameters 2017-03-14 10:15:15 +01:00
Kai Bao
770b0b863a handle a few NaN situations when evaluating saturationPressure() 2017-03-09 21:18:15 +01:00
Andreas Lauser
00659e5847 LiveOil, WetGas: improve the saturationPressure() methods
we now ask the tabulation class for the derivative directly and we do
not return negative saturation pressures anymore. (the latter is done
via putting the Newton method on "probation" if the saturation
pressure becomes negative. The first time it does this offense we try
to help it out of its mess, but if it happens again, we abort it and
return 0 as the saturation pressure.)
2017-03-09 17:45:10 +01:00
Andreas Lauser
777f8f0bc8 LiveOilPvt, WetGasPvt: do not copy table columns if this is not necessary 2017-03-09 17:45:10 +01:00
Andreas Lauser
0ab39c5f7a synchronize the evaluation code of Spline and Tabulated1DFunction
in particular out-of-range conditions are now no longer done using
assertations but always trigger an Opm::NumericalProblem to be thrown.
2017-03-09 17:45:10 +01:00
Andreas Lauser
005cf203d7 isfinite() and isnan() are supposed to return booleans
... not Evaluations. This was probably a copy-and-pasto.
2017-03-06 17:05:23 +01:00
Andreas Lauser
1f2d72aba1 EclMaterialLawManager: add saturation region-specific material law parameters
this is needed for the well model. Be aware that in the future this
will probably need to be changed to have one material parameter object
per connection instead of one per saturation region. This attitude
adjustment would be necessary to support endpoint scaling and
hysteresis in the well model, but so far it is unclear what the
reference simulator does.
2017-03-01 13:19:56 +01:00
Andreas Lauser
9d6a620680 Merge pull request #207 from andlaus/SCALECRS-from-EclipseState
Scalecrs from eclipse state
2017-02-24 17:33:22 +01:00
Andreas Lauser
b15f99de5e make this work with the latest master version of opm-parser 2017-02-24 16:51:28 +01:00
Jørgen Kvalsvik
956e7f5341 Read SCALECRS and ENDSCALE from EclipseState 2017-02-24 16:11:01 +01:00
Andreas Lauser
2bafb4f7ed make the "sortInputs" argument of the 1D function tabulation classes default to true
"1D function tabulation classes" means 'Opm::Spline' and
'Opm::Tabulated1DFunction'.

note that 'sortInputs' is a slight misnomer because these setter
methods still expect the arguments to be given in either ascending or
descending order of the 'x' values and if they are given in descending
order, the order internal copies of these arrays are reversed. a full
sort would be a bit more work because it requires to sort two
independent arrays synchronously.
2017-02-24 12:03:07 +01:00
Andreas Lauser
b79baada99 do not use splines within the black-oil PVT objects
as far as I can see, the splines were only used to get a good initial
guess for the R(p) inversion code, so it should be safe to replace
them by piecewise linear functions.
2017-02-23 14:49:01 +01:00
babrodtk
7aac046e04 Added bubble point and dew point functions 2017-02-17 08:49:40 +01:00
Andreas Lauser
a70059448f Merge pull request #201 from totto82/fixJFUNC
Adapt to unit changes in opm-parser for JFUNC
2017-02-09 09:54:44 +01:00
Robert Kloefkorn
a6617c575e Restore default behavior of finalize_ 2017-02-07 16:28:14 +01:00
Robert Kloefkorn
e02a5d63e8 Converted all *Params classes to use EnsureFinalized. By default this feature is
enabled until an optional switch will be implemented.
2017-02-07 16:10:54 +01:00
Robert Kloefkorn
a4417d4a9f AssertFinalized --> EnsureFinalized. 2017-02-07 13:05:21 +01:00
Robert Kloefkorn
fd7059d6a0 Move assertFinalized_ to base class to avoid code duplication and allow for easy
toggle of functionality.
2017-02-07 11:29:38 +01:00
Tor Harald Sandve
2e51ae5079 Adpat to unit changes in opm-parser for JFUNC
The ECL Leverett function implementation "misuses" the pressure column
of the underlying tables (SWOF, SGOF, SWFN, etc.) for the
(dimensionless) J-Function. The correct converstion factor is now
applied in the parser and no converstions is needed no the opm-material
side.
2017-02-06 09:31:10 +01:00
Andreas Lauser
45da261142 move the '&' of references and the '*' of pointers to the type name
i.e., the new-style is `TypeName& var` instead of
`TypeName &var`. this patch is analogous to part of OPM/ewoms#83.
2017-01-18 17:57:54 +01:00
Andreas Lauser
19f1a27447 place the OPM_UNUSED macro after the variable name
this is analogous to OPM/ewoms#134.
2017-01-18 17:55:58 +01:00
Andreas Lauser
0d22035995 BlackOilFluidSystem: add isInitialized()
this allows to explicitly query if the fluid system has already been
initialized or not. the motiviation for this patch is that this method
can be used to avoid initializing the fluid system multiple times.
2017-01-09 12:11:06 +01:00
Andreas Lauser
a407546355 properly initialize the VAPPAR parameters for wet gas and live oil
valgrind complained about it. this is only relevant if initFromDeck()
is **not** used to initialize these objects. (e.g., this is the case
for the reservoir_blackoil_* tests of eWoms.)
2017-01-06 09:18:57 +01:00
Atgeirr Flø Rasmussen
4abfb825eb Remove unused Deck arguments. 2017-01-02 09:46:30 +01:00
Andreas Lauser
7e0cb71002 use the new and shiny internalized JFUNC object from opm-parser
from my point of view, the main advantage is that the string
processing for the 'flag' and 'direction' items does no longer need to
be done by opm-material.
2016-12-29 13:48:25 +01:00
Andreas Lauser
f9aa063ba0 quad.hh: constexpressify std::numeric_limits<quad>
our oldest supported compiler (GCC 4.8) now has good enough constexpr
support and c++-2011 and above seem to use constexpr for the numeric
limits of the standard floating point types.
2016-12-27 17:01:06 +01:00
Andreas Lauser
5bebabcd79 EclTwoPhaseMaterial: do not update the oil-water hysteresis parameters for non-existing objects
we must not update these parameters because the respective objects do
not exist in these cases. As far as I can see, both saturation function
objects need to exist for the gas-water twophase case despide the fact
that there is no oil because the capillary pressure between water and
gas is the sum of the capillary pressures between gas+oil and
oil+water. (also, I am not aware of any ECL keywords to provide the
gas-water saturation functions directly.)
2016-12-22 14:43:04 +01:00
Andreas Lauser
1d1f0e2095 quad.hh: include the correct header for std::runtime_error 2016-12-15 10:58:57 +01:00
Andreas Lauser
4ab2b3dc70 move over the quadruple precision math code from eWoms 2016-12-14 12:36:09 +01:00
Andreas Lauser
39c5c94ac7 the new home of Valgrind.hpp is opm-common! 2016-12-14 09:46:21 +01:00
Andreas Lauser
a607daa6e1 delete ClassName.hpp
it is now replaced in favour of Dune::className() from dune/common/classname.hh
2016-12-14 09:46:16 +01:00
Andreas Lauser
59c4d0f91b add missing "inline" to __float128 specialization of className()
if this specialization is not marked as "inline" it leads to linker
errors due to multiple definitions of the
`Opm::className<__float128>()` symbol. I consider this pretty
surprising behaviour of the C++ language because template functions do
not need to declared as `inline`.
2016-12-13 14:11:14 +01:00
Andreas Lauser
8fa3b6ee81 EclMaterialLawManager: fix and simpilfy the two-phase inititialization
this also fixes a bug where some parameter objects were not correctly
initialized in the two-phase (i.e., oil-water) case.
2016-12-12 14:39:43 +01:00
Atgeirr Flø Rasmussen
8dc4e0b2dc Merge pull request #179 from andlaus/move_Unused_hpp
delete Unused.hpp
2016-11-29 10:35:24 +01:00
Andreas Lauser
29de6a0174 Merge pull request #180 from andlaus/implement_two-phase_blackoil
make the BlackOilFluidSystem two-phase ready
2016-11-28 15:15:41 +01:00
Andreas Lauser
6592dc54f7 make the BlackOilFluidSystem two-phase ready 2016-11-22 15:10:28 +01:00
Andreas Lauser
69b2ebc5c6 delete Unused.hpp
it is moved to opm-common. use that file instead.
2016-11-22 14:43:00 +01:00
Atgeirr Flø Rasmussen
4514d5454c Use tabdims from EclipseState. 2016-11-17 22:39:32 +01:00
Andreas Lauser
93fe614558 fix some pedantic compiler warnings
this allows the test suite of eWoms to be compiled on clang++ 3.8
using the following warning flags

```
    -Weverything
    -Wno-documentation
    -Wno-documentation-unknown-command
    -Wno-c++98-compat
    -Wno-c++98-compat-pedantic
    -Wno-undef
    -Wno-padded
    -Wno-global-constructors
    -Wno-exit-time-destructors
    -Wno-weak-vtables
    -Wno-float-equal
```

without triggering warnings in opm-material or eWoms.

Note that the test-suite for opm-material does *not* yet pass without
warnings with these flags because with these flags clang likes to
complain about reducing or increasing floating point precision which
results in a formidable nightmare. I will see what I can do about
these warnings in a separate PR.

v4: properly fix the unused parameter warnings for the valgrind client
requests. thanks to [at]atgeirr for finding the issue.
2016-11-09 12:06:36 +01:00
Robert Kloefkorn
fceaafdce1 [performance] re-implementation of Evaluation.hpp that avoid the use of high
level functions and clusters the data together in a CPU friendly way.
2016-11-01 21:57:59 +01:00
Andreas Lauser
66ec787438 DenseAD: access the value and derivatives of Evaluations via accessor functions
this allows some flexibility of how an Evaluation object is
represented internally. the main motivation for this is to allow using
SIMD instruction which expect special data types as their operants.
2016-10-30 19:01:06 +01:00