Commit Graph

281 Commits

Author SHA1 Message Date
Andreas Lauser
da401551be clean up the licensing preable of source files
this patch removes the in-file lists in favor of a global list of in
the COPYING file. this is done because (a) maintaining a list of
authors at the beginning of each source file is a major pain in the
a**, (b) for this reason, the list of authors was not accurate in
about 85% of all cases where more than one person was involved and (c)
this list is not legally binding in any way (the copyright is at the
person who authored a given change; if these lists had any legal
relevance, one could "aquire" the copyright of the module by forking
it and replacing the lists...)
2016-03-15 00:58:09 +01:00
Andreas Lauser
9e6c38b06b Merge pull request #131 from andlaus/always_copy_on_toLhs
make MathToolbox::toLhs() always return a copy again
2016-03-07 13:56:49 +01:00
Andreas Lauser
362374daea make MathToolbox::toLhs() always return a copy again
in my testing, the GCC SVN version from 4th of March causes problems
if lvalue references are just passed through and neither GCC-5 nor
clang 3.6 show any obvious differences in performance. (I guess that's
because of the copy elision compiler optimizations in conjunction with
inlining.)

It is also worthwhile to know that clang 3.6 is about 20% faster with
ebos than both, GCC-6 and GCC-5. I can only speculate why this is the
case, but since the performance improvement seems to evenly apply to
the linearization and linear-solve parts, the auto-vectorizer of clang
possibly works better for ebos than the one of GCC...
2016-03-05 15:22:05 +01:00
Atgeirr Flø Rasmussen
46d1a512c2 Silence unused argument warnings. 2016-02-29 10:35:33 +01:00
Jørgen Kvalsvik
e467684137 Add missing opm-parser headers
opm-parser pull #695
https://github.com/OPM/opm-parser/pull/695
2016-02-26 11:38:53 +01:00
Andreas Lauser
88e85042e0 Merge pull request #127 from andlaus/fix_twophase_ecl_decks
black-oil PVT: bail out from trying to initialize PVT objects for inactive phases
2016-02-21 18:05:13 +01:00
Andreas Lauser
e30b43ad7e fix a bunch of deprecation warnings caused by OPM/opm-parser#687 2016-02-19 23:32:52 +01:00
Andreas Lauser
32980c57d9 black-oil PVT: bail out from trying to initialize PVT objects for inactive phases
this should fix twophase decks, see
https://github.com/OPM/opm-autodiff/pull/576#issuecomment-185770114.
2016-02-19 14:22:40 +01:00
Joakim Hove
54542d997b Merge pull request #122 from jokva/unique-auto-deck
Change Deck access methods/types to references
2016-02-18 22:59:51 +01:00
Andreas Lauser
b8d08e7b52 EclMaterialLawManager: make the function which provides the scaled drainage end points public
That is because they might have to modified externally (e.g. if
SWATINIT is computed and applied externally).
2016-02-17 18:56:54 +01:00
Jørgen Kvalsvik
cedb629f6d Change Deck access methods/types to references
opm-parser#677 changes the return types for the Deck family of classes.
This patch fixes all broken code from that patch set.

