Commit Graph

55 Commits

Author SHA1 Message Date
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
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
Tor Harald Sandve
f528b2c33f fix out of bound in CO2.hpp 2021-01-18 10:12:30 +01:00
Arne Morten Kvarving
75b2609336 test if apple clang likes this better 2020-12-08 15:27:50 +01:00
Tor Harald Sandve
28dd5a2b36 Merge pull request #427 from totto82/co2pvt
Add a co2brine pvt model
2020-10-02 12:26:19 +02:00
Tor Harald Sandve
15ff65ffcd Add a co2brine pvt model
The CO2BRINE model is activated by setting CO2STOR in the RUNSPEC section

The CO2 and brine pvt properties are computed based on pvt models in opm-material
- CO2 density is from Span and Wager (1996) as given in co2table.inc
- CO2 viscosity is from Fenhour et al (1998)
- Brine density and viscosity is based on H20 + correction based on Batzle and Wang (1992)
- H20 density is from Hu et al (2007)
- H20 viscosity is computed from density based on correlation given in IAPWS 97

At the current stage the oil-phase is used to model the brine. If a proper gas-water
simulator is made, the Brine PVT should be moved to the water phase.

Known limitations:
- Currently the viscosity of the Brine does not depend on the composition
- Salinity is assumed to be constant and given by SALINITY [mol/kg].
2020-10-01 16:15:39 +02:00
Joakim Hove
1315acfe51 Remove unusued #include common excpetions 2020-09-21 10:56:05 +02:00
Andreas Lauser
6cb7df3541 remove the Opm::FluidSystems namespace
this has mildly annoyed me for quite some time, and finally managed to
bring myself to changing it: The Opm::FluidSystems namespace is pretty
useless because the number of classes contained within it is quite
small and mismatch between the naming convention of the file names the
actual classes is somewhat confusing IMO. Thus, this patch changes the
naming of fluid systems from `Opm::FluidSystems::Foo` to
`Opm::FooFluidSystem`.

(also, flat hierarchies currently seem to be popular with the cool
people!?)

