Commit Graph

241 Commits

Author SHA1 Message Date
Tor Harald Sandve
042d288478 move Test 2018-02-19 13:18:56 +01:00
Atgeirr Flø Rasmussen
672cfc3ca4 Adapt to moved opm-grid headers. 2018-02-12 10:20:09 +01:00
Andreas Lauser
7afb963fdd change gridManager -> vanguard in new file test_ecl_output.cpp 2018-02-08 17:07:32 +01:00
Andreas Lauser
2f4b835a16 rename the "grid manager" to "vanguard"
IMO the term "vanguard" expresses better what these classes are
supposed to do: level the ground for the cavalry. Normally this simply
means to create and distribute a grid object, but it can become quite
a bit more complicated, as exemplified by the vanguard classes of
ebos..
2018-02-08 16:26:58 +01:00
Andreas Lauser
e5344a2add adapt to the move of code from opm-common to opm-material 2018-02-08 12:11:20 +01:00
Tor Harald Sandve
bad406b0a8 Add test for summary output
Test summary output of FIP, FPR and RPR.
2018-02-05 14:24:11 +01:00
Tor Harald Sandve
46fc4b742b Add support for PBDV and PDDV in initstateequil.hh 2018-01-09 10:42:04 +01:00
Andreas Lauser
f5cfd8f768 fix compiler warnings and errors on dune 2.6 2018-01-03 18:53:03 +01:00
Andreas Lauser
9955c6a6f5 add some reference solutions for the adaptive "finger" problem
for some reason, the results changed slightly, but they still look
good to me.
2018-01-03 18:53:03 +01:00
Andreas Lauser
5a3f25d120 make the equil test work in the presence of dune-fem 2018-01-03 18:53:03 +01:00
Andreas Lauser
adb2783a0c 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
Tor Harald Sandve
54e751fe70 Adress PR review issues 2 2018-01-02 14:28:06 +01:00
Tor Harald Sandve
1e10d25c24 Adress PR review issues 2018-01-02 14:28:06 +01:00
Tor Harald Sandve
740ff891ab Remove the usage of partition_unif_idx() from opm-core 2018-01-02 14:28:06 +01:00
Tor Harald Sandve
44c7fb8816 Cleaning the initialization code
-remove whitespaces
-fix documentation
2018-01-02 14:28:06 +01:00
Tor Harald Sandve
9389aecc26 Use &ref not shared_pointer to MaterialLawManager 2018-01-02 14:28:06 +01:00
Tor Harald Sandve
dc997185d9 Remove blackoilPhases and phaseUsage from the initialization code
Note 1: The initialization code now always consider 3 phases.
For 2-phase cases a trivial (0) state is returned.
Note 2: The initialization code does not compute a BlackoilStats,
but instead pass the initialization object with the initial state.
2018-01-02 14:28:06 +01:00
Tor Harald Sandve
b9b75a109c Remove BlackoilProps from equil initalization code
Use FluidSystem and materialLaw from opm-material
directly not via the BlackoilProps in opm-core
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
9e95d662bd Update swatinit tests to account for bugfix. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
680d96840a Update equil regression reference after bugfix.
Also reduce some very coarse tolerances to more reasonable levels.
2018-01-02 14:28:06 +01:00
Tor Harald Sandve
0df94d216a Update the swatinit test base on fix in opm-material#248 2018-01-02 14:28:06 +01:00
Arne Morten Kvarving
3904521ded changed: remove embedded 'parameters' namespace in ParamGroup
inconsistent and unnecessary.

this is purely a cosmetic change, the only exception was a function with
the generic name 'split', which was renamed to splitParam to avoid confusion.
2018-01-02 14:28:06 +01:00
Tor Harald Sandve
020a9af41e Enable swatinit equil test 2018-01-02 14:28:06 +01:00
Tor Harald Sandve
fde300018b FIX swatinit test in test_equil
The capillarySwatinit.DATA is updated to make it possible to run in Ecl.
Referance solutions is updated accordingly.
2018-01-02 14:28:06 +01:00
Joakim Hove
73e6a96180 Temporarily disabled EQUIL + SWATINIT test. 2018-01-02 14:28:06 +01:00
Tor Harald Sandve
fd121224d6 Add test for swatinit 2018-01-02 14:28:06 +01:00
Jørgen Kvalsvik
111979f4a6 Use new DeckItem constructor interface. 2018-01-02 14:28:06 +01:00
Jørgen Kvalsvik
2c30f9e534 Update to shared_ptr-less parser interface. 2018-01-02 14:28:06 +01:00
Andreas Lauser
ec0ac4869c consolidate the unit system to opm-parser
since the unit code within opm-parser is now a drop-in replacement,
this simplifies things and make them less error-prone.

