Commit Graph

435 Commits

Author SHA1 Message Date
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
8a10a4d901 adapt to the move of the valgrind client requests into the Opm namespace 2017-02-09 18:25:44 +01:00
Andreas Lauser
a9f53f9d87 Groundwater problem: use the conjugated gradient solver from dune-istl
the groundwater problem should be symmetric because it uses an
incompressible fluid, is a single phase problem and uses the
immiscible model. (i.e., there should never be a difference between
the upstream and the downstream cells.)

the main purpose of this commit is to have a test that uses a linear
solver wrapper which was generated by the internal
EWOMS_WRAP_ISTL_SOLVER macro.
2017-01-21 21:17:00 +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
b1995f7dfb provide access to the prestine linear solvers of dune-istl
... and use the restarted GMRES solver in conjunction with a ILU-2
preconditioner for the water-air unit test.

I do not really recommend using these solvers because BiCGSTAB tends
to be 20% to 30% slower than our home-brewn implementation (this is
because the dune-istl solvers cannot use custom convergence criteria),
but dune-istl offers more choices than just BiCGStab and this
functionallity could be helpful when debugging issues related to
solving the linear systems of equations.

Note that regardless of how pedantic the interpretation of DUNE's
license is, there are no licensing issues with this code because we do
not distribute any files derived from DUNE anymore.
2017-01-02 15:45:41 +01:00
Andreas Lauser
d514667977 remove the modified version of the linear solvers from dune-istl
i.e., the solvers.hh file is removed. The main reason for this is that
it avoids having to distribute a file with a potentially incompatible
license (i.e., GPLv2 + template exception vs GPLv2+), but the
home-brewn bicgstab solver also seems to perform a tiny bit better.
2017-01-02 15:45:41 +01:00
Andreas Lauser
aa194cddbb reservoir_ncp_vcfv: change the epsilon base value for the finite difference method to 1e-11
this *might* fix the failed test on the jenkins server.
2016-12-16 21:24:36 +01:00
Andreas Lauser
e160bf7dd3 the new home of Valgrind.hpp is opm-common! 2016-12-14 12:38:12 +01:00
Andreas Lauser
64af85c1da adapt to the move of quad.hh to opm-material 2016-12-14 12:38:12 +01:00
Andreas Lauser
01326ad3c7 adapt to the move of Unused.hpp from opm-material to opm-common 2016-11-22 14:41:07 +01:00
Andreas Lauser
923605a427 move all applications into their top-level directory
thanks to [at]akva2 for the suggestion.
2016-11-11 15:04:04 +01:00
Andreas Lauser
6fcb16c0c9 fix a signedness issue when retrieving parameters
the issue only bites if the tests are compiled in debug mode, so it
has only been discovered now.
2016-11-10 20:19:46 +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
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
00a907962b co2injection problem: increase tolerance for conservativeness check
this fixes a few test failures in debug mode with quadruple precision
math enabled.
2016-11-02 16:37:57 +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
bbd545c358 reservoir problem: reduce the raw tolerance of the newton method to 10^-6
10^-4 lead to sporadic results if the final tolerance of the solution
really was 10^-4. (it currently is usually better because each time
step experiences an additional update after the Newton method deems it
to be converged.)
2016-10-14 18:26:55 +02:00
Andreas Lauser
db073ed7e3 lens problem: set the residual phase saturations again
this makes the results of the lens test problem match with those
obtained using dumux exactly. (if the time step sizes are forced to be
the same.)
2016-10-03 21:04:12 +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
50e63422ba some minor cleanups
these are:

- remove the unused methods "baseEpsilon()" and "numericEpsilon()"
  from FvBaseAdLocalLinearizer. (they are only meaningful in the
  context of finite differences.)
- correct/update some comments
- replace most occurences of Toolbox::createConstant() with
  assignments to floating point values to unclutter the code a bit.
2016-09-06 18:22:13 +02:00
Andreas Lauser
17670977f0 fix the reservoir problem tests with the blackoil model
this broke with 94006531. I actually fixed the reservoir problem
yesterday before pushing 94006531 but forgot to include the fix in my
local branch before pushing. Stupid me!
2016-07-12 19:12:22 +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
b31ceff970 adapt to the recent opm-material API change w.r.t. the ParameterCache
this is necessary to allow non-trivial ParameterCache objects with
Local-AD evaluations. So far, the only fluid system in opm-material
which needs this is the Spe5 fluid system (which is unused by eWoms),
but sooner or later this change would have been required anyway.

