Commit Graph

325 Commits

Author SHA1 Message Date
Andreas Lauser
c780233ad1 black-oil PVT: remove the density related methods
instead, the calling code needs to directly use the formation volume
factors to calculate it.
2016-01-29 19:27:52 +01:00
Andreas Lauser
d29c85dc9a blackoil-pvt: introduce a numRegions() method 2016-01-29 19:27:52 +01:00
Andreas Lauser
fc933ef94d blackoil-pvt: simplify the initialization from an ECL-deck
now if the object is initialized using the initFromDeck() method, a
call to initEnd() is not required anymore. IMO, this makes the API
easier to use and more bullet-proof.
2016-01-29 19:27:52 +01:00
Andreas Lauser
fa5a2f66a1 make the meat of the unit tests for fluid states and fluid systems available publicly 2016-01-29 19:27:52 +01:00
Andreas Lauser
58c9022a98 fix a compiler warning 2016-01-29 19:27:52 +01:00
Andreas Lauser
3e54344556 black-oil fluid system: remove some spurious spaces 2016-01-29 19:27:52 +01:00
Andreas Lauser
7c15621160 pvt multiplexers: don't spill the multiplexer macros
the #undef directives were wrong or missing...
2016-01-29 19:27:52 +01:00
Andreas Lauser
10fb871c64 Merge pull request #113 from jokva/clean-up-headers
Improve includes from opm-parser
2016-01-29 14:58:58 +01:00
Jørgen Kvalsvik
3bbfa75644 Improve includes from opm-parser
Adopting to opm-parser PR#661, add previously missing includes.

https://github.com/OPM/opm-parser/pull/661
2016-01-26 13:27:25 +01:00
Andreas Lauser
639f1be605 Merge pull request #112 from andlaus/autonomous_headers
make all headers stand-alone again
2016-01-21 13:18:22 +01:00
Andreas Lauser
5d270f4436 make all headers stand-alone again
i.e., after this all headers are supposed to be fully autonomous again
and can thus be included without preconditions. this property broke
when OPM/opm-parser#656 was merged.
2016-01-21 13:14:01 +01:00
Joakim Hove
2fdacd3f74 Merge pull request #111 from jokva/fix-header-include-parser656
Fixes missing includes (opm-parser PR-656)
2016-01-21 11:58:38 +01:00
Jørgen Kvalsvik
d1a2924e08 Fixes missing includes (opm-parser PR-656)
Adds missing includes which due to PR-656 in opm-parser are no longer
automatically pulled from other headers.
2016-01-19 14:11:44 +01:00
Andreas Lauser
515475a187 Merge pull request #109 from dr-robertk/PR/multiple-precision
Add tests using Scalar=float (try 2).
2016-01-15 22:30:52 +01:00
dr-robertk
925a014b83 Merge pull request #1 from andlaus/fix_float
Fix float
2016-01-15 14:23:08 -07:00
Andreas Lauser
54cb64bcb0 enable testing for Scalar == float for all unit tests
for some unit tests the precision of `float` is insufficient. To at
least enforce that the tested code compiles with `float` as Scalar,
they are wrapped by `while(false)` statements.
2016-01-15 16:07:40 +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
fe44bcc8f9 Spline: consistently use the same (template) code for the scalar and Evaluation<> cases 2016-01-15 16:01:45 +01:00
Robert Kloefkorn
2a2b5b91de tests: added checks with Scalar=float. All tests compile with Scalar=float, but only
some work.
2016-01-14 17:28:07 -07:00
Robert Kloefkorn
92062f009c PengRobinson: make compile when Scalar is not double. 2016-01-14 17:27:44 -07:00
Robert Kloefkorn
c6c44acb4c LiveOilPvt/WetGasPvt: return value of vectorCopy is std::vector<double>. 2016-01-14 17:27:11 -07:00
Andreas Lauser
e468219af7 Merge pull request #107 from andlaus/fix_tables
fix the table handling code for live oil
2016-01-14 19:41:05 +01:00
Andreas Lauser
cf7d072399 remove some unneeded spaces 2016-01-14 19:35:21 +01:00
Andreas Lauser
890fdf54f7 fix the table handling code for live oil
the recent table refactoring replaced the compile-time-safe approach
to columns (i.e., table.getFooColumn()) by a generic method which
requires a magic cookie (i.e., table.getColumn("FOO")). Unfortunately,
this went belly-up with the viscosity column of the PVTO table (here
the magic constant is "MU" and not "MUO". Note that in this respect,
opm-parser is inconsistent w.r.t. the column of the formation volume
factor which is called "BO" and not "B".)

there were also some additional typos: the gas dissolution factor is
"RS" and the pressure of oil is "P".

