Commit Graph

41 Commits

Author SHA1 Message Date
Bernd Flemisch
21df1cbe31 [properties] adapt to changes in the property system
`NEW_PROP_TAG` is now a definition and not just a declaration.
Eliminate superfluous declarations, include headers with definitions.
Make one necessary forward declaration explicit.
2020-05-18 15:54:26 +02:00
Kai Bao
93655244ce increasing the max iteration number for statFromPc
when doing the equilibration.
2020-04-30 12:12:58 +02:00
Bård Skaflestad
b288602dfc Equilibration: Add Experimental Support for Horizontal Subdivision
This commit adds a very early, alpha-quality implementation of the
"horizontal subdivision" strategy (N < 0) of the EQUIL directive.
This in turn enables more accurate derivations of the initial fluids
in place.

Interactions with SWATINIT are completely untested, and the initial
Rs/Rv derivations in this context are possibly incomplete.  More
work is likely needed in this area, but this does at least enable
more widespread testing.
2020-04-22 20:10:19 +02:00
Bård Skaflestad
4b04a36a2f Initial State Calculator: Prune Unneeded Steps and Variables
In particular, remove unneeded function parameters and don't form a
per-cell PVT zero-based index when we're not going to use the
values.
2020-04-22 20:10:19 +02:00
Bård Skaflestad
f0ed53a6f1 Vertical Extent: Prune Unneeded 'cellcount' Parameter
The purpose of this function is to determine the vertical extent of
a set of cells.  Counting the number of cells in the region is not
its responsibility.
2020-04-22 20:10:19 +02:00
Bård Skaflestad
6292855bd5 Initial State Calculator: Refactor Cell Loop
This commit splits out the per-cell initial state derivation to two
separate helper functions, equilibrateCellCentres() and cellLoop().
The latter manages the per-cell assignments to pertinent data
members and calls an arbitrary "equilbration method" that is
provided as a callback and which calculates per-cell phase
pressures, phase saturations and mixing ratios (Rs/Rv).

In turn, the equilibrateCellCentres() uses the cellLoop() to affect
the existing equilibration procedure within a cell using values at
the depths of the cell centres only.
2020-04-22 20:10:19 +02:00
Bård Skaflestad
fd2d8536eb Refactor Phase Saturation Derivation Procedure
This commit introduces a new helper class,

    Opm::EQUIL::Details::PhaseSaturations<>

that subsumes the responsibility of the existing helper function

    Opm::EQUIL::phaseSaturations<>()

and generalises that functionality to arbitrary depth points within
single cells.  This is in preparation of adding support for the N<0
case of the initial fluid in place procedure defined in the EQUIL
keyword.  The class consumes an already equlibrated pressure table
for the pertinent equilibration region, calculates capillary
pressure values and inverts Pc curves to derive saturation values.
If the capillary pressure curves are constant within a cell, then a
simple depth consideration with respect to the implied sharp phase
interface is used to derive saturation values.  We also preserve
existing support for SWATINIT-type initialisation of the water
saturation field.

Switch InitialStateComputer<>::calcPressSatRsRv() over to using the
pressure and saturation helper classes instead of the original
helper functions since this provides additional control.  Also
remove those helper functions to reduce risk of confusion over which
method to use.  Update the unit tests accordingly.
2020-04-14 23:01:02 +02:00
Bård Skaflestad
d039a1d60e Basic Equilibration: Prepare for Subdivision Strategy
This commit is the first step of several that implements ECLIPSE's
"accurate fluid-in-place" model initialization procedure based on
subdividing the vertical range/extent of individual cells.  This
first step puts the O/G/W phase-pressure calculation into a helper
class,

    Opm::EQUIL::Details::PressureTable<>

through which phase pressure values can be calculated at abritrary
depths rather than just at the cell centre depths.  In other words,
this helper class extends and subsumes the responsibilities of the
existing helper functions

    Opm::EQUIL::Details::PhasePressure::assign()
    Opm::EQUIL::Details::PhasePressure::oil()
    Opm::EQUIL::Details::PhasePressure::gas()
    Opm::EQUIL::Details::PhasePressure::water()