Note that it is possible that this patch is errornous if Evaluation !=
Scalar for a fluid system that uses a non-trivial ParameterCache
object, but the errors should be relatively easy to fix...
2016-04-15 18:44:14 +02:00
Andreas Lauser
8a420748f5 use automatic differentiation for the co2injection_flash_ecfv test
i.e., the simulation for the CO2-injection problem which uses the
flash solver to handle its thermodynamics and element centered finite
volume method as the spatial discretization. The intention is to
ensure that opm-material's NcpFlash constraint solver works with
non-primitive types as Scalars. (or rather: that it will be quickly
detected if it breaks in that case.)
2016-04-08 14:29:26 +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
Andreas Lauser
a128d49a6d lens problem: some small performance improvements
the changes enable the storage cache and the intensive quantity cache
for all simulators of the lens problem and automatic differentiation
for the one which uses the ECFV discretization.

while the performance improvements are not worthwhile for the problem
in its default incarnation (using automatic diffentiation even
slightly degrades performance), it speeds up linearization by about
30% if the grid exhibits 16 times as many elements (e.g. by passing
the --grid-global-refinements=2) parameter.
2016-01-23 20:35:20 +01:00
Andreas Lauser
fd387777b5 make all tests and ebos compile when selecting float or quad as Scalar
at least, they compile as far as eWoms is concerned. Some external
libraries (in particular everything which uses SuperLU) still have
issues.

Also, there seem to be issues with the precision that is achievable
by the Newton method when using float.
2016-01-17 21:15:21 +01:00
Andreas Lauser
855abc09fc change the default grid used for the lens problem back to Dune::YaspGrid
this is because the reference solution changes for newer versions of
dune-alugrid and one of the main purposes of the lens problem is to
allow comparison with Dumux relatively easily. (Dumux usese YaspGrid
for its version of the lens problem.)
2016-01-17 21:15:03 +01:00
Robert Kloefkorn
9c38271ea4 FingerProblem: use shared_ptr to avoid mem leak. 2016-01-08 12:27:05 -07:00
Robert Kloefkorn
47c9b39e3b FingerProblem: bug fix, store pointers of MaterialLaw since copying seems not ot work.
LensProblem: use structuredgridmanager from ewoms/io.
2016-01-08 12:08:04 -07:00
Robert Kloefkorn
c10d4905f7 LensProblem and FingerProblem: use StructuredGridManager. 2016-01-07 15:59:31 -07:00
Robert Kloefkorn
9dd0ebff6b FingerGridManager: use DGF Parser. 2016-01-07 14:55:35 -07:00
Robert Kloefkorn
56b6d4a129 FingerProblem: avoid creating of unused empty grid. 2016-01-07 13:57:37 -07:00
Robert Kloefkorn
503b5038f6 FingerProblem: bug fix, don't use ALUGrid's SFC reordering. 2016-01-07 12:04:18 -07:00
Robert Kloefkorn
b9c0368915 FingerProblem: remove warning. 2016-01-07 11:32:54 -07:00
Robert Kloefkorn
c36cba7660 FingerProblem: restore default values. 2016-01-06 16:41:29 -07:00
Robert Kloefkorn
8526c6c0ea Merge remote-tracking branch 'upstream/master' into PR/ewoms-can-use-dune-fem 2016-01-06 16:21:17 -07:00
Andreas Lauser
877eccb4cc reservoir problem: various improvements
- start with an initial "do nothing" episode of 100 days to get
  hydrostatic conditions.
- after that, produce oil and inject water for 900 days. (thereafter
  the reservoir will be empty.)
- make the problem work with element centered FV discretizations. this
  requires to make the width of the injection/production areas at
  least one cell wide. This is achieved by using the new "WellWidth"
  property which specifies the with of wells as a factor of the total
  domain width.
- make the problem work with fully compositional models. This implied
  to calculate the full composition for the fluid states which specify
  the initial condition and the thermodynamic state at the wells.
- add tests and reference solutions for any combination of the {ECFV,
  VCFV} discretizations and the {black-oil, NCP} models.
2016-01-05 11:54:27 +01:00
Andreas Lauser
f6c835298a rewrite the mechanism to enforce constraint degrees of freedom
- the residual now does not consider constraints anymore
- instead, the central place for constraints is the linearizer:
  - it gets a constraintsMap() method which is analogous to residual()
    but it stores (DOF index, constraints vector) pairs because
    typically only very few DOFs need to be constraint.