unfortunately, this requires quite a few PRs. (most are pretty
trivial, though.)
2018-01-02 14:28:06 +01:00
Pål Grønås Drange
877bd70c54 transmult and initconfig are ref's, use ref for EclipseState constructor 2018-01-02 14:28:06 +01:00
Liu Ming
6fb9db5dcf rename ParseMode as ParseContext. 2018-01-02 14:28:06 +01:00
Jørgen Kvalsvik
32c5b5e862 Remove Equil + EquilWrapper, replace with upstream
Upstream (opm-parser) now provides a better Equil + EquilRecord, and
simultaneously deprecated EquilWrapper. This patch fixes the resulting
breakage.

One important note: The new Equil does not expose integers for live
oil/wet gas initialization procedure methods, but rather booleans
through constRs/constRv methods. This is how the variable behaves
according to the Eclipse reference manual (EQUIL keyword section).

Code has been updated to reflect this.
2018-01-02 14:28:06 +01:00
Joakim Hove
cbc41cfbf7 Relocated warning headers. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
ecb7dec752 Make grid in deck have larger number of cells.
This makes some tests succeed that use this deck only
for its properties and not its grid: if the grid in the
deck has fewer cells than the grid that is used for the
test we will fail in the SATNUM mapping.
2018-01-02 14:28:06 +01:00
Bård Skaflestad
b337714d4d RegionMapping<>: Support arbitrary region IDs
This commit introduces a new public method, activeRegions(), that
retrieves those region IDs that contain at least one active cell.
We furthermore extend the cells() method to support lookup of
arbitrary region IDs.  Non-active region IDs produce empty cell
ranges.

Intended use case is

    for (const auto& reg : rmap.activeRegions()) {
        const auto& c = rmap.cells(reg);

        // use c
    }
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
1375968541 Suppress warnings. 2018-01-02 14:28:06 +01:00
Joakim Hove
94ea28a2a0 Updated to use ParseMode. 2018-01-02 14:28:06 +01:00
Arne Morten Kvarving
9290cfe32e fix tests
- cannot use BOOST_CHECK_CLOSE around 0 due to a relative test
- slacken a tolerance significantly
2018-01-02 14:28:06 +01:00
Tor Harald Sandve
6038b4bb78 Changes in the ref. solution in the DeakAllDead test 2018-01-02 14:28:06 +01:00
osae
e4f3516fd3 Correcting the equil test. 2018-01-02 14:28:06 +01:00
osae
9d9f5f003b Make use of EclipseState for EQLNUM and SWATINIT. 2018-01-02 14:28:06 +01:00
Andreas Lauser
9731539f6a Glue in support for the grid property modifier keywords
this basically means using Opm::EclipseState instead of the raw deck
for these keywords.

with this, property modifiers like ADD, MULT, COPY and friends are
supported for at least the PERM* keywords. If additional keywords are
required these can be added relatively easily as well.