We still use the same ODE-based evaluation procedure for the phase
pressures and the equilibrateOWG() helper function still computes
the phase pressure values at cell centre depths only.

That, in turn, corresponds to the "N = 0" case (steady state) of the
basic equilibration facility.
2020-04-14 23:01:02 +02:00
Bård Skaflestad
74368c5f98
Merge pull request #2452 from blattms/use-region-temperature-cleaned
Use correct region temperature when calculating RS/RV
2020-04-02 15:08:53 +02:00
Markus Blatt
eb8ac2af2d Use correct region temperature when calculating RS/RV
The InitialStateComputer::temperature_ array, previously used,
was of cartesian size, but used as if it only contained the
values of the cells of a region.
With this commit InitialStateComputer::temperature_ is a compressed local
array and we explicitly copy out only the region values when computing
RS/RV.

Closes #2423.
2020-03-10 11:54:58 +01:00
Markus Blatt
5c8cdc8024 Use get_int instead of get_int_global in initstateequil.hh.
With the arrival of compressed field properties there is no need
to extract the global arrays just to compress them manually
afterwards. This change should remove commununication and
synchronization points.
2020-03-09 21:32:41 +01:00
Arne Morten Kvarving
7dfb45067b don't use templated get and has interface from fieldpropsmanager
it is now private
2020-01-27 15:33:18 +01:00
Joakim Hove
d1085466e0 Remove #include GridProperty 2020-01-20 09:00:48 +01:00
Joakim Hove
0e9535319b
Simulate with only active cells (#2213)
Use FieldProps implementation for 3D properties
2020-01-13 15:46:50 +01:00
Joakim Hove
06107450d6 Uuse new EquilRecord from opm-common 2019-09-23 21:42:41 +02:00
Arne Morten Kvarving
d3d9831fc3 changed: ewoms/common -> opm/models/utils 2019-09-19 11:14:36 +02:00
Arne Morten Kvarving
5599bb6d8c changed: namespace Ewoms -> namespace Opm 2019-09-05 17:14:38 +02:00
Arne Morten Kvarving
e1696e6d5b changed: remove duplicated regionmapping class
use version from opm-grid
2019-09-04 15:47:52 +02:00
Andreas Lauser
18e64d0e7e fix some masochistic compiler warnings for the GCC 9 pre-release
the flags which I used are
```
-pedantic \
-Wall \
-Wextra \
-Wformat-nonliteral \
-Wcast-align
-Wpointer-arith \
-Wmissing-declarations \
-Wcast-qual \
-Wshadow
-Wwrite-strings \
-Wchar-subscripts \
-Wredundant-decls \
-fstrict-overflow \
-O3 \
-march=native \
-DNDEBUG=1
```

note that some heavy filtering is not the worst idea because DUNE is
far from not emiting any warnings with these flags.

Also, there were some pesky warnings in test_ecl_output which I don't
know how to fix:

```
tests/test_ecl_output.cc:218:73: warning: missing initializer for member ‘Opm::data::Connection::effective_Kh’ [-Wmissing-field-initializers]
```
2019-01-09 09:34:26 +01:00
Andreas Lauser
1d16dfc3fa fix some warnings produced by clang 6
they are all harmless.
2018-10-29 10:05:46 +01:00
Andreas Lauser
935b5a5a9d adapt to the fluid system naming convention change in opm-material 2018-07-27 12:56:19 +02:00
Andreas Lauser
26e6d56930 do explicit put properties into the the Ewoms::Properties namespace anymore
instead, do it implicitly by using the BEGIN_PROPERTIES and
END_PROPERTIES macros.
2018-06-15 20:22:07 +02:00
Andreas Lauser
26228ec5f3 fix the issues that emerged in the context of [at]totto82's review 2018-04-05 19:31:55 +02:00
Atgeirr Flø Rasmussen
39793ec932 Adapt to moved opm-grid headers. 2018-02-12 10:20:09 +01:00
Andreas Lauser
260d62c2b8 adapt to the move of code from opm-common to opm-material 2018-02-08 12:11:20 +01:00
Tor Harald Sandve
9192380308 Add support for PBDV and PDDV in initstateequil.hh 2018-01-09 10:42:04 +01:00
Andreas Lauser
c8d7be3848 make all headers autonomous again 2018-01-03 19:03:22 +01:00
Andreas Lauser
4e37c53038 restore the hydrostatic equilibration test from opm-core
This involved quite a bit of kicking and screaming. The result
certainly is not pretty, but it works.
2018-01-03 12:28:12 +01:00
Andreas Lauser
794fc3f588 equil init: reduce the tolerance of the regula falsi solvers to 1e-10 2018-01-02 14:28:06 +01:00
Andreas Lauser
2f00e7804a equil init: rename the files according to the eWoms standard convention
the eWoms file naming convention should probably be changed to the one
of the remaining OPM modules, but this is quite a bit of work and IMO
it is more important to be consistent within the module.
2018-01-02 14:28:06 +01:00
Andreas Lauser
69b1a5ca5a equil init: formating fixes to make it more consistent with the rest of ewoms
in particular, this removes excessive whitespace usage.
2018-01-02 14:28:06 +01:00
Andreas Lauser
79856b3b0a equil init: change all variables to camelCase
this makes it more integrated with the rest of eWoms.
2018-01-02 14:28:06 +01:00
Andreas Lauser
01c2a2da97 equil init: re-indent
this makes the indentation style of the equil init code consistent
with the rest of eWoms.
2018-01-02 14:28:06 +01:00
Andreas Lauser
0690cad957 equil init: get rid of boost::iterator_range
this class is rather simple and it was the only thing from Boost used
by the hydrostatic equilibrium code...
2018-01-02 14:28:06 +01:00
Andreas Lauser
d142060386 equil init: replace opm-core's linear interpolation function by Tabulated1DFunction 2018-01-02 14:28:06 +01:00
Andreas Lauser
3f875fb8f2 equel init: pass the type tag to the InitialStateComputer
also, get rid of Opm::extractPvtTableIndex()
2018-01-02 14:28:06 +01:00
Andreas Lauser
028a8c808b equil init: get rid of opm-core's "root finders"
instead, let's bit the bullet and add the few lines required for
regula-falsi-Pegasus method whenever the old RegulaFalsi class was
used. note that this leads to slightly different results for the
SPE5CASE1 flow test. I suspect that the old solvers behave in
unexpected ways, though...

Note that because the inverted functions are usually piecewise linear,
inversion can be done in a much smarter way.
2018-01-02 14:28:06 +01:00
Andreas Lauser
db9e26761f equil init: get rid of some UgGridHelpers usage
this only deals with the easy things, i.e. UgGridHelpers::numCells()
and UgGridHelpers::dimensions(). a more thorough cleanup is needed in
the future to make ebos work with grids other than Dune::CpGrid again.
2018-01-02 14:28:06 +01:00
Andreas Lauser
669d3fcd2a equil init: re-indent EquilibrationHelpers.hpp 2018-01-02 14:28:06 +01:00
Andreas Lauser
6f07f38fb1 equil init: get rid of initStateEquil_impl.hpp
now, all the beauty of that part of the code can be admired in
initStateEquil.hpp.

During this exercise, I stumbled over some serious code-quality issues
like a different order of the template arguments for the declaration
and the definition, mismatching argument names and no forward
definition of some functions. besides this, some functions were
already defined in the non-_impl.hpp file and EquilibrationHelpers.hpp
used that approach from the outset.
2018-01-02 14:28:06 +01:00
Andreas Lauser
6871e1cf88 move the hydrostatic equilibrium code to its proper location and make it compile
this just moves the hydrostatic equilibrium code from its historc
location at opm/core to ebos/equil and adds minimal changes to make it
compile. this allows to clean up that code without disturbing the
legacy simulators.
2018-01-02 14:28:06 +01:00