Commit Graph

85 Commits

Author SHA1 Message Date
Svenn Tveit
066601ae52 Improved H2 property calculations.
Most H2 properties are calculated using Helmholtz free energy EOS.
Moved Helmholtz equations from Brine_H2 to H2 class.
New file with simple H2 property calculations based on ideal gas.
2023-04-12 14:28:01 +02:00
Svenn Tveit
f5d02c8049 Remove duplex gasViscosity 2023-04-12 14:28:01 +02:00
Svenn Tveit
337b24de87 Added hydrogen component.
Most of this is copied from Dumux with some additions and modifications.
2023-04-12 14:28:01 +02:00
Tor Harald Sandve
7526a7bb77 Merge pull request #3452 from totto82/fixThermalCO2
Fix thermal + co2
2023-03-22 11:06:52 +01:00
hnil
352e2a8316 -fixed missing include 2023-03-17 17:06:30 +01:00
Tor Harald Sandve
5f438d19cc fix sign bug in thermal Brine density calculations 2023-03-16 15:26:54 +01:00
Arne Morten Kvarving
509a018ae7 fixed: fix debug printing with quad
std::to_string(__float128) is not defined
we need to instance the evaluation formatter for __float128
2023-03-16 09:07:13 +01:00
Arne Morten Kvarving
83e7e45f2d TabulatedComponent: remove unnecessary <iostream> include 2023-01-02 15:50:41 +01:00
Arne Morten Kvarving
f1ecc0c7cf SimpleHuDuanH2O: avoid use of sstream 2023-01-02 15:50:41 +01:00
Arne Morten Kvarving
f94bdfda44 H2O: avoid use of sstream 2023-01-02 15:50:41 +01:00
Arne Morten Kvarving
c5dd0be166 CO2: remove unnecessary <iostream> include 2023-01-02 15:50:41 +01:00
Arne Morten Kvarving
b58c682f62 CO2: encapsulate CO2Tables
this way we don't have to drag 6MB of tables into multiple compile
units. some flexibility is lost (ie the template parameter for the
table), but this is unused in the current code.

comment out some templates that do not instance as they are referring
to non-existent table members.
2022-12-15 13:52:49 +01:00
Bård Skaflestad
86b3c79ff4 Merge pull request #3260 from akva2/remove_math_include
changed: remove include of Math.hpp
2022-12-14 09:30:04 +01:00
Arne Morten Kvarving
b889f59145 changed: remove include of Math.hpp
it should be up to instance sites to make every available for
the templates to instance properly, even though we know we are
instancing over Evaluations.
2022-12-13 13:31:18 +01:00
Arne Morten Kvarving
9a77d47c35 changed: drop exceptions class from material
use the opm-common exception classes directly
2022-12-13 12:47:20 +01:00
Arne Morten Kvarving
207d280ee4 remove HAVE_OPM_COMMON conditionals 2022-12-08 14:03:15 +01:00
Arne Morten Kvarving
a67f58da14 Co2GasPvt: some modernization
- typedef -> using
- use constexpr where appropriate
2022-08-04 08:14:28 +02:00
Markus Blatt
ef6fc32216 Merge pull request #521 from akva2/component_fixes
Fixes in some component classes
2022-08-02 14:21:11 +02:00
Arne Morten Kvarving
cb9f01df4e remove unused includes of Unused.hpp 2022-08-02 10:16:25 +02:00
Arne Morten Kvarving
81abc289a5 CO2: avoid use dangling references
using a reference to a temporary is not okay
2022-08-02 09:47:14 +02:00
Arne Morten Kvarving
c7b434d918 CO2: some modernization
- use constexpr
2022-08-02 09:47:14 +02:00
Arne Morten Kvarving
37e7e6a611 Brine: avoid use dangling references
using a reference to a temporary is not okay
2022-08-02 09:47:09 +02:00
Arne Morten Kvarving
e42bb116f8 Brine: some modernization
- use constexpr
2022-08-02 09:47:09 +02:00
Arne Morten Kvarving
b626f0d713 SimpleHuDuanH2O: avoid use of dangling reference
using a reference to a temporary is not okay
2022-08-02 09:47:00 +02:00
Arne Morten Kvarving
f2eadd2ab3 SimpleHuDuanH2O: some modernization
- typedef -> using
- use constexpr
2022-08-02 09:19:50 +02:00
Trine Mykkeltvedt
6304acb292 fixed test_components for the new actentric factor and criticalVolume 2022-06-27 10:37:17 +02:00
Trine Mykkeltvedt
14a5a37249 moved and renamed fluidsystems and parametercache in chifluid 2022-06-27 10:37:16 +02:00
Trine Mykkeltvedt
afad4d23ad moved the components to opm/material/components, and made subsequent changes for checking of the components 2022-06-27 10:37:16 +02:00
Tor Harald Sandve
588604ae8f extrapolate co2, brine and h2O properties only when called from the CO2STORE module 2021-10-14 12:01:07 +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
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