no ctest regressions have been observed with this patch on my machine.
2018-01-02 14:28:06 +01:00
Andreas Lauser
dcd79e787e fix the equilibration test by using new values
thanks to @bska for the hints.
2018-01-02 14:28:06 +01:00
Andreas Lauser
0fc8fee4cc add missing PVTW keywords to the decks used by the equil test
the test still fails, but the errors seem to be due to differences in
the saturation functions...
2018-01-02 14:28:06 +01:00
Andreas Lauser
55927d68cf remove EclipseGridParser compatibility methods from all classes 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
7120bdf1ce Add (all-zero) initialisation of new EquilRecord fields. 2018-01-02 14:28:06 +01:00
osae
977c2e7106 Some additional tests: live gas, RSVD and RVVD 2018-01-02 14:28:06 +01:00
osae
ce05475010 Update tests and provide some eclipse output. 2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
b8d48a5fc8 Bugfix in RsSatAtContact: use min(), not max().
Also modified test to match output.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
1923de2694 Fix bug in RS initialisation.
Also throw if default init is specified and datum != goc depth.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
5ee2c0cbc9 Rename PhasePressureSaturationComputer -> InitialStateComputer.
Also add (unused so far) rs_ field to class.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
9c047f4533 Add test for live oil initialisation.
The test is not finished or verified yet.
2018-01-02 14:28:06 +01:00
Atgeirr Flø Rasmussen
0d25ad9ec4 Made phase mixing functors a class hierarchy.
In summary:
 - added RsFunction (base class),
 - made NoMixing, RsVD, RsSatAtContact inherit RsFunction,
 - RS and RV are no longer template arguments for EquilReg class,
 - EquilReg constructor now takes two shared_ptr<Miscibility::RsFunction>,
 - use of constructor updated, mostly using make_shared.
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
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
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
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
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
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
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
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
a619a1115b finger_immiscible_ecfv_adaptive: update reference solution
for some reason it changed slightly.
2017-12-13 00:54:25 +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
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
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
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
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
Andreas Lauser
040f704207 fix the location of fracture.art.dgf data file
this belongs to the `tests/data` directory, not into the toplevel
`data` directory. Also, the input ART file for this has been renamed
to `fracture-raw.art` to avoid race conditions.
2017-03-14 14:21:11 +01:00
Andreas Lauser
ed353e7c70 update reference solution
for reasons which are mysterious to me, this slipped through. anyway,
it only bit if dune-alugrid was installed.
2017-03-01 21:10:57 +01:00
Andreas Lauser
30952313e8 fix the two-point gradient calculator
for the vertex-centered finite volume discretization, the relevant
position for calculating the gradient is *not* the position of the
center of the *sub*-control volume, but the center of the whole
control volume.

