Commit Graph

742 Commits

Author SHA1 Message Date
Andreas Lauser
e047e85f54 DenseAD: simplify the min(), max() and abs() functions
note that while this simplifies the source code, the performance of
the binaries should be unaffected.
2016-10-30 19:01:06 +01:00
Andreas Lauser
48d570afc5 DenseAD: add copyDerivatives(x) and clearDerivatives() methods to Evaluation
this makes it possible to implement these functions more
efficiently...
2016-10-30 19:01:06 +01:00
Andreas Lauser
a289230202 Merge pull request #174 from andlaus/valgrind_cr_improvements
minor Valgrind client request improvements
2016-10-27 17:55:16 +02:00
Andreas Lauser
7bb2fdff20 fix some minor documentation bugs in Valgrind.hpp 2016-10-27 17:47:32 +02:00
Andreas Lauser
3f3d6355af Valgrind helpers: add client request to check if a memory range is accessible
the function is called `Valgrind::CheckAddressable(object)`.
2016-10-27 17:47:32 +02:00
Andreas Lauser
b7dd411c1c Merge pull request #169 from andlaus/implement_JFUNC
implement ECL-like Leverett capillary pressure scaling
2016-10-21 09:47:20 +02:00
Andreas Lauser
ab2650923d implement ECL-like Leverett capillary pressure scaling
i.e., this patch deals with the JFUNC ECL keyword.
2016-10-20 19:57:27 +02:00
jokva
0a09945fb6 Merge pull request #170 from jokva/remove-shared-ptr
The great shared_ptr purge
2016-10-20 19:19:13 +02:00
Andreas Lauser
c547e36877 Merge pull request #172 from andlaus/add_isfinite_and_isnan
MathToolbox: add isfinite() and isnan() methods
2016-10-19 21:49:24 +02:00
Andreas Lauser
98898cae1d MathToolbox: add isfinite() and isnan() methods
for primitive floating point objects, these correspond to
std::isfinite() and std::isnan() while for evaluations, they trigger
on the evaluation's value or any of its derivatives being non-finite
or NaN. (i.e., for evaluations they should be better called
containsnonfinite(), containsnan().)
2016-10-19 21:46:23 +02:00
Andreas Lauser
34c9e1efe9 Merge pull request #171 from andlaus/improve_comment
H2O-Air henry coefficient: improve citation in comment
2016-10-19 14:55:50 +02:00
Andreas Lauser
c84dca9f95 H2O-Air henry coefficient: improve citation in comment
this change has been motivated by a recent Dumux commit...
2016-10-19 14:52:22 +02:00
Jørgen Kvalsvik
2532f1e56e Update to shared_ptr-less parser interface. 2016-10-13 14:49:48 +02:00
Tor Harald Sandve
cc6dcccf85 Merge pull request #168 from andlaus/fix_zero_base_pow
DenseAD: special case the base == 0.0 case
2016-09-16 09:07:34 +02:00
Andreas Lauser
1236009d3e DenseAD: special case the base == 0.0 case
if this is not done the generic code produces NaNs. (either by using
the result of ln(0.0) or by means of a division by zero.)

This seems to fix the linearization of flow_ebos for "Model 2".
2016-09-16 00:09:45 +02:00
Andreas Lauser
1941f9717f Merge pull request #167 from qilicun/Remove-endscale-options-check
remove the ENDSCALE options check, they're handled by flow.
2016-09-15 13:56:49 +02:00
Liu Ming
04c05d658d remove the ENDSCALE options check, they're handled by flow. 2016-09-09 10:29:31 +08:00
Andreas Lauser
18c44e7285 Merge pull request #166 from babrodtk/warning_fixes
Fixed warning of (potentially) uninitialized variables
2016-09-06 09:43:19 +02:00
babrodtk
c67a7d3a25 Fixed warning of (potentially) uninitialized variable 2016-09-06 08:09:33 +02:00
Atgeirr Flø Rasmussen
32c1d6b66f Merge pull request #162 from andlaus/densead_convenience_functions
dense AD: introduce convenience functions
2016-08-15 12:20:19 +02:00
Andreas Lauser
e33fc441b3 Dense AD convenience functions: introduce scalarValue(x) and getValue(x)
`getValue(x)` should be better called `value(x)` but this leads to
really cryptic compiler errors which seem to be related to the fact
that the Evaluation class has a `value` attribute (this is for GCC
5.2.1).
2016-08-11 16:54:15 +02:00
Andreas Lauser
d21a6fbefe dense AD convenience functions: add decay<LhsEval>()
with this, evaluation objects can be decayed via
`Opm::decay<Scalar>(x)`. since function templates do not require a
'template' qualifier, it is a bigger advantage for this function that
for the mathematical ones. (the conventional way to do this is way
more verbose:

```c++
Opm::MathToolbox<Evaluation>::template decay<Scalar>(x)
```
)
2016-08-11 16:43:10 +02:00
Andreas Lauser
62de45a665 dense AD convenience functions: determine the return type in a smarter way
we now take the type which can by assigned by the other. this is still
not perfect because the result may be surprising for cases like
'double' and 'int', but it is much better than the situation before.
2016-08-11 16:43:10 +02:00
Andreas Lauser
9f465784a8 dense AD: introduce convenience functions
this PR was inspired by one of @atgeirr's recent comments. it allows
to get rid if the `MathToolbox<Eval>` detour for the dense AD code in
most cases: e.g. instead of writing

