Commit Graph

701 Commits

Author SHA1 Message Date
Atgeirr Flø Rasmussen
7035e37737 Moved equilibration utilities to separate file. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
50a7bae23e Capitalize nested namespace names.
equil -> Equil
miscibility -> Miscibility
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
07ca74800a Move RegionMapping class to its own header, add test.
Class now resides in opm/core/utility/RegionMapping.hpp.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
6c75579c67 Added class RsSatAtContact (not tested). 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
652283d87d Add test case with overlapping transitions.
Capillary pressure functions and contact depths
have been modified to ensure a large overlap.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
734046e16e Fix bug in saturation initialisation.
We shall only use gas-water capillary to initialise when we would get
unphysical saturations otherwise.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
e51b161c89 Add test case with capillary transition region. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
9712b61747 Add saturation computation to and rename computer class.
Opm::equil::DeckDependent::PhasePressureComputer ->
Opm::equil::DeckDependent::PhasePressureSaturationComputer
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
cc50cb94c1 Add test case for capillary inversion. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
5b0534c372 Add another test deck for initialisation.
This deck includes capillary functions.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
2ec3a80cfb Fix bugs in saturation initialisation and helpers. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
50c6fa8863 Add saturation init facilities.
This adds the function phaseSaturations() and some helpers:
satFromPc() and satFromSumOfPcs().
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
2056623044 Complete pressure test for dead-oil deck. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
95ce3c4657 Modify test data. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
55fcdec734 Add (defaulted) gravity argument in some places.
This is done to facilitate testing, using gravity = 10 m/s^2 for example.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
33a2030170 Still working on test_equil.cpp. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
b9589097fc Fix contact depths in test deck. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
ba4461a26c Throw exception if datum not in oil zone.
We are not capable of handling this, and must abort.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
6362621c13 Created simple data for init testing. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
7997917c07 Add (unfinished) test case. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
97014713ce Removed RK4IVP's inheritance from binary_function.
Three reasons:
 - class is a unary functor,
 - the typedefs obtained were not used,
 - binary_function is deprecated in C++11.
2018-01-02 14:28:06 +01:00
Bård Skaflestad
ba82e3fa5e Add a layer of glue to extract data from deck
This is a work in progress.
2018-01-02 14:28:06 +01:00
Bård Skaflestad
30ba1b0f86 Install crude handling of data point outside vertical span
The initial implementation of RK4IVP<>::operator() failed to take
into account the possibility that we might need to evaluate the
function outside the vertical span for which it was initially
defined.  This situation occurs, for instance, in the not uncommon
cases of the GOC being above or the WOC being below the model.

This commit installs a crude Hermitian extrapolation procedure to
handle these cases.  Refinements are likely.
2018-01-02 14:28:06 +01:00
Bård Skaflestad
4779b43e88 Include <numeric> for std::iota()
Header was missing in earlier revision.
2018-01-02 14:28:06 +01:00
Bård Skaflestad
693612c0e2 Document requirements of CellRange. 2018-01-02 14:28:06 +01:00
Bård Skaflestad
5cdcd77820 Document public interface of phasePressures(). 2018-01-02 14:28:06 +01:00
Bård Skaflestad
9ddca948ff Add reverse look-up mapping for region vectors
Class RegionMapping<> provides an easy way of extracting the cells
that belong to any identified region (e.g., as defined by EQLNUM) of
the deck.
2018-01-02 14:28:06 +01:00
Bård Skaflestad
9bd0a58b35 Test cell subset phase pressure assignment. 2018-01-02 14:28:06 +01:00
Bård Skaflestad
d9766b0f6d Compute phase pressures in subset of cells
This commit adds support for assigning the initial phase pressure
distribution to a subset of the total grid cells.  This is needed in
order to fully support equilibration regions.  The existing region
support (template parameter 'Region' in function 'phasePressures()')
was only used/needed to define PVT property (specifically, the fluid
phase density) calculator pertaining to a particular equilibration
region.
2018-01-02 14:28:06 +01:00
Bård Skaflestad
1a182d4a48 Add basic equilibration facility
This commit adds a simple facility for calculating initial phase
pressures assuming stationary conditions, a known reference pressure
in the oil zone as well as the depth and capillary pressures at the
water-oil and gas-oil contacts.

Function 'Opm::equil::phasePressures()' uses a simple ODE/IVP-based
approach, solved using the traditional RK4 method with constant step
sizes, to derive the required pressure values.  Specifically, we
solve the ODE

      dp/dz = rho(z,p) * g

with 'z' represening depth, 'p' being a phase pressure and 'rho' the
associate phase density.  Finally, 'g' is the acceleration of
gravity.  We assume that we can calculate phase densities, e.g.,
from table look-up.  This assumption holds in the case of an ECLIPSE
input deck.

Using RK4 with constant step sizes is a limitation of this
implementation.  This, basically, assumes that the phase densities
varies only smoothly with depth and pressure (at reservoir
conditions).
2018-01-02 14:28:06 +01:00
Andreas Lauser
b5e9bb14ec Merge pull request #249 from andlaus/adapt_to_thermal_laws
adapt to the refactoring of the thermal laws in opm-material
2017-12-14 11:41:33 +01:00
Andreas Lauser
a99ef4af4f Merge pull request #251 from andlaus/maintainance
Maintainance
2017-12-13 13:19:06 +01:00
Andreas Lauser
a619a1115b finger_immiscible_ecfv_adaptive: update reference solution
for some reason it changed slightly.
2017-12-13 00:54:25 +01:00
Andreas Lauser
db2977b0bf adapt to the refactoring of the thermal laws in opm-material 2017-12-11 17:39:56 +01:00
Andreas Lauser
c0f013e25e use BlackOilFluidState from opm-material
this has recently been moved there. Since redundancy is considered to
be bad, switch eWoms to it.