Since this patch changes the gradients of all VCFV simulations that
use twopoint gradients, quite a few new reference solutions are
required by this PR. I've looked at all of them manually and made sure
that they look reasonable. (The PR also includes a new reference
solution for the test for the adaptive finger problem -- which uses
ECFV -- but that's because the grid refinement seems to be quite
sensitive to the solution proceedure for that problem, not because
there's any difference in the solutions that can be noticed visually.)

note that all simulations that use element centered finite volume
discretization because there sub-control volumes are identical to full
control volumes. In particular, ebos -- and by extension `flow_ebos`
-- is unaffected because it does not even use that code.
2017-03-01 15:02:58 +01:00
Andreas Lauser
99304f9689 change the order of OPM_UNUSED and variable name
it seems like some compilers (GCC 4.9.2?) are picky about this and
require

```c++
TypeName VariableName __attribute__ ((__unused__))
```
2017-01-17 13:28:56 +01:00
Andreas Lauser
b58c1a5ad4 lens_immiscible_ecfv: use "float" values for the linear solver
it seems to work fine and the linear solver gets quite a bit faster.
2016-12-06 22:48:50 +01:00
Andreas Lauser
0724855289 adapt forgotten #include statement for Unused.hpp 2016-11-30 14:35:14 +01:00
Andreas Lauser
ec4b6c82dd fix most pedantic compiler warnings in the basic infrastructure
i.e., using clang 3.8 to compile the test suite with the following
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
```

should not produce any warnings anymore. In my opinion the only flag
which would produce beneficial warnings is -Wdocumentation. This has
not been fixed in this patch because writing documentation is left for
another day (or, more likely, year).

note that this patch consists of a heavy dose of the OPM_UNUSED macro
and plenty of static_casts (to fix signedness issues). Fixing the
singedness issues were quite a nightmare and the fact that the Dune
API is quite inconsistent in that regard was not exactly helpful. :/

Finally this patch includes quite a few formatting changes (e.g., all
occurences of 'T &t' should be changed to `T& t`) and some fixes for
minor issues which I've found during the excercise.

I've made sure that all unit tests the test suite still pass
successfully and I've made sure that flow_ebos still works for Norne
and that it did not regress w.r.t. performance.

(Note that this patch does not fix compiler warnings triggered `ebos`
and `flow_ebos` but only those caused by the basic infrastructure or
the unit tests.)

v2: fix the warnings that occur if the dune-localfunctions module is
    not available. thanks to [at]atgeirr for testing.
v3: fix dune 2.3 build issue
2016-11-09 14:54:22 +01:00
Andreas Lauser
9b53930557 add a second reference solution for the test of the adaptive finger problem
for some reason, there are differences between my laptop with
optimizations and my workstation in debug mode. since the results look
_very_ similar in paraview, let's treat them both as equally valid.
2016-11-03 21:26:33 +01:00
Andreas Lauser
79a838e7c8 fix the grid adaptivity functionality
Note that this is rarely tested because it requires the availability
of dune-alugrid and dune-fem.
2016-11-02 17:33:20 +01:00
Andreas Lauser
b31e0c3d2f fix build for the unit tests if dune-alugrid is available
it failed because the stencils now require to specify the DOF-mapper
externally...
2016-11-02 13:33:22 +01:00
Robert Kloefkorn
a6d8748105 [feature] Make mapper inside stencil a reference to avoid re-computation of offsets when ElementContext is created. 2016-10-30 15:33:20 +01:00
Andreas Lauser
aa8aca077d test driver: add hack to only compare the output of the actual help message
it seems like some libraries print some mutable garbage to stdout on
startup or shutdown which causes test failures.
2016-10-28 12:57:02 +02:00
Andreas Lauser
f0e5a25126 make the dune-localfunctions dependency optional
as a side effect, two-point gradients are now used by default for the
vertex-centered finite volume discretization. (because P1-FE gradients
require the FE shape functions and those are provided by
dune-localfunctions.)

as a consequence, this triggered an update of quite a few reference
solutions: the differences are measurable, but as far as I can see,
the results are compareable. also, this commit regresses the
performance of the test for the reservoir problem with the vertex
centered finite volume scheme a bit. While I would not bet a house on
the reason, I'm pretty sure that this is caused by the switch from P1
FE gradients to two-point ones.

Note that even though I'm the author of this patch, it shamelessly
rips off substantial parts of the @dr-robertk's patch:
https://github.com/OPM/ewoms/pull/69
2016-09-22 15:23:14 +02:00
Andreas Lauser
f90d1058a2 remove the navier-stokes test problem
this problem did not work properly anyway: it oscillated like hell
(very likely to the spatial discretization used being inappropriate)
and it did not even converge if more than a single iteration was
required.
2016-09-22 14:58:19 +02:00
Andreas Lauser
c4b3864bca VTK output: start writing at sequence number 0
i.e., in most cases the initial solution will be written into file
$SIM_NAME-00000.vtu and each time step will be written to the file
with the same number as the one printed during the simulation. (note
that this statement does not apply if the visualization files are not
written for all time steps.)
2016-08-13 12:41:59 +02:00
Andreas Lauser
82b8335b6e rename "local AD" to "dense AD" 2016-06-04 23:56:47 +02:00
Andreas Lauser
4d37a50c83 remove support for the legacy ALUGrid library provided by dune-grid
now, the dune-alugrid module is required if these tests are to be
run. (note that due to the fact that the OPM build system has not been
detecting the legacy alugrid library for a while, the practical
implications of this patch should be small to non-existant.)
2016-05-04 13:22:51 +02:00
Andreas Lauser
1d38555f92 adapt to the removal of the tags for local-AD evaluations 2016-04-16 23:23:44 +02:00
Andreas Lauser
290584dddc clean up the licensing preable of source files
the in-file lists of authors has been removed in favor of a global
list of authors in the LICENSE file. this is done because (a)
maintaining a list of authors at the beginning of a file is a major
pain in the a**, (b) 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 removing
the lists...)

the only exception of this is the eWoms fork of dune-istl's solvers.hh
file. This is beneficial because the authors of that file do not
appear in the global list. Further, carrying the fork of that file is
required because we would like to use a reasonable convergence
criterion for the linear solver. (the solvers from dune-istl do
neither support user-defined convergence criteria not do the
developers want support for it. (my patch was rejected a few years
ago.))
2016-03-17 13:20:20 +01:00