this patch requires some simple mop-ups for `ewoms` and `opm-simulators`.
2018-07-27 12:57:09 +02: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
0d613a7c25 N2: make the heat capacity consistent with the enthalpy again
I missed the fact that in the enthalpy() function, the polynomial
coefficients are divided, i.e., this component defines a polynomial
for the heat capacity and integrates it for the enthalpy. (not
the other way around.)
2017-11-17 19:09:01 +01:00
Andreas Lauser
db87b77896 fix heatCapacity() and enthaply() of some components
I looked at all components: For the ones that use simple enthalpy
relations, heatCapacity() and enthalpy() should now be
consistent. (Here "simple" means "an approach that I understood without
reading literature for several hours".)
2017-11-16 16:30:24 +01:00
Andreas Lauser
2b4114907e TabulatedComponent: don't catch std::exception by value
std::exception is a polymorphic type and catching these by values
generates warnings when using the latest GCC from SVN. Besides this,
catching objects by value is bad style and was unintended from the
start.
2017-07-27 18:04:43 +02:00
Andreas Lauser
b65defe489 make all headers autonomous again
i.e., they can be included without having other files included before them.
2017-07-20 12:08:47 +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
256fcd65d4 use log() instead of ln() to calculate the natural logarithm
it seems like ln() is non-standard and this piece of code only
compiled because that particular method is never instantiated.
2017-06-13 17:17:26 +02:00
Andreas Lauser
2e578ce6b3 Merge pull request #223 from andlaus/fix-test_components
Fix API test for components
2017-04-10 12:22:56 +02:00
Andreas Lauser
83d73f65e7 make all components compile properly with evaluations 2017-04-10 11:22:54 +02:00
Andreas Lauser
899437ac27 simple CO2: fix a snafu related to evaluations
in some places, it used primitive floating point objects when it
should have used Evaluations. This is probably not the only place
where this happens, but IMO the individual components are pretty low
priority.
2017-04-09 19:51:05 +02: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
39c5c94ac7 the new home of Valgrind.hpp is opm-common! 2016-12-14 09:46:21 +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
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
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
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
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
d52579277a use the error macros from opm-common 2015-10-08 11:49:10 +02:00
Andreas Lauser
731d2fccf1 various improvements
- add unit tests for the EclMaterialLawManager and the black-oil PVT classes
- rework the API of the blackoil PVT classes so that it follows the
  initFromDeck() pattern and uses multiplexer classes instead of
  dynamic polymorphism to select the concrete PVT approach
- the former change allowed to use the BlackOil fluid system with
  arbitrary Evaluations, i.e., it is not limited to a single
  Evaluation class which is specified as a class template argument
  anymore.
- more fixes for GCC and clang warnings. now it should be reasonably
  hard to trigger warnings using these compilers.

this commit squashes the following patches:

- add a unit test for the EclMaterialLawManager
- black oil: simplify the WaterPvtInterface
- add a unit test for the PVT classes of the black oil fluid system
- black oil: improvements to the PVT classes
- blackoil PVT: remove dynamic polymorphism
2015-09-29 14:09:19 +02:00
Andreas Lauser
a6499a01aa fix most of the warnings enabled by masochists
most of these people like to inflict pain on themselfs (i.e., warnings
in their own code), but they usually don't like if pain is inflicted
on them by others (i.e., warnings produced by external code which they
use). This patch should make these kinds of people happy. I'm not
really sure if the code is easier to understand with this, but at
least clang does not complain for most of the warnings of
"-Weverything" anymore.
2015-09-23 12:36:52 +02:00
Atgeirr Flø Rasmussen
1f42957755 Silence some unused argument warnings. 2015-09-11 13:37:31 +02:00
Andreas Lauser
99a61df00a re-add the vim and emacs modelines
conceptually, this may not be the purest conceivable solution, but it
is the most practical one.
2015-06-18 13:47:26 +02:00
Andreas Lauser
dadefcd3f3 make all components local-AD aware 2015-05-21 15:33:07 +02:00
Andreas Lauser
5b08de4244 incorperate all infrastructural classes required into opm-material itself
they used to be in opm-core, but this allows to be more flexible with
the dependency order: What's now called "opm-core" can easily depend
on opm-material which might come in handy for the refactoring.

Besides moving in classes from opm-core, the infrastructural code
which was still in opm-material is moved to the directory
opm/material/common. The intention is to collect these classes at a
central location to make it easy to move them to a real "core" module.
(if this is ever going to happen.)
2015-04-28 12:17:49 +02:00
Andreas Lauser
8f52b80448 refactor the 2D tabulation classes
- the StaticTabulated2DFunction class and the base class
  (Tabulated2DFunction) are gone
- the DynamicTabulated2DFunction class has been renamed to
  UniformTabulated2DFunction
- a new class called UniformXTabulated2DFunction has been
  introduced. Like UniformTabulated2DFunction, it assumes uniform
  intervalls of the sampling points in X direction, but in contrast to
  UniformTabulated2DFunction, the Y locations of the sampling points
  can be set freely (as long as they are specified in increasing order
  for each x value)
- add a unit test for the two tabulation classes
2014-07-24 14:12:04 +02:00
Andreas Lauser
df9efcf342 some documentation and stylistic updates 2014-03-05 16:30:54 +01:00
Benjamin Faigle
9674745464 Add functions for the heat capacity to the components air and co2
Enabled access to these methods in the co2-brine-fluidsystem (only
pure-phase heat capacities are used). reviewed by Klaus

Dumux-Svn-Revison: 12462
Ported-By: Andreas Lauser <and@poware.org>
2014-02-23 15:10:04 +01:00
Andreas Lauser
f386599669 remove all vim and emacs modelines
for emacs, add a toplevel .dir-locals.el file instead...
2014-01-16 18:41:00 +01:00
Andreas Lauser
249592a57d fix the screw-ups caused by a0101ee 2013-12-03 12:13:53 +01:00
Andreas Lauser
019d188efb update the in-file copyright holder statements
this patch is quite large as there were various bug fixes to the
script which generates these statements
2013-12-02 17:26:34 +01:00
Andreas Lauser
a0101ee033 replace in-source copyright comments by the standard OPM ones 2013-12-02 16:35:57 +01:00
Andreas Lauser
96f38877f5 remove all print statements in classes intended for use of other modules
because these classes should not have any side effects. case in point:
the warnings intended to be printed once get printed once per process
which can be quite a few times for parallel simulations with thousands
of cores. This could also be avoided by checking the MPI rank, but
IMHO this is way too much boilerplate code for a feature of questionable
value.
2013-11-23 00:47:49 +01:00
Andreas Lauser
555154661e fix headercheck 2013-11-14 11:55:11 +01:00
Andreas Lauser
5c57117365 guard macros: _HH -> _HPP 2013-11-13 18:45:52 +01:00
Andreas Lauser
2b493c0e95 fix end of namespace comments
long live python ;)!
2013-11-04 14:15:53 +01:00
Andreas Lauser
b51bf6d0b1 H2O: remove too expensive range checks
when they worked, they were only used in debug mode anyway...
2013-11-03 15:38:00 +01:00
Andreas Lauser
37777ac9e9 tabulated component: don't catch NumericalProblem anymore
this lead to a compiler warning on gcc 4.8 that this case was already
covered by catching std::exception. Since we did the same in both
branches anyway, these statements were not required...
2013-09-25 16:14:24 +02:00
Andreas Lauser
2e34aecf67 the big rename
make all file names confirm to the OPM conventions. (hopefully)
2013-09-24 11:37:07 +02:00