I've tested this with Norne: No measureable difference, as expected.
2017-12-04 13:02:51 +01:00
Andreas Lauser
6fcfd3a363 Merge pull request #235 from andlaus/update_refsols
Update refsols
2017-11-17 19:01:03 +01:00
Andreas Lauser
c7a60b31ea update the reference solution for the tutorial
this changed because the density for LNAPL was changed to a more
realistic value of 690 kg/m^3 (same as iso-octane) from the previous
890 kg/m^3.
2017-11-17 14:03:04 +01:00
Andreas Lauser
b2d9bf1a82 update the reference solution for finger_immiscible_vcfv
for some reason the results have changed. (IMO, the new ones look more
correct in paraview.) The reason this was not discovered earlier is
that this test depends on the presence of dune-alugrid and the CI
infrastructure does not deal with this.
2017-11-17 14:03:04 +01:00
Andreas Lauser
fa1516bcd0 Merge pull request #225 from andlaus/minor_fixes
Minor fixes
2017-10-04 10:49:15 +02:00
Andreas Lauser
aca56a43e3 make all headers self-sufficient again
after the recent changes, some additional headers are required to be
included.
2017-10-03 12:48:21 +02:00
Andreas Lauser
0fccd5acb7 reference solutions: do not use symbolic links anymore
the reason is that cmake cannot file(COPY) them. this is probably due
to constraints of a crappy operating system that is made by a
microscopical and tender company which is based close to Seattle.
2017-10-03 12:39:46 +02:00
Arne Morten Kvarving
93d6eff3be Merge pull request #209 from andlaus/remove_dune_2_3_support
remove support for dune < 2.4
2017-09-22 11:39:59 +02:00
Andreas Lauser
38414a8325 Merge pull request #220 from andlaus/propertysystem_mcu
make the property system work with multiple compile units
2017-09-05 21:29:33 +02:00
Andreas Lauser
b93a61fd38 make the property system work with multiple compile units
so far, the linker bailed out due to duplicate definitions of
variables if multiple compile units used the same type tag. This is
problematic if the sources are split into separate compile units and
that use the same type tag; in particular, this applies for
traditional libraries.

Due to various C++ peculiarities, this patch complicates the internal
implementation of the property system quite a bit, but given that the
usage of it (as well as the compile time) stay unchanged, I do not
consider this to be a big problem. Note that the introspection code is
particularly problematic because it needs static initializers that do
not cause the linker to choke in the case of multiple compile units.

Finally, to prevent future regressions, this patch adds a unit test
for the lens problem which uses multiple compile units. (This test is
called lens_immiscible_ecfv_ad_mcu and basically identical to the
existing lens_immiscible_ecfv_ad test and I thus think that it is
pretty unimaginative -- improvement proposals are welcome.)
2017-09-03 15:27:35 +02:00
Andreas Lauser
69ad7630d6 Merge pull request #162 from andlaus/vcfv_ad
make AD work for the vertex-centered finite volume discretization
2017-07-25 12:19:16 +02:00
Andreas Lauser
2ff14fb13e remove the Stokes model
there seems to be only a *very* limited amount of interest, the code
of the model is quite complex and there are currently no suitable
discretizations for free-flow equations in eWoms (i.e., the model
tends to be very unstable and oscillates a lot). Combined, all of this
makes maintaining this model a pain in the back, so let's remove it
some interest in these kinds of problems surfaces and until
appropriate discretizations -- like staggered grid methods -- are
available.
2017-07-21 21:38:13 +02:00
Andreas Lauser
a626ab869e make the vertex centered FV method work with automatic differentiation
This works by having a "focus degree of freedom" during
linearization. When evaluating the local residual, all derivatives of
the residual/fluxes are with regard to the primary variables of that
DOF.

The two main offenders were the Forchheimer velocity model and the
model for the Stokes equations. To ensure that they continue to work,
the "powerinjection" and the "stokestest2c" problems are now both
compiled and tested with both, automatic differentiation and finite
differences, and the results of these tests is compared against the
same reference solution.

The majority of the time required to develop this patch was actually
required for testing: All tests compile and pass with debugging and
aggressive optimization flags with at least GCC 5, GCC 7 and clang
3.8, as well as Dune 2.3 and 2.4. Also, the results of flow_ebos stay
identical for Norne whilst the performance difference is below the
measurement noise on my machine. (the version with this patch applied
was actually about 1% faster.)
2017-07-21 18:35:08 +02:00
Andreas Lauser
1107b39c77 remove support for dune < 2.4
this allows quite a substantial amount of code decluttering, mainly
because Dune 2.4 renamed mapper.map() to mapper.index().
2017-07-13 14:08:02 +02:00
Andreas Lauser
23642bd9f7 Merge pull request #206 from andlaus/compositional_improvements
Compositional improvements
2017-06-29 17:54:48 +02:00
Andreas Lauser
6bff521319 NCP, PVS models: refine the primary variable update proceedure slightly
now, the saturation delta is guaranteed not to be larger than 20% for
each iteration. this is inspired by flow's updateState() code.
2017-06-29 17:23:24 +02:00