- the newton method consults the linearizer's constraint map to update
  the error and the current iterative solution. the primary variables
  for constraint degrees of freedom are now directly copied from the
  'Constraints' object to correctly handle pseudo primary variables.
- the abilility to specify partial constraints is removed, i.e., it is
  no longer possible to constrain some equations/primary variables of
  a degree of freedom without having to specify all of them. The
  reason is that is AFAICS with partial constraint DOFs it is
  impossible to specify the pseudo primary variables for models which
  require them (PVS, black-oil).

  because of this, the reference solution for the Navier-Stokes test
  is updated. the test still oscillates like hell, but fixing this
  would require to implement spatial discretizations that are either
  better in general (e.g., DG methods) or adapted to Navier-Stokes
  problems (e.g., staggered grid FV methods). since both of these are
  currently quite low on my list of priorities, let's just accept the
  osscillations for now.
2016-01-05 11:54:26 +01:00
Andreas Lauser
c0f8fc274d remove partial relinarization
the reasons are the same as for removing linearization recycling but
more so.
2016-01-05 11:54:26 +01:00
Andreas Lauser
5de416e314 remove the linearization recycling
linearization recycling lead to more complex code and -- more
importantly -- frequently caused problems for simulators.
2016-01-05 11:54:26 +01:00
Andreas Lauser
7b2b310131 adapt to the recent blackoil API changes of opm-material 2016-01-04 15:32:55 +01:00
Andreas Lauser
cd0f14295e Flash model: do not change the flash tolerance in the model, fix the tests
for some reason, fixing "co2injection_flash_ni_ecfv" required to
disable the linearization recycling. I'm puzzled...
2015-11-18 18:10:04 +01:00
Andreas Lauser
2c97e90a79 make most indices unsigned
(instead of using 'int'.) This triggered quite a few compiler warnings
which are also dealt-with by this patch.
2015-11-18 18:09:56 +01:00
Robert Kloefkorn
5fb9c9e74e ArtGridManager: removed
DgfGridManager: added capability to handle fractures.
2015-10-20 14:40:18 +02:00
Robert Kloefkorn
c58713e92c [bugfix] avoid use of sfc for ALUGrid. 2015-10-20 14:40:18 +02:00
Andreas Lauser
6b2bf9a100 lens problem: make it easily switchable between ALUGrid and YaspGrid
"easily" is a relative measure and means "easy in the C++ code". it
works by setting the LENS_USE_ALUGRID define in lensproblem.hh.
2015-10-07 18:52:35 +02:00
Andreas Lauser
3720246c7d adapt to the simplifications of the blackoil PVT API in opm-material 2015-09-29 14:47:23 +02:00
Robert Kloefkorn
dc90cb934b CartesianIndexMapper: use the CartesianIndexMapper to applied the mapping from the
Cartesian coordinate to the flat index and vice versa.
2015-09-10 16:01:53 +02:00
Robert Kloefkorn
8dc97d54ca RestrictProlong: take problem parameters into account that depend on grid elements. 2015-08-07 19:49:50 +02:00
Robert Kloefkorn
b8b703cc2d FingerProblem: use PersistentContainer to store material laws. 2015-08-07 16:37:06 +02:00
Andreas Lauser
4c8b0524f1 finger problem: provide a version that used the ECFV discretization
and some assorted cleanups.
2015-08-06 15:24:56 +02:00
Andreas Lauser
8a6133b1b8 add a unit test for adaptivity that uses the finger problem 2015-08-06 13:48:38 +02:00
Andreas Lauser
5de508135a multiphase adaption criterion: some improvements
now all phases are considered and a potential division by zero (if all
the saturations of a phase are zero) is avoided.
2015-08-06 13:48:38 +02:00
Andreas Lauser
408afe74fe make the tests compile again
they were broken by the grid adaptation/Dune-FEM changes.
2015-08-06 13:48:37 +02:00
Andreas Lauser
4527aca9d3 Merge commit 'refs/pull/23/head' of github.com:OPM/ewoms
* github.com:OPM/ewoms:
  adaptation works, needs revision.
  [dune-fem] using discrete function works.
  some further work on grid adaptivity
  dune.module: add dune-fem as a noptional dependency

