Commit Graph

407 Commits

Author SHA1 Message Date
Andreas Lauser
56022bb9f6 use 1e30 instead of 1e100 to indicate a "way too large" value
10^100 cannot be represented by single-precision floating point values
and 10^30 is large enough considering the fact that the distance from
Earth to Alpha-Centauri is "only" about 4*10^16 m...
2016-07-05 17:00:40 +02:00
Atgeirr Flø Rasmussen
b50aa8a094 Silence unused argument warning. 2016-06-29 09:06:29 +02:00
Andreas Lauser
f20b87ae1f Merge pull request #151 from andlaus/introduce_phasePresence
FluidStates: introduce phaseIsPresence(phaseIdx)
2016-06-27 15:49:44 +02:00
Andreas Lauser
4b01433dcc FluidStates: introduce phaseIsPresence(phaseIdx)
by default, this just checks if the saturation of the incriminating
phase is larger than 0, but in some cases (i.e., black-oil) the
calling code might have a different opinion: E.g., the black-oil model
looks at the primary variables to determine the phase presence.
2016-06-27 15:39:07 +02:00
Andreas Lauser
a4200d81c8 Merge pull request #150 from andlaus/add_phase_component_mappings
BlackOilFluidSystem: add mappings from the phase index to its solute and solvent components
2016-06-25 12:28:51 +02:00
Andreas Lauser
afe4f666c8 BlackOilFluidSystem: add mappings from the phase index to its solute and solvent components
this is quite black-oil specific: it assumes that each phase has at
most one solute. (i.e., the number of components per phase is at most
two.)
2016-06-25 12:22:36 +02:00
Andreas Lauser
55c2bc9c45 Merge pull request #147 from andlaus/localad_to_densead
rename "LocalAd" to "DenseAd"
2016-06-06 14:02:36 +02:00
Andreas Lauser
ad253d699f rename MathToolbox::toLhs to MathToolbox::decay
this is because this method is completely analogous to std::decay()...
2016-06-03 21:28:45 +02:00
Andreas Lauser
9bbe67d19f rename "LocalAd" to "DenseAd"
Since "dense automatic differentiation" describes what this code is
all about much better in my opinion. ("Local AD" is just a possible
use case in the context of PDE discretization.)
2016-06-03 21:28:45 +02:00
Andreas Lauser
8778e29ae2 Merge pull request #146 from andlaus/fix_dune_2.3_warnings
fix warnings from Evaluation.hpp when using Dune 2.3
2016-05-14 12:10:56 +02:00
Andreas Lauser
a33a1eac86 fix warnings from Evaluation.hpp when using Dune 2.3
these warnings were caused by the fmatrix.hh header being included
before Evaluation.hpp. While they were harmeless, they were annoying.

