Commit Graph

108 Commits

Author SHA1 Message Date
Trine Mykkeltvedt
59a521d46d added new cubic solver from Svenns old branch, also made a phaseStabilityTestMichelsen_ with the same wrapping as julia code - this does not work with newton right now. BUT the fix of the roots makes the stabilitytest give similar K as Olavs Julia code. Will never be completely equal due to minimization through gibbs (not implemented in opm) which will different choize of roots 2022-06-08 08:46:52 +02:00
Trine Mykkeltvedt
f4e6b700a3 added Svenns cubic solver 2022-06-08 08:46:52 +02:00
Markus Blatt
dd1bb73472 Fixed old type extend -> extent 2021-09-28 17:07:25 +02:00
Markus Blatt
868531e414 Extrapolate for values not in domain (UniformTabulated2DFunction/liquidDensity).
Extrapolate liquidDensity for unreasonable
pressure/temperature (Brine) and in UniformTabulated2DFunction.
In the current code the interpolation actually already works if the
values are outside of the tabulated region.

With this change there is now an additional function parameter
If it is true we will interpolate for every value instead of throwing
and aborting (was the case always before).
2021-09-28 16:34:42 +02:00
Arne Morten Kvarving
24dba01e99 changed: get rid of OPM_UNUSED macro usage
prefer anonymous parameters and c++17 [[maybe_unused]]
2021-08-03 09:32:02 +02:00
Arne Morten Kvarving
50c8cbea78 fixed: do not assert conditions guaranteed by unsigned 2021-06-18 13:24:02 +02:00
Arne Morten Kvarving
1a75bd9ab4 avoid signed/unsigned comparison warnings 2021-06-09 08:30:39 +02:00
Arne Morten Kvarving
69970a0602 add missing includes 2021-06-09 08:30:01 +02:00
Arne Morten Kvarving
6689e6d08f fixed: do not use Opm:: prefix within Opm namespace part 2
have to use anchoring to root namespace in some places due
to overlapping namespace and class type names.
2021-05-05 21:58:33 +02:00
Arne Morten Kvarving
75b2609336 test if apple clang likes this better 2020-12-08 15:27:50 +01:00
Joakim Hove
1315acfe51 Remove unusued #include common excpetions 2020-09-21 10:56:05 +02:00
Arne Morten Kvarving
8909d471e8 disable assert
this triggers while running a thermal deck (SPE1CASE2_THERMAL),
but there is no apparent reason why it is an error.
2020-01-29 08:48:39 +01:00
Arne Morten Kvarving
059c6b58aa add accessors and equality operator to Uniform(X)Tabulated2DFunction 2019-12-19 10:45:05 +01:00
Arne Morten Kvarving
52d310760b add accessors and equality operator to IntervalTabulated2DFunction 2019-12-19 10:32:47 +01:00
Arne Morten Kvarving
5a23d7ffca add accessors and equality operator to Tabulated1DFunction 2019-12-19 10:27:50 +01:00
Arne Morten Kvarving
8c2cb50569 added: OPM_UNUSED_NOMPI
for suppressing unused variable warnings when a variable
is unused if compiled without MPI
2019-06-28 13:49:13 +02:00
Kai Bao
292e84ec08 fixing the compilation problem related to DenseAD 2019-06-12 14:53:54 +02:00
Andreas Lauser
3b933ae42a unify the creation of evalutions
to create a constant, there are now always the three functions

Opm::constant<Eval>(value);
Opm::constant<Eval>(numDeriv, value);
Opm::constant<Eval>(x, value); // with 'x' being the 'template' of the returned value

If a given call does not make sense, an exception is thrown:

- Plain floating point objects like `float`, `double` or `quad`
  complain if the specified number of derivatives is not zero.
- Statically sized evaluations throw if the specified number of
  derivatives of passed to the function is not equal to their static
  size.
- Dynamically sized evaluations complain if the number of derivatives
  cannot be determined.

The third variant of `Opm::constant()` works unconditionally. The
`Opm::variable()` helpers are modified analogously.
2019-06-12 11:50:37 +02:00
Tor Harald Sandve
a62ea4b0f1 Add log10 AD function 2019-06-03 11:22:42 +02:00
Andreas Lauser
438653d0b5 UniformXTabulated2DFunction: minor cleanups 2019-05-03 14:30:30 +02:00
Atgeirr Flø Rasmussen
77c963167f Merge pull request #328 from atgeirr/interpolation_2d_miscibility_fix
Interpolation 2d miscibility fix
2019-04-02 08:20:02 +02:00
Atgeirr Flø Rasmussen
f8d11efe82 Added explanatory comments about the use of 'shift'. 2019-04-01 14:08:18 +02:00
Atgeirr Flø Rasmussen
322c6fb0ff Address review issues. 2019-03-29 11:48:35 +01:00
hnil
5399d72477 Change 2D interpolation of live oil and wet gas.
Interpolation is now done parallel to the saturated/unsaturated boundary lines,
instead of axis-aligned.
2019-03-22 14:08:28 +01:00
Kai Bao
a1396bb237 Doxygen documents for FastSmallVector 2019-03-21 21:56:28 +01:00
Andreas Lauser
1e7d566a93 clean up the new FastSmallVector class
also, this fixes some potential memory leaks if vectors of different
sizes are assigned and it fixes the assignment-to-self (`x = x`) case.
2019-03-20 12:41:57 +01:00
Andreas Lauser
7c1bda6df1 rename XYTabulated2DFunction to IntervalTabulated2DFunction
... because every 2D function depends on two variables which are
usually called X and Y. The name of that class is still clunky,
suggestions are appreciated.