Conflicts:
	ewoms/common/start.hh
	ewoms/io/basegridmanager.hh
	ewoms/parallel/mpihelper.hh
2015-08-06 11:15:48 +02:00
Andreas Lauser
501db847cd remove our own fork of Dune::MPIHelper
this is not needed anymore because the grid manager is no longer a
singleton and the grid is thus is always destructed before
MPI_Finalize() is called.
2015-06-19 21:01:08 +02:00
Andreas Lauser
438acf34b7 improve the doxygen documentation
the module hierarchy should now even be mildly useful.
2015-06-19 13:20:19 +02:00
Andreas Lauser
d9e3a6d919 re-add the emacs and vim modelines to all source files
this makes things easier and IMHO these two lines do not cause any
disturbance.
2015-06-18 13:43:59 +02:00
Robert Kloefkorn
ff9e5ba4cf adaptation works, needs revision. 2015-06-09 23:59:57 +02:00
Andreas Lauser
2b4d70e3d9 some minor fixes
i.e., removing redundant namespace open- and closings due to the fact
that the property system now resides in the 'Ewoms' namspace instead
of in 'Opm', and making the headercheck work for all headers.
2015-05-21 16:19:13 +02:00
Andreas Lauser
46bd76407d make the ECFV simulator for the Richards-lens problem use AD
for the Richards model we can't use the CO2 injection problem because
this problem cannot be simulated by the Richards model. (Well,
strictly speaking the Richards model *can* simulate it, but it would
only produce garbage because the assumptions of the Richards model are
violated by that problem.)
2015-05-21 16:19:04 +02:00
Andreas Lauser
06700f77d7 make the simulator for the co2injection problem which uses the non-isothermal flash model with ECFV use automatic differentiation 2015-05-21 16:19:00 +02:00
Andreas Lauser
318dc70e77 make the simulator for the co2injection problem which uses the non-isothermal NCP model with ECFV use automatic differentiation 2015-05-21 16:18:56 +02:00
Andreas Lauser
7a01904f9f make the simulator for the co2injection problem which uses the non-isothermal PVS model use automatic differentiation 2015-05-21 16:18:51 +02:00
Andreas Lauser
528c2a8350 make the CO2 injection problem usable with AD
and use automatic differentiation for the simulator of the non-isothermal
immiscible co2 injection problem.
2015-05-21 16:18:40 +02:00
Andreas Lauser
2cef2a54f2 make the common parts of the discretizations AD aware
this works by introducing a splice called "LocalLinearizerSplice". The
the current local linearizer (which is based on the finite difference
method) is the default and can be set explicitly by setting the splice
to "FiniteDifferenceLocalLinearizer", the new linearizer using
automatic differentiation can be selected by setting the splice to
"AutoDiffLocalLinearizer".
2015-05-21 16:18:29 +02:00
Andreas Lauser
beeddb0a05 add a test for the Richards model using the ECFV discretization 2015-05-21 16:18:22 +02:00
Andreas Lauser
8e1d8ff5ea minimal changes which are required to make it compile with the local-AD opm-material module 2015-05-21 16:18:20 +02:00
Andreas Lauser
216508ef13 use the infrastructural code using its new locations 2015-04-28 13:38:28 +02:00
Andreas Lauser
d80fed167f Newton method: reduce extent of copy and paste programming
now the generic part of the update of the solution vector is done in
the base class and the derived classes can chose to only do the update
of the primary variables of the individual DOFs.
2015-03-01 15:51:04 +01:00
Andreas Lauser
f66fcbde46 adapt to the new PVT API of the black oil fluid system 2015-02-05 16:14:07 +01:00
Andreas Lauser
1d01fa1c8a reservoir problem: adapt for the setWaterViscosity() -> setWaterReferenceViscosity() rename 2015-01-26 12:55:37 +01:00
Andreas Lauser
18a582a88c Revert "rename {gil,gas}FormationVolumeFactor to \1FormationFactor"
This reverts commit c6c271f3ee. After a
more thorough investigation, the cannonical name of these quantities
turned out to be "* formation volume factor"...
2015-01-26 11:55:37 +01:00
Andreas Lauser
c6c271f3ee rename {gil,gas}FormationVolumeFactor to \1FormationFactor
this is the eWoms part of the rename...
2015-01-25 18:22:42 +01:00
Andreas Lauser
09cf9dc93b fix the quadruple precision stuff
this also fixes the SuperLU backend with __float128 on Dune 2.4. The
problem is that due to some hacks within dune-istl, the AMG solver
can't be used because it calls the direct solver directly without an
option to disable this. (This could be fixed in a similar fashion as
the SuperLU backend by copying everything into data structures which
use 'double' before calling into ISTL, but this is a thing for another
time.)
2015-01-06 13:45:33 +01:00
Andreas Lauser
506d14b2e4 rename "velocity modules" to "flux modules"
that's because these modules do not necessarily use a velocity to
calculate fluxes...
2015-01-05 15:25:19 +01:00
Andreas Lauser
5389c9fdfb use BiCGStab-ILU0 as the linear solver for the lens problem
... and use the parallel AMG solver for the CO2 injection problem.