(I did not discover this earlier because I normally use Dune 2.4 which
does not have this particular issue.)
2016-05-14 12:04:50 +02:00
Andreas Lauser
405031f6b5 Merge pull request #143 from andlaus/fix_build
fix the build
2016-04-20 16:16:02 +02:00
Andreas Lauser
e245988709 fix the build
this change is trivial: seems like a rename not accounted for for some
reason.
2016-04-20 16:14:22 +02:00
Joakim Hove
e48817fb35 Merge pull request #141 from pgdr/eclipsegrid-is-input
Using getInputGrid API from Parser
2016-04-20 15:57:21 +02:00
Atgeirr Flø Rasmussen
4d253a1a5a Merge pull request #142 from andlaus/various_fixes
Various fixes
2016-04-20 15:38:49 +02:00
Andreas Lauser
71da62bebe fix some signedness issues
mainly these issues stemmed from the fact that floating point values
can be negative and casting negative values to unsigned integers leads
to very large unsigned values instead of 0.
2016-04-20 15:37:09 +02:00
Andreas Lauser
05bf95d232 use Toolbox::scalarValue() instead of Toolbox::value() where appropriate
in opm-material "where appropriate" is equivalent to "everywhere" as
far as I can see.
2016-04-20 11:38:17 +02:00
Andreas Lauser
c132bcc018 H2O: fix a Scalar vs Evaluation issue
actually, this patch should not change the result at all, but the code
is probably less confusing that way...
2016-04-20 11:38:15 +02:00
Andreas Lauser
c764df8166 Brine: fix some Scalar vs Evaluation issues 2016-04-20 11:38:13 +02:00
Andreas Lauser
70c4000f8b Evaluation<>: fix the corner cases where the scalar object which is used is part of the evaluation itself
this only affects `operator/=()` and `operator*=()`, the addition and
subtraction operators will work fine even if `other` is contained in
`this`.
2016-04-20 11:38:11 +02:00
Pål Grønås Drange
a5b70b1119 Using getInputGrid API from Parser 2016-04-19 16:54:35 +02:00
Andreas Lauser
13c9df45f6 Merge pull request #140 from atgeirr/silence-warning
Silence warnings
2016-04-19 14:39:00 +02:00
Atgeirr Flø Rasmussen
0a4578ad15 Silence warning from Dune header. 2016-04-18 15:11:40 +02:00
Atgeirr Flø Rasmussen
6bc5ee0d0e Silence unused argument. 2016-04-18 15:11:16 +02:00
Andreas Lauser
ee4dd837ea Merge pull request #138 from andlaus/nested_ad
Nested AD and opm-material spring cleaning
2016-04-18 11:01:03 +02:00
Andreas Lauser
3e7e35a2a1 squelch masochisic compiler warnings
this is the clang-3.9 and GCC 6.0 edition for the OPM 2016.04 release.
2016-04-17 11:42:33 +02:00
Andreas Lauser
28333c3f54 make the unit tests for the flash solvers bite if they detect an error
so far, they only printed a warning. in this case the error message
was usually ignored and the test was counted as 'passed'. (before the
switch of the flash solvers to use automatic differentiation, this
happened in some cases where single precision floating point scalars
were used.)

not anymore: now an exception is thrown and the test is aborted if an
error is detected.
2016-04-17 11:42:33 +02:00
Andreas Lauser
dbb707ede5 convert the flash constraints solvers to use automatic differentiation
this fixes some precision issues with single-precision floating point
values as a nice side effect.
2016-04-17 11:42:33 +02:00
Andreas Lauser
7a27c5398e allow the Peng-Robinson EOS to be used with nested automatic differentiation 2016-04-17 11:42:33 +02:00
Andreas Lauser
d55f213653 make it possible to nest function evaluation objects
IMO this is pretty cool because it allows to transparantly calculate
higher order derivatives. for example this enables to implement the
linearization stage of higher-order non-linear solvers without much
additional effort compared to just evaluating the function in
question. (essentially, such higher order non-linear solvers are based
on truncating the Taylor series not after the first term -- like for the
Newton scheme -- but later. That said, they require to solve linear
systems of equations which involve tensors of orders greater than 2,
so they are not really practical as far as I can see.)

A more practical motivation for this is to allow the constraint
solvers to be used in "nested mode", i.e., linearizing the system of
equations they need to solve using automatic differentiation, but
allowing the value objects which are passed to the constraint solvers
be function evaluations themselves. (E.g. the result of a flash
calculation can also include the derivatives with regard to the
primary variables of the flow model. Note that the individual
constraint solvers need to some patches to make this work.)
2016-04-17 11:42:33 +02:00
Andreas Lauser
573e45d1a4 remove MathToolbox::passThroughOrCreateConstant()
this method is an artifact from the beginning of the automatic
differentiation code and is not needed anymore: its original pupose
was to be able to retain a full function evaluation object if it was
available or a function evaluation object representing a constant
function if only a primitive scalar is available. Nowadays, the method
can be replaced by a direct initialization:

template <class T, class V>
T fn(const V& v)
{ return T(v); }