https://github.com/OPM/opm-parser/pull/677
2016-02-16 16:09:56 +01:00
Andreas Lauser
09f02eb2f4 fluid states: clean up the remaining modules w.r.t. references vs values 2016-02-12 18:43:15 +01:00
Andreas Lauser
307cc6c0f0 clean up the overlay fluid state w.r.t. the type which they return
if the base fluid state returns a reference, the overlay fluid state
should just pass it through instead if copying it. The difference
became relevant with the introduction of Evaluations for localized
AD. (is not relevant if Scalars are floating point values, which was
the only choice when the overlay fluid states were written.)
2016-02-12 18:43:15 +01:00
Andreas Lauser
3ad0c087ca distinguish between rvalues and lvalues in MathToolbox::toLhs<LhsEval>()
the problem is that references to lvalues can be just passed through,
whilst the objects the rvalue references point are temporary and thus
need need to be copied. Fixing this issue forced me to go into the
rabbit hole of the c++ memory model, but at least I guess I now know
what rvalue references ('Foo&&' instead of 'Foo&') are good for...
2016-02-12 18:43:08 +01:00
Andreas Lauser
78db8b01d5 test_fluidsystems: fix valgrind complaints about unused memory
I doubt that this is the reason for this test's segfault on Jenkins,
but it that was a real (if minor) issue...
2016-02-12 11:49:38 +01:00
Andreas Lauser
39933a747b MathToolbox: return a constant reference for toLhs() (if possible)
also improve the documentation somewhat. (it was a bit "raw on its
teeth".)
2016-02-05 18:53:05 +01:00
Andreas Lauser
4dc417fcca squelch extra-pedantic clang and GCC warnings and fix the headercheck
once more, OPM/opm-parser#661 was the culprit for the headercheck.
2016-02-01 13:39:29 +01:00
Andreas Lauser
397f6c67a7 LocalAd: fix the return type of toLhs<LhsEval>()
instead of always copying to the return value we now simply pass
through a const reference if possible.
2016-01-30 14:33:37 +01:00
Andreas Lauser
bb82a6b5e3 black-oil fluid system: take advantage of fluid states which provide Rs() and Rv() directly
this avoids converting Rs and Rv to mass fractions (as provided by the
generic fluid system API) just to immediately convert them back to
dissolution factors (as required by the blackoil PVT objects).

Note that the implementation of this is a bit ugly because it requires
advanced C-preprocessor usage and higher
template-meta-programming-foo. Any ideas of how to do this in a
simpler fashion are welcome.
2016-01-29 19:58:07 +01:00
Andreas Lauser
c0d680adb6 black-oil PVT: implement thermal PVT properties
the primary goal of this patch is to implement what's currently
provided by the opm-core PVT classes, and it is thus not very
comprehensive: some non-standard keywords are required (e.g.,
GCOMPIDX), there has been some guess-working going on, some approaches
are only consequences of what the ECL documentation says (but is not
mentioned explicitly anywhere) and the relations for enthalpy are
still missing (i.e., the quanties provided are insufficient to
implement an energy conservation equation).

the patch works by adding a boolean 'enableTemperature' template
parameter to the multiplexer classes which is set to 'true' by
default. if it is detected that the PVT properties are thermally
dependent the respective *PvtThermal class is used (which in turn
creates an isothermal multiplexer internally).

the schema for the names of the thermal PVT classes
(${PHASE}PvtThermal) is a bit inconsistent with that used for
isothermal PVT classes (${APPROACH}${PHASE}Pvt) which was done to
avoid naming conflicts with the current opm-core PVT classes.
2016-01-29 19:57:58 +01:00
Andreas Lauser
2fce78289f black-oil fluid system: introduce methods to convert mole- into mass fractions
... only for the solutes of hydrocarbon phases.
2016-01-29 19:42:51 +01:00
Andreas Lauser
abc0caea7a black-oil PVT: provide inverse formation volume factors
this makes things go less in circles: before this patch, the
interpolation happened on the inverse formation volume factors, the
PVT classes inverted the result to get the FVF and then the calling
code divided by what fell out of this. Now, the calling code can
directly multiply with the result of the interpolation.
2016-01-29 19:42:09 +01:00
Andreas Lauser
c780233ad1 black-oil PVT: remove the density related methods
instead, the calling code needs to directly use the formation volume
factors to calculate it.
2016-01-29 19:27:52 +01:00
Andreas Lauser
d29c85dc9a blackoil-pvt: introduce a numRegions() method 2016-01-29 19:27:52 +01:00
Andreas Lauser
fc933ef94d blackoil-pvt: simplify the initialization from an ECL-deck
now if the object is initialized using the initFromDeck() method, a
call to initEnd() is not required anymore. IMO, this makes the API
easier to use and more bullet-proof.
2016-01-29 19:27:52 +01:00
Andreas Lauser
fa5a2f66a1 make the meat of the unit tests for fluid states and fluid systems available publicly 2016-01-29 19:27:52 +01:00
Andreas Lauser
58c9022a98 fix a compiler warning 2016-01-29 19:27:52 +01:00
Andreas Lauser
3e54344556 black-oil fluid system: remove some spurious spaces 2016-01-29 19:27:52 +01:00
Andreas Lauser
7c15621160 pvt multiplexers: don't spill the multiplexer macros
the #undef directives were wrong or missing...
2016-01-29 19:27:52 +01:00
Jørgen Kvalsvik
3bbfa75644 Improve includes from opm-parser
Adopting to opm-parser PR#661, add previously missing includes.

https://github.com/OPM/opm-parser/pull/661
2016-01-26 13:27:25 +01:00
Andreas Lauser
5d270f4436 make all headers stand-alone again
i.e., after this all headers are supposed to be fully autonomous again
and can thus be included without preconditions. this property broke
when OPM/opm-parser#656 was merged.
2016-01-21 13:14:01 +01:00
Jørgen Kvalsvik
d1a2924e08 Fixes missing includes (opm-parser PR-656)
Adds missing includes which due to PR-656 in opm-parser are no longer
automatically pulled from other headers.
2016-01-19 14:11:44 +01:00
Andreas Lauser
29254f2fcc components: fix build failures caused by implicit casts to double
normally this is not a problem, but template functions which take two
arguments, will break, i.e., the following will not compile

```c++
float f = 1.23;
std::max(f, 2.0*f);
```

this is because the second argument for max gets silently cast to
`double` which causes the compiler to be confused because it cannot
determine a uniform type for the arguments passed to
std::max<T>(a, b)...
2016-01-15 16:03:29 +01:00
Andreas Lauser
fe44bcc8f9 Spline: consistently use the same (template) code for the scalar and Evaluation<> cases 2016-01-15 16:01:45 +01:00
Robert Kloefkorn
92062f009c PengRobinson: make compile when Scalar is not double. 2016-01-14 17:27:44 -07:00
Robert Kloefkorn
c6c44acb4c LiveOilPvt/WetGasPvt: return value of vectorCopy is std::vector<double>. 2016-01-14 17:27:11 -07:00
Andreas Lauser
cf7d072399 remove some unneeded spaces 2016-01-14 19:35:21 +01:00
Andreas Lauser
890fdf54f7 fix the table handling code for live oil
the recent table refactoring replaced the compile-time-safe approach
to columns (i.e., table.getFooColumn()) by a generic method which
requires a magic cookie (i.e., table.getColumn("FOO")). Unfortunately,
this went belly-up with the viscosity column of the PVTO table (here
the magic constant is "MU" and not "MUO". Note that in this respect,
opm-parser is inconsistent w.r.t. the column of the formation volume
factor which is called "BO" and not "B".)

there were also some additional typos: the gas dissolution factor is
"RS" and the pressure of oil is "P".

It probably gets time to make the opm-core/opm-autodiff PVT code use
the stuff from opm-material so that this receives some run-time
testing with `flow` during development. (currently this is only used
by `ebos`...)
2016-01-14 19:33:39 +01:00
Joakim Hove
df618f43a6 Merge pull request #103 from joakim-hove/table-column
Using new table api
2016-01-08 15:29:04 +01:00
Joakim Hove
d8898a1c1a Update EclMateriallawmanager to use new Table api. 2016-01-08 14:35:23 +01:00
Joakim Hove
20310cdd81 Updated LiveOilPvt and WetGasPvt to new Table api. 2016-01-08 14:35:22 +01:00
Andreas Lauser
e2e05f53f6 Merge pull request #106 from andlaus/remove_asserts
EclEpsScalingPoints: Remove some spurious asserations
2016-01-05 12:10:46 +01:00
Joakim Hove
bc56a40992 Removed assert - allow nonzero min swat. 2016-01-05 12:02:22 +01:00
Andreas Lauser
10f2397c6a EclEpsScalingPoints: Remove some spurious asserations
these were added to make sure that the input data confirms to what is
required by the ECL documentation. It is better to do these
consistency checks externally, though. (and also not just in debug
mode.)
2016-01-05 12:00:39 +01:00
Andreas Lauser
7068aa3669 fix clang-3.5 and GCC-4.9 extra-pedantic warnings
hopefully this fixes all of them. While doing this, I noticed that the
warnings produced by GCC 5 and GCC 4.9 differ. I did not try to
compile it with GCC 5, though.
2016-01-04 15:31:43 +01:00
Andreas Lauser
b515b9ddc0 remove some unneeded consts
they do not affect the result of the compilation and IMO just look
ugly. (I'm aware that there are other opinions.)
2016-01-04 15:31:38 +01:00
Andreas Lauser
b6bca92907 NcpFlash: change the default tolerances
for the most common case (i.e., Scalar == double) the previous method
lead to a tolerance of 10^-3 (relative) which is way too much if an
absolute tolerance of 10^-8 kg/(m^3*s) is required by the model.
2016-01-04 15:31:36 +01:00
Andreas Lauser
9c0fe9eb4c black-oil fluid system: some stylistic and comment cleanups 2016-01-04 15:31:34 +01:00
Andreas Lauser
8d1e470559 black-oil fluid system: some functional changes
- avoid the discontinuity between saturated and undersaturated
  hydrocarbon density and viscosity. This introduces a dependency of
  density and viscosity on the saturation of gas and oil which does
  not make much sense from a physical POV. (note that the dependency
  on the phase saturations was already there, but it was a
  discontinuous one, i.e., it dependeded on S_{o,g} > 0 instead of on
  S_{o,g})
- fixes for the fugacityCoefficient() method (it now also works for
  wet gas and dead oil, i.e., it avoids a division by zero for
  immiscible hydrocarbon phases.)
2016-01-04 15:31:32 +01:00
Andreas Lauser
91508eb6e1 black-oil fluid system: introduce black-oil specific variants of the methods
i.e., the PVT region index is passed directly to them and the
ParameterCache objects are not required. also:

- convert all methods to fluid states instead of passing the dependent
  parameters directly.
- do no longer encode the phase or component names in the method names
  of the fluid system.
2016-01-04 15:31:30 +01:00