this makes performance comparisions with Dumux much easier as the
solver performance should be more similar.
2014-12-21 18:40:59 +01:00
Andreas Lauser
29a2123642 rename *JacobianAssembler to *Linearizer
because this describes better what this class is doing...
2014-12-20 00:15:59 +01:00
Andreas Lauser
df60eecb2c fix build by always including the DGF parser for a given grid 2014-12-16 12:39:32 +01:00
Robert K
0b5db84085 DGFParser: avoid SGrid deprecation warning. 2014-12-16 10:39:35 +01:00
Andreas Lauser
a74a4d2f6e fix the dune 2.4 deprecation warnings
mainly this boils down to mapper.map(e) -> mapper.index(e)
2014-12-12 14:32:29 +01:00
Andreas Lauser
a8d5c72248 move everything which is ECL specific to applications/ebos
this helps to keep the core blackoil model code lean and mean and it
is also less confusing for newbies because the ECL blackoil simulator
is not a "test" anymore.

in case somebody wonders, "ebos" stands for "&eWoms &Black-&Oil
&Simulator". I picked this name because it is short, a syllable, has
not been taken by anything else (as far as I know) and "descriptive"
names are rare for programs anyway: everyone who does not yet know
about 'git' or 'emacs' and tells me that based on their names they
must be a source-code managment system and an editor gets a crate of
beer sponsored by me!
2014-11-28 13:01:32 +01:00
Andreas Lauser
1c35bb702f ECL problem: set the connate water saturation 2014-11-27 18:59:40 +01:00
Andreas Lauser
6496824546 ECL problem: make the code which converts gas to oil saturations a bit easier to read
This code is required in the first place because opm-material always
specifies all parameters in terms of the wetting saturations while the
gas is the non-wetting phase in a gas-oil system.
2014-11-27 18:42:19 +01:00
Andreas Lauser
a6d5223113 write ECL summary files for wells
so far, the units of the values written to disk are always what
Eclipse calls METRIC and the number of supported quantities is
somewhat limited...
2014-11-25 17:03:20 +01:00
Andreas Lauser
d0c14f7406 add the general framework for specifying auxiliary equations.
this does not disrupt the block nature of the linearized matrix
(i.e. Dune::BCRSMatrix is still used), but if the number of auxiliary
equations is smaller than that of the "main" discretization, the
superfluous equations are padded. if the number of additional
equations are larger than that of the equation, additional DOFs are
added.
2014-11-18 17:51:38 +01:00
Andreas Lauser
3a892ff896 improve the ECL well model
the biggest change is that it is now based on a new approach: the well
model now always calculates the bottom hole pressure for the full well
when asked for a source term. This change makes it possible to
implement cross flow within wells properly and should also make the
well model physically correct.

Also, the well model now uses the connection transmissibility factor
which makes it possible to use this quantity if it is specified by the
deck...
2014-11-18 17:51:38 +01:00
Andreas Lauser
935de71a18 ECL: move the grid manager to ewoms/io/
this class is probably useful for problems other than EclProblem and
the EclWellsManager already is at a generic place...
2014-10-06 12:24:17 +02:00
Andreas Lauser
e9ef352d80 powerinjection problem: make it work for 2D and 3D grids
and some minor variable renames in the base gradient calculator so
that a delta won't be mistaken for a derivative...
2014-10-01 13:37:55 +02:00
Andreas Lauser
5ca84d208f adapt the the table related API changes of opm-parser 2014-09-17 13:43:47 +02:00
Andreas Lauser
0d2bcdf610 some smallish parallel ctest improvements
the goal is to make it faster on computers with many cores: The
easiest way to do this is to ensure that the longest running tests are
not taking too much time and that they need about the same time. Thus
this patch contains the following changes which limits the CPU time
taken by each test to about two minutes in debug mode on my machine:

 - the water-air problem using the non-isothermal primary variable
   switching model now uses an 16x16 instead of a 32x32 grid. as a
   compensation it now runs for a year instead of 5000 seconds and the
   global grid refinement is now tested.
 - the end time of the lens problem ctests is now 3000 instead of
   30000 seconds. The binary itself does not change at all.
 - sort the tests in the CMakeLists.txt roughly in the order of their
   required time. (this will cause ctest not having to wait for long
   running test which were started late for too long.)