is equivalent to

template <class T, class V>
T fn(const V& v)
{
    typedef Opm::MathToolbox<T> Toolbox;
    return passThroughOrCreateConstant(v);
}
2016-04-17 11:42:33 +02:00
Andreas Lauser
f94770092e move the approximate comparison code from the Evaluation to the Toolbox
i.e. the isSame() method. The reason is that this way it works
transparently with primitive floating point types.
2016-04-17 11:42:33 +02:00
Andreas Lauser
47c3d11403 Evaluation<>: remove the concept of "tags"
In my recent experience it did more harm than good: tags often made
the compiler errors mucht longer and more unreadable, and I have not
encountered a single instance where they were really helpful...
2016-04-17 11:40:59 +02:00
Andreas Lauser
8679d3a23c initialize MPI for all unit tests
This started to cause crashes for me. I don't really have an idea why,
but it is not too bad of a thing to do anyway...
2016-04-17 11:28:06 +02:00
Andreas Lauser
6f9451ba06 fluid systems: make the ParameterCache mechanism work with Evaluation<>
so far, using function evaluation objects instead of primitive
floating point scalars only worked for trivial parameter caches which
do not store any values (most of the time, this means that the
ParameterCache is `NullParameterCache`), or it explicitly did not work
(like for `Spe5ParameterCache`). this patch fixes the problem by
making the parameter caches of fluid systems template classes which
are templated on the type of scalar values. On the flipside, this
requires changes to all downstream modules that use fluid systems.
2016-04-17 11:28:04 +02:00
Andreas Lauser
d44dd50cb7 reduce the execution time of test_fluidsystems
this is done by reducing the default resolution of tabulated
components for the relevant fluid systems.
2016-04-17 11:28:02 +02:00
Andreas Lauser
801b1fef77 make test_pengrobinson faster
again, we just use less samples...
2016-04-17 11:28:00 +02:00
Andreas Lauser
35b5ad833b reduce the excution time needed by test_tabulation
instead of 200 samples in the pressure direction, let's be confident
with only 50...
2016-04-17 11:27:57 +02:00
Pål Grønås Drange
ac0652805d Using API get3DProperties() 2016-04-11 14:59:01 +02:00
Pål Grønås Drange
02beac295c Merge branch 'use-eclipse3dproperties' of github.com:pgdr/opm-material into use-eclipse3dproperties 2016-04-08 15:39:16 +02:00
Pål Grønås Drange
f1405bbafd Updated opm-material to use new opm-parser Eclipse3DProperties API 2016-04-08 15:31:32 +02:00
Pål Grønås Drange
65d9ee2924 opm-material uses new Eclipse3DProperties API 2016-04-05 11:47:40 +02:00
Pål Grønås Drange
6eddf22fc4 added lacking references in auto types (SimpleTable) 2016-04-01 16:44:23 +02:00
Pål Grønås Drange
88249811fc update opm-material repo to use Eclipse3DProperties API 2016-04-01 15:52:25 +02:00
Andreas Lauser
013eb6c17e Merge pull request #133 from andlaus/cleanup_preambles
clean up the licensing preable of source files
2016-03-17 13:12:51 +01:00
Joakim Hove
0f36222f7b Merge pull request #134 from qilicun/rename-ParseMode
rename ParserMode as ParseContext.
2016-03-17 09:51:38 +01:00
Liu Ming
bbf8d5d3a3 rename ParserMode as ParseContext. 2016-03-17 08:49:02 +08:00
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
Tor Harald Sandve
78fcbb1ed3 Merge pull request #132 from andlaus/ecl_water_viscosibility
handle the "viscosibility" of water with constant compressibility as documented by the ECL RM
2016-03-09 11:31:58 +01:00
Andreas Lauser
03c2ee8b4e handle the "viscosibility" of water with constant compressibility as documented by the ECL RM
this is basically a revert of 1d2ad56ba1.
2016-03-07 15:56:36 +01:00