It probably gets time to make the opm-core/opm-autodiff PVT code use
the stuff from opm-material so that this receives some run-time
testing with `flow` during development. (currently this is only used
by `ebos`...)
2016-01-14 19:33:39 +01:00
Joakim Hove
df618f43a6 Merge pull request #103 from joakim-hove/table-column
Using new table api
2016-01-08 15:29:04 +01:00
Joakim Hove
d8898a1c1a Update EclMateriallawmanager to use new Table api. 2016-01-08 14:35:23 +01:00
Joakim Hove
20310cdd81 Updated LiveOilPvt and WetGasPvt to new Table api. 2016-01-08 14:35:22 +01:00
Andreas Lauser
e2e05f53f6 Merge pull request #106 from andlaus/remove_asserts
EclEpsScalingPoints: Remove some spurious asserations
2016-01-05 12:10:46 +01:00
Andreas Lauser
24324e4e94 Merge pull request #105 from joakim-hove/remove-assert
Removed assert - allow nonzero min swat.
2016-01-05 12:08:17 +01:00
Joakim Hove
bc56a40992 Removed assert - allow nonzero min swat. 2016-01-05 12:02:22 +01:00
Andreas Lauser
10f2397c6a EclEpsScalingPoints: Remove some spurious asserations
these were added to make sure that the input data confirms to what is
required by the ECL documentation. It is better to do these
consistency checks externally, though. (and also not just in debug
mode.)
2016-01-05 12:00:39 +01:00
Atgeirr Flø Rasmussen
18f5863d4e Merge pull request #102 from andlaus/blackoil_API_refactor
Blackoil api refactor
2016-01-05 08:20:20 +01:00
Andreas Lauser
7068aa3669 fix clang-3.5 and GCC-4.9 extra-pedantic warnings
hopefully this fixes all of them. While doing this, I noticed that the
warnings produced by GCC 5 and GCC 4.9 differ. I did not try to
compile it with GCC 5, though.
2016-01-04 15:31:43 +01:00
Andreas Lauser
b515b9ddc0 remove some unneeded consts
they do not affect the result of the compilation and IMO just look
ugly. (I'm aware that there are other opinions.)
2016-01-04 15:31:38 +01:00
Andreas Lauser
b6bca92907 NcpFlash: change the default tolerances
for the most common case (i.e., Scalar == double) the previous method
lead to a tolerance of 10^-3 (relative) which is way too much if an
absolute tolerance of 10^-8 kg/(m^3*s) is required by the model.
2016-01-04 15:31:36 +01:00
Andreas Lauser
9c0fe9eb4c black-oil fluid system: some stylistic and comment cleanups 2016-01-04 15:31:34 +01:00
Andreas Lauser
8d1e470559 black-oil fluid system: some functional changes
- avoid the discontinuity between saturated and undersaturated
  hydrocarbon density and viscosity. This introduces a dependency of
  density and viscosity on the saturation of gas and oil which does
  not make much sense from a physical POV. (note that the dependency
  on the phase saturations was already there, but it was a
  discontinuous one, i.e., it dependeded on S_{o,g} > 0 instead of on
  S_{o,g})
- fixes for the fugacityCoefficient() method (it now also works for
  wet gas and dead oil, i.e., it avoids a division by zero for
  immiscible hydrocarbon phases.)
2016-01-04 15:31:32 +01:00
Andreas Lauser
91508eb6e1 black-oil fluid system: introduce black-oil specific variants of the methods
i.e., the PVT region index is passed directly to them and the
ParameterCache objects are not required. also:

- convert all methods to fluid states instead of passing the dependent
  parameters directly.
- do no longer encode the phase or component names in the method names
  of the fluid system.
2016-01-04 15:31:30 +01:00
Andreas Lauser
862f808e74 black-oil fluid system: introduce methods to convert Rs and Rv to their respective mass and mole fractions
going from Rs/Rv to the mole fractions is intentionally a bit clumsy
because it is relatively expensive computationally.
2016-01-04 15:31:28 +01:00
Andreas Lauser
5bf8cba955 Fluid systems: export the type which is used to represent scalar values 2016-01-04 15:31:25 +01:00
Andreas Lauser
8bb8864140 fix setting the live oil properties from the saturated quantities 2016-01-04 15:31:23 +01:00
Andreas Lauser
f1548f5c72 improve the API of the low-level blackoil PVT classes
- they are not concerned with fugacity anymore:
  - as a consequence, they are now more self contained:
    - they do not need to know the molar mass of each component anymore
    - they do not need to call methods of the other PVT classes
      anymore (that was only needed to be able to calculate the
      fugacity coefficients consistently.)
    - quite a few methods could be removed
- also, some methods where renamed for consistency.
2016-01-04 15:31:21 +01:00
Andreas Lauser
1a8d9a30c4 fix the LiveOilPvt w.r.t. setting the saturated viscosities from ECL input 2016-01-04 15:31:18 +01:00
Andreas Lauser
a9a648a667 make the API of the Spline class more similar to the Tabulated*Function classes 2016-01-04 15:31:16 +01:00
Atgeirr Flø Rasmussen
b5bc9b1324 Merge pull request #98 from andlaus/saturated_blackoil_PVT
Saturated blackoil pvt
2015-11-27 11:53:28 +01:00
Andreas Lauser
f89d3bab70 extend the PVT tables in the same way as the opm-core code 2015-11-26 15:29:06 +01:00
Andreas Lauser
e47db7cfca test the API of the black-oil fluid system more extensively
note that currently this only means that it compiles, correct runtime
behaviour is not (yet?) ensured.
2015-11-26 15:29:06 +01:00
Andreas Lauser
1d2ad56ba1 ConstantCompressibilityWaterPvt: calculate the viscosity the same way as the current opm-core code
this is *NOT* equivalent to the equation given by the ECL
documentation, but it makes it possible to compare it with the current
implementation. (also, the differences are pretty small: about < 10^-8
for SPE3.)
2015-11-24 18:13:32 +01:00
Andreas Lauser
f2d8a4e7a6 Tabulated1DFunction: Unify the code paths for local AD and scalars
this is analogous to 8a06000e which did the same for
UniformXTabulated2DFunction.
2015-11-24 18:13:32 +01:00
Andreas Lauser
126375db7d blackoil: introduce saturated{Oil,Gas}{Density,Viscosity}() methods and use them in the fluid system
this eliminates minor differences with the current opm-core PVT
classes which were due to extrapolation of the untersaturated
tables. (Also, the result should be slightly faster if both, oil and
gas are present.)

I'm not really sure if this is always a good thing, though: It implies
discontinuities at the saturated <-> undersaturated transition which
may sometimes deter convergence rates of the non-linear solver.
2015-11-24 18:13:32 +01:00