2014-09-03 13:09:47 +02:00
Andreas Lauser
1af65c8ba2 ecl grid manager: adapt to slightly changed Dune::CpGrid API 2014-08-25 13:34:32 +02:00
Andreas Lauser
f5baa7d760 test the tensor-vtk-output code a bit by enabling to write the intrinsic perms for the lens problem
this requires new reference solutions...
2014-08-22 21:53:27 +02:00
Andreas Lauser
9c57bfcf3c ECL problem: make it compile with Scalar != double
opm-parser always returns vector<double> as data fields...
2014-08-17 15:12:06 +02:00
Andreas Lauser
b76a77128c adapt to the reference pressure != surface pressure change in opm-material 2014-08-12 15:49:47 +02:00
Andreas Lauser
9d7cac49f5 remove most spurious semicolons
hopefully "most" means "all of them"...
2014-08-11 16:46:09 +02:00
Andreas Lauser
360246401e remove unused typedef, constants and enums
most of them anyway...
2014-08-11 14:24:13 +02:00
Andreas Lauser
9bbcb0d228 remove accidentally left over include
it was used for debugging intersection mappers. to make this include
work, dune-cornerpoint must be available and that the intersection
mapper PR must be merged.
2014-08-07 10:55:58 +02:00
Andreas Lauser
2922a8e3a0 use finishInit() properly for all problems
this means that all code which could potentially throw an exception is
moved to this method(). (In particular FluidSystem::init() proved
troublesome in the past.) Besides avoiding segmentation the faults
which stem from exceptions thrown in constructors, this also has the
advantage that simulations which spend a noticable amount of time to
initialize stop at the "correct" place, i.e. after the "Finish init of
the problem" message was printed by the simulator...
2014-08-06 16:31:48 +02:00
Andreas Lauser
6ff728565b ECL problem: use spline based two-phase material laws
... instead of piece-wise linear ones. This improves convergence rates
slightly.
2014-08-06 13:52:53 +02:00
Andreas Lauser
cb8668ce0a Black Oil model: implement support for multi-region PVT tables
this requires opm-material commit 12a6d1f
2014-08-05 16:52:52 +02:00
Andreas Lauser
35379d7575 ECL problem: fix "unused variable" warnings for optimized builds 2014-08-05 00:21:18 +02:00
Andreas Lauser
2ff8cdacf8 ECL simulator: add a well model based on the Peaceman approach
not yet implemented: group controls, changing well control modes after
a time step. (The latter should be relatively straight-forward.)
2014-08-04 20:29:54 +02:00
Andreas Lauser
8c457f3f78 ECL problem: write the initial solution again
this regressed after time step index of the initial solution was
changed from 0 (actually, this was also 0 for the first time step...)
to -1 in b30af664.
2014-08-04 17:16:48 +02:00
Andreas Lauser
6d6640fc9d use dune-alugrid instead of the old version from dune-grid if the module is available 2014-07-30 12:42:32 +02:00
Andreas Lauser
9e39939e15 ECL problem: set the first time step of the each epsiode to the report step size 2014-07-28 18:26:58 +02:00
Andreas Lauser
6f429d0590 ECL problem: move the code which potentially throws into the finishInit() method
this avoids some segfaults due to half constructed objects if an
exception is thrown on initialization.
2014-07-25 15:31:01 +02:00
Andreas Lauser
cad639ec21 adapt to the reworked blackoil fluid system and function tabulation classes
in particular, the density of undersaturated oil is now the one
specified by the PVTO keyword...
2014-07-24 14:59:34 +02:00
Andreas Lauser
4c44c0fa87 use the checkConservativeness() method in all appropriate test problems
"appropriate" basically means "does not use constraints", as
constraints do not care about the conservation quantities...
2014-07-22 12:41:56 +02:00
Andreas Lauser
eefecea33f FV discretizations: add checkConservativeness() debugging method
this method checks that the difference in the storage terms before and
after a time step is the same as the accumulated fluxes over the
domain boundary plus the source terms.
2014-07-21 21:25:27 +02:00
Andreas Lauser
99430085bd replace a few now-incorrect "Vcfv" prefixes in the comments 2014-07-21 21:21:42 +02:00
Andreas Lauser
99779a52e8 problems: fix some rename-fallout for the postTimeStep() to endTimeStep() drive 2014-07-17 16:54:05 +02:00
Andreas Lauser
ee8e522db8 lens problem: add an ECFV variant 2014-07-11 20:27:44 +02:00
Andreas Lauser
e0a9f58bfe fix the parallel AMG linear solver
... and actually use it for the lens problems. This seems to have been
disabled for debugging and later it was probably forgotten to turn it
on again. This led to some minor bit-rot in that code...
2014-07-11 20:26:15 +02:00
Andreas Lauser
c309145085 newton method: make the tolerance easily settable at run time
The reason for this is to be able to modify the tolerance according to
grid size: The NewtonTolerance parameter has been renamed to
NewtonRawTolerance and for the porous media models is divided by the
square root of the volume of the smallst finite volume in the grid to
get the final tolerance for the Newton method. This is necessary
because very large grids need to achive a higher volumetric accuracy
in the residual than very small ones...
2014-07-11 15:47:06 +02:00
Andreas Lauser
f6fc258b70 rework the model and problem initialization procedure
basically the init() method was split into a finishInit() method which
fills the data structures allocated in the constructor with meaningful
data and into applyInitialSolution() which does just that (and no
more!)
2014-07-11 20:01:54 +02:00
Andreas Lauser
be54eee3c2 ECL problem: fix the episode handling code
now the report steps specified in the deck are adhered to...
2014-07-09 12:03:50 +02:00
Andreas Lauser
1d9d03e0fd ECL problem: fix up calculation of the initial condition 2014-07-08 10:16:29 +02:00
Andreas Lauser
566c813820 ECL problem: Use Cartesian element indices for more fields from the deck
probably there are still a few missing...
2014-07-08 10:16:17 +02:00
Andreas Lauser
9704b89036 ECL problem: use logically cartesian cell indices to retrieve data from the deck
Before, it only worked if all cells were active. Also, take the NTG
and MULTPV keywords into account and prepare for permeability
multipliers.
2014-07-03 15:13:10 +02:00
Andreas Lauser
8e0e9e9d31 rename "(Volume|Flux)Variables" to "(In|Ex)tensiveQuantities"
"intensive" means that the value of these quantities at a given
spatial location does not depend on any value of the neighboring
intensive quantities. In contrast, "extensive" quantities depend in
the intensive quantities of the environment of the spatial location.