(also, UniformXTabulated2DFunction is a bad name. I also take
suggestions for that.)
2018-12-20 13:38:03 +01:00
Andreas Lauser
7a4c6546b4 fix some coding style isses in new class XYTabulated2DFunction and its test 2018-12-20 13:38:03 +01:00
Kai Bao
17264e0873 addressing reviewing comments from PR#137 2018-12-11 10:58:49 +01:00
Kai Bao
25e01bd962 removing the duplicate code in XYTabulated2DFunction 2018-12-11 10:33:52 +01:00
Kai Bao
9bf6d01acc adding a test for XYTabulated2DFunction 2018-12-06 13:19:04 +01:00
Kai Bao
889ff8f0a5 some cleaning up of XYTabulated2DFunction 2018-12-03 10:30:27 +01:00
Kai Bao
bbfafad2da various fixes to make DynamicEvaluation work with simulations 2018-11-30 15:34:26 +01:00
Kai Bao
6c20ecad14 adding table XYTabulated2DFunction 2018-11-30 15:34:26 +01:00
Andreas Lauser
8cde35ef7b MathToolbox: fix unused argument warning 2018-07-05 12:50:54 +02:00
Andreas Lauser
f316b0699e add an Opm::blank(Evaluation) function
this creates an uninitialized "compatible" evaluation that is
compatible with its argument. For primitive floating point types and
statically-sized Evaluations, this is identical to calling the default
constructor, for dynamically sized ones, it creates an uninitialized
Evaluation object of identical size as the argument.

thanks to [at]GitPaen for the heads up.
2018-06-28 17:27:48 +02:00
Andreas Lauser
86a377dc1e make the quadruple precision math support code compatible with dune-fem
the stream operators are actually the ones for double precision.
2018-05-17 11:30:31 +02:00
Andreas Lauser
9891b2a3c7 make it work with the latest dune master
Dune::set_singularity_limit() has been removed there and std::real()
gets used by the dense matrix-vector code (this causes trouble if
`quad` is selected as scalar type)
2018-03-12 13:58:45 +01:00
Atgeirr Flø Rasmussen
da4b160438 Include <stdexcept> for std::runtime_error. 2018-02-14 13:02:40 +01:00
Andreas Lauser
27386851a2 move some basic infrastructure from opm-common to here
all of these classes have only been used in opm-material and its
downstreams in the first place.
2018-02-07 16:44:44 +01:00
Atgeirr Flø Rasmussen
a9018ece34 Add OPM_UNUSED to unused temperature arguments. 2018-01-30 15:06:26 +01:00
Andreas Lauser
ab0183f6d8 quad.hpp: simplify the error prevention mechanism for Dune::className()
there is no need to include quad.hpp before dune's
classname.hh. Instead we just include classname.hh into quad.hpp and
it will work unconditionally.
2017-12-14 10:42:23 +01:00
Andreas Lauser
53d9d92d65 make Tabulated1DFunction more consistent with UniformXTabulated2DFunction
these are basically cosmetic cleanups.
2017-12-11 15:35:01 +01:00
Andreas Lauser
94b6124fba improve implementation of UniformXTabulated2DFunction
in particular, do not mingle the segment index and the relative
position within the segment into a single number anymore.
2017-12-11 15:35:01 +01:00
Robert Kloefkorn
aec9fe5834 [cleanup] make code compile when Scalar is non POD type. 2017-06-23 10:46:55 +02:00
Andreas Lauser
87222f3c6a disable a static assertation in the DenseAD convenience functions
the problem is that some of these function names clash with those for
code using AutoDiffBlock. This is normally not a problem because of
the SFINAE rule, but the static assertation makes the compiler bail
out before SFINAE kicks in.

IMO this is a little unfortunate because without this static_assert
compiler errors are bound to becomming quite a bit more obscure, but
as long there is code which uses both AD approaches at the same time,
I cannot see a way to keep the assert without moving one approach or
the other to a different namespace (or renaming the math function for
one).
2017-06-14 11:06:04 +02:00
Andreas Lauser
0f6540bdad DenseAD: make less fuzz about it
this patch converts to code to use the convenience functions instead
of the math toolboxes whereever possible. the main advantage is that
Opm::foo(x) will work regardless of the type of `x`, but it also
reduces visual clutter.

also, constant Evaluations are now directly created by assigning
Scalars, which removes further visual noise.

while I hope it improves the readability of the code,
functionality-wise this patch should not change anything.
2017-06-13 17:25:03 +02:00
Andreas Lauser
acfa7c43e5 convenience functions: use the raw type for results
i.e., we should not return references and we also should remove the
const qualifier in this context. (if these are wanted, the calling
scope should add them.)
2017-06-13 17:18:47 +02: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