```c++
template <class Eval>
Eval f(const Eval& val)
{ return Opm::MathToolbox<Eval>::sqrt(val); }
```

one can simply write

```c++
template <class Eval>
Eval f(const Eval& val)
{ return Opm::sqrt(val); }
```

and it will work transparently with DenseAD `Evaluation` objects and
primitive floating point values.

one complication of this is that the type of the `Evaluation` object
does not need to be explicitly defined. for functions which take more
than one argument (like e.g. `pow()`, `min()` and `max()`), it is thus
assumed that the type of the result is the same as the type of the
first argument.

another drawback is that when both, the contents of the `Opm::` and
the `std::` namespaces are implicitly available, it is not clear to me
what's used for primitive floating point values. (it seems to compile
but IMO it could lead to surprising behaviour. thus, please only merge
if you consider the benefits of these convenience functions to be
greater than their drawbacks.)
2016-08-11 15:54:03 +02:00
Andreas Lauser
32e5630ae7 Merge pull request #160 from andlaus/fix_vappars
fix inconsistency in the VAPPARS treatment of wet gas
2016-08-09 13:05:25 +02:00
Andreas Lauser
219ec18c6e fix inconsistency in the VAPPARS treatment of wet gas
in contrast to live oil, there it was not conditional on whether the
oil saturation was smaller than the maximum observed one.
2016-08-09 13:03:06 +02:00
Andreas Lauser
7910a54947 Merge pull request #159 from pgdr/downstream-transmult-and-shared_ptrs
use ref constructor for EclipseState
2016-08-08 12:51:54 +02:00
Pål Grønås Drange
e7a89ea838 use ref constructor for EclipseState 2016-08-08 10:04:45 +02:00
Andreas Lauser
30a6d3ea87 Merge pull request #158 from andlaus/VAPPARS_changes
blackoil PVT: treat the maximum oil saturation for VAPPARS a constant
2016-08-02 15:15:51 +02:00
Andreas Lauser
9074f1ccca blackoil PVT: treat the maximum oil saturation for VAPPARS a constant
also, only calculate a factor if the currently observed oil saturation
is smaller than the maximum oil saturation. The new code is not
completely equivalent to the old one because derivatives are not
considered if the oil saturation increases, but the differences should
be small and they should be closer to how the current master version
of opm-simulators handles VAPPARS.
2016-08-02 15:10:49 +02:00
Andreas Lauser
c445e7414e Merge pull request #154 from andlaus/implement_vappars
implement the E100 VAPPARS keyword
2016-07-06 18:41:33 +02:00
Atgeirr Flø Rasmussen
739bb51cc2 Merge pull request #156 from andlaus/fix_MaterialLawManager
MaterialLawManager: don't use the materialLawParamsPointer() method in materialLawParams()
2016-07-06 14:52:04 +02:00
Andreas Lauser
0d4996f43f EclMaterialLawManager: rename the *Pointer() methods to something more appropriate
they are now called materialLawParamsPointerReferenceHack() and
oilWaterScaledEpsInfoDrainagePointerReferenceHack() which -- in my
opinion -- describes better what they do and which are also
sufficiently clunky and scary names to deter people from using them.
2016-07-06 12:57:51 +02:00
Andreas Lauser
7192a3495e MaterialLawManager: don't use the materialLawParamsPointer() method in materialLawParams()
this fixes the issue of https://github.com/OPM/opm-material/pull/155
in a better manner. (I hope.)
2016-07-06 11:12:09 +02:00
Andreas Lauser
30d3b68df4 implement the E100 VAPPARS keyword
this is yet another crazy Eclipse hack: it prevents the dissolved
component to be fully assimilated by solvent phases if the maximum oil
phase saturation seen during the simulation stays below a given
limit...
2016-07-05 17:16:58 +02:00
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