this change is necessary is because the previous nomenclature was very
specific to finite volume discretizations, but the models themselves
were already rather generic. (i.e., "volume variables" are the
intensive quantities of finite volume methods and "flux variables"
are the extensive ones.)
2014-06-24 18:24:09 +02:00
Andreas Lauser
536370fc96 ECL problem: Use Opm::EclipseState instead of the raw deck where possible
this means that property modifiers are now automatically supported...
2014-06-04 18:05:12 +02:00
Andreas Lauser
bec1b8ba96 grid managers: get rid of gridPointer(), make them robust to exceptions during construction 2014-05-30 16:52:58 +02:00
Andreas Lauser
d00027b55a ECL problem: fix the episode handling
now the episodes seem to match the report steps...
2014-05-30 13:53:36 +02:00
Andreas Lauser
18ee64fe2f clean up the richards model and follow the recent renames of opm-material 2014-05-08 17:18:48 +02:00
Andreas Lauser
69e6fb60a2 rename the tests/grids folder to tests/data
... since the "grids" in that folder are slowly accumulating
information. (e.g. the ART grid for the fracture mapper and ECLIPSE
decks in the future.)
2014-05-08 15:31:32 +02:00
Andreas Lauser
7d7aa7385e add parameter to also write the "mini steps" instead of just the "report steps" 2014-05-02 16:08:22 +02:00
Andreas Lauser
f8bcaea67d ECL problem: use the default material law for Eclipse and read the data from the deck
TODO: material laws other than the default one...
2014-04-28 19:12:53 +02:00
Andreas Lauser
81ae2566d7 finger grid manager: call the finalizeInit_() method of the base class
this grid manager was forgotten to be adapted and fixes a crash...
2014-04-27 21:38:09 +02:00
Andreas Lauser
42316a824e ECL problem: set the start time to the one specified in the deck 2014-04-27 19:12:32 +02:00
Andreas Lauser
4677e0f98b ECL problem: return the stem of the name of the deck file in the name() method
this causes output files to have the expected names, e.g. "SPE9" or
"NORNE" instead of "ECL"...
2014-04-27 19:12:32 +02:00
Andreas Lauser
c9dae3c663 make the name() method of problems non-static again
this allows to easily specify the problem name at runtime.
2014-04-27 19:12:32 +02:00
Andreas Lauser
20e03577a9 ECL simulator: use the report steps from the deck 2014-04-27 19:12:32 +02:00
Andreas Lauser
87f30dad6f refactoring: rename GridCreator to GridManager
because "manager" sounds less religious than "creator" and the
GridCreators did all kinds of other stuff besides creating the grid.

this patch also gets rid of the static function inside these classes,
which should make them easier to understand...
2014-04-27 19:12:32 +02:00
Andreas Lauser
4c7a2d2ca0 add a simulator which uses Eclipse data files and the blackoil model 2014-04-27 19:12:32 +02:00
Andreas Lauser
a76b64bc56 refactoring: extend the TimeManager to become the Simulator
this also comes with moving responsibilities around and some smaller
cleanups for the grid creation. (although grid creation could be
possibly done by the simulator now, the GridCreator concept has not
been abandoned, yet...)
2014-04-27 19:12:32 +02:00
Andreas Lauser
8cdde5de31 black oil: adapt to some renames in opm-material 2014-04-25 17:14:55 +02:00
Andreas Lauser
9e6a81e8f0 fix the headercheck 2014-04-08 17:23:39 +02:00
Andreas Lauser
7b41447b04 adapt to the recent renames of the phase indices in opm-material 2014-04-03 17:30:43 +02:00
Andreas Lauser
acde984a5a diffusion module: fix some small compilation problems
no guarantees that it works correctly, though...
2014-03-31 15:05:28 +02:00
Andreas Lauser
a7d6bf72c9 rename "partial reassembly" to "partial relinearization" 2014-03-30 13:38:36 +02:00
Andreas Lauser
2910a7542e adapt to the recent three-phase material law cleanups in opm-material 2014-03-27 18:58:58 +01:00
Andreas Lauser
9b5a5d7d6c flash model: enable volume variable caching and thermodynamic hints in the generic code
These used to be needed to be enabled by the problem, but doing it in
the generic code is more fool proof and thus better.

On my laptop, volume variable caching caused the linearization time
for first time step of the isothermal vertex-centered CO2 injection
problem using the flash model go from 33.7 to 15.7 seconds, and
enabling thermodynamic hints in addition yielded a linearization time
of "only" 9.5 seconds. (that is for a debug build compiled with clang
3.3.)
2014-03-25 22:44:40 +01:00
Andreas Lauser
6e3f6834ef introduce a mechanism to cache the volume variables
this is implemented by extending the existing functionality for hints
and leads to a significant reduction of the volume variables updates
required. unfortunately, the performance with cached volume variables
is basically identical to the non-cached case, so they are disabled by
default...

anyway, this makes the thermodynamic hints code more robust and
cleaner, so it does not hurt to add it...
2014-03-25 19:46:13 +01:00
Andreas Lauser
6b3b2ad281 do the rename job properly, remove the smooth upwinding stuff and central differences for the test of the Richards model 2014-03-07 17:15:39 +01:00
Andreas Lauser
61b177aef4 fix remaining valgrind complaints
now valgrind should work cleanly for all tests. *yay*
2014-03-07 15:24:26 +01:00
Andreas Lauser
55bb38118c problems: make the name() methods static
this allows to retrieve the name of the problem before it is
instantiated. this is required to be able to print the "Initializing
problem" message at the correct point (i.e., before instantiating the
problem).
2014-03-07 12:38:19 +01:00
Andreas Lauser
a9ad8f1cba add more flushs for output
this should make output less confusing if the stream caches some data...
2014-03-06 19:32:04 +01:00
Andreas Lauser
61de18739e remove the remnants of line search
and some other minor changes. (if you need line search the issue is
probably caused a different problem and line search would be just a
work-around anyway.)
2014-03-05 14:22:36 +01:00