Commit Graph

425 Commits

Author SHA1 Message Date
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
Andreas Lauser
eac638d21a parallel iterative solvers: doc update, add missing solvers and precoditioners 2014-03-04 18:06:56 +01:00
Andreas Lauser
59a82a0a40 Always use the reduction of the maximum of the weighted residual as convergence criterion
This should make things a much more robust, partially because now the
linear and the non-linear solvers use the same convergence criterion.

Also, this patch includes some collateral indentation improvements.
2014-03-04 18:06:56 +01:00
Andreas Lauser
b39910eb34 shorten all lines to at most 100 characters
well, if there is no good way to do so, accept a slightly larger
number. Anyway, the longest line is now at 104 characters...
2014-02-11 00:46:17 +01:00
Andreas Lauser
e876e32c36 remove all vim and emacs modelines
for emacs, add a toplevel .dir-locals.el file instead...
2014-01-16 17:58:10 +01:00
Andreas Lauser
d98dd5a309 remove some unused typedefs and constant, some indentation fixes 2013-12-27 19:13:15 +01:00
Andreas Lauser
29926a7d06 rename "bbox" to "boundingBox" 2013-12-27 18:55:46 +01:00
Andreas Lauser
46fca5437c fix lonely DUNE 2.3 deprecation warning
now akvarium should be fully happy build-wise...
2013-12-14 11:32:50 +01:00
Andreas Lauser
bf32eb0010 Implement the element centered finite volume spatial discretization
This makes eWoms multi-discretization capable. Along the way, this
fixes some bugs and does a medium sized reorganization of the source tree.

This is a squashed patch of the following commits:

--------
1st commit message:

add initial version of the element centered finite volume discretization

currently, it is a misnomer as it is just a copy of the vertex
centered discretization plus some renames...

--------
2nd commit message:

rename [VE]cfvModel -> [VE]cfvDiscretization

--------
3rd commit message:

ecfv: prelimary changes required to make it compile

but not work yet...

--------
4th commit message:

Rename *FvElementGeometry to *Stencil

"Stencil" seems to be the standard expression for this concept...

(also, it is not specific to finite volume methods and is shorter.)

--------
5th commit message:

refactor the stencil class for the element centered finite volume discretization

--------
6th commit message:

ECFV: some work on the stencil class

--------
7th commit message:

ECFV: make the boundary handling code compile

--------
8th commit message:

rename elemContext() to elementContext()

--------
9th commit message:

ECFV: make the VTK output modules compile

--------
10th commit message:

stencil: introduce the concept of primary DOFs

also save an vector of all element pointers in the stencil.

--------
11th commit message:

ECFV: try to fix assembly; add missing timeIdx arguments to the num*() methods

--------
12th commit message:

ECFV: fix stupid mistake in the assembler

--------
13th commit message:

ECFV: remove a few implicit DOF == vertex assumptions

the black-oil example now runs without valgrind complaints until it encounters
a negative oil mole fraction.

--------
14th commit message:

VCFV: make everything compile again

all vertex centered FV examples should now work again...

--------
15th commit message:

rename [ev]cfvmodel.hh to [ev]cfvdiscretization.hh

the classes have already been renamed.

--------
16th commit message:

ECFV: make it work to the point where it can write out the initial solution.

--------
17th commit message:

ECFV: make it work

the local residual/jacobian needed some work in distinguishing primary
and secondary DOFs and there was an minor issue with the serialization
code.

for some reason, it seems still not correct. (-> convergence is too slow.)

--------
18th commit message:

VCFV: make it compile for the black oil model again

--------
19th commit message:

VCFV: make it compile with the remaining models again

--------
20th commit message:

flash model: make it work with ECFV

although this breaks its compatibility with VCFV. (-> next commit)

--------
21st commit message:

adapt the VCFV to make it compatible with the flash model again

--------
22nd commit message:

make all models compile with VCFV again

--------
23rd commit message:

VCFV: more cleanups of the stencil

VcfvStencil now does not have any public attributes anymore. TODO: do
not export attributes in the SubControlVolume and SubControlVolumeFace
classes.

--------
24th commit message:

VCFV: actually update the element pointer

--------
25th commit message:

change the blackoil model back to ECFV

--------
26th commit message:

immiscible model: make it compatible with the ECFV discretization

--------
27th commit message:

PVS model: make it work with ECFV

--------
28th commit message:

NCP model: make it work with ECFV

--------
29th commit message:

rename Vcfv*VelocityModule to *VelocityModule

--------
30th commit message:

richards model: make it work with ECFV

--------
31st commit message:

unify the ECFV and the VCFV VTK output modules

and other cleanups

--------
32nd commit message:

unify the common code of the VCFV and the ECFV disctretizations

--------
33rd commit message:

unify the element contexts between element and vertex centered finite volumes

--------
34th commit message:

unify the local jacobian class of the finite volume discretizations

--------
35th commit message:

replace [VE]vcf(LocalResidual|ElementContext|BoundaryContext|ConstraintsContext) by generic code

--------
36th commit message:

replace the [EV]cfvLocalResidual by generic code

--------
37th commit message:

unify the MultiPhaseProblem and Problem classes, introduce NullBorderListCreator

--------
38th commit message:

remove the discretization specific boundary context

--------
39th commit message:

unify the [EV]cfvDiscretization classes

--------
40th commit message:

Unify [EV]cfvMultiPhaseFluxVariables

--------
41st commit message:

Unify the [EC]cfvNewton* classes

--------
42nd commit message:

Unify [EV]cfvVolumeVariables

--------
43rd commit message:

unify [EV]cfvAssembler

--------
44th commit message:

unified flux variables: fix stupid mistake when calculating pressure gradients

--------
45th commit message:

unify what's to unify for the [EV]CFV properties

--------
46th commit message:

make the method to calculate gradients and values at flux approximation points changeable

Currently, this is used by the vertex centered finite volume method to
be able to use P1-finite element gradients instead of two-point
ones...

--------
47th commit message:

make the restart code work correctly, use the correct DofMapper for VCFV

--------
48th commit message:

actually use the gradient calculator in a model

the immiscible model in this case

--------
49th commit message:

move some files around to where they belong, use the new gradient calculation code in all models

TODO: proper handling of boundary gradients

--------
50th commit message:

fix the stokes model

currently it only works with the vertex centered finite volume
discretization, but the plan is to soon move it to a staggered grid
scheme anyway...

--------
51st commit message:

move all models back to using the vertex centered finite volume discretization by default

--------
52nd commit message:

models: some variable renames and documentation fixes

- scv -> dof
- vert -> dof
- vertex -> dof
- replace 'VCFV'
- fix some typos

--------
53rd commit message:

don't expect UG anymore

since it is quite non-free and hard to get. we now use ALUGrid instead!

--------
54th commit message:

temporarily disable jacobian recycling

--------
55th commit message:

fix writing/reading restart files using the generic code

--------
56th commit message:

fix bug where fluxes were only counted once in the stencil

this only affected the vertex centered finite volumes discretization...

--------
57th commit message:

boundary gradients: use the center of the sub-control volume adjacent to a boundary segment

--------
58th commit message:

make it compile on GCC

--------
59th commit message:

get rid of most hacks

for this, partial reassemble and jacobian recycling was brought
back. For the this and the remaining stuff the main trick is the
introduction of the GridCommHandleFactory concept which constructs
communication handles suited for the respective spatial
discretization...

--------
60th commit message:

fix a few annoying bugs

first, default the convergence criterion for the linear solver did not
honor the initial residual which lead to linear solver breakdowns,
then some debugging code was left in the discrete fracture model and
then there was a bug in the TP gradient approximation class...

this has the consequence that we need a new reference solution for the
discrete fracture problem...

--------
61st commit message:

iterative linear solver: remove the code for the non-default convergence criteria

--------
62nd commit message:

provide the FE cache instead of the local FE

this fixes a segfault in the stokes model caused by the fact that the
local FE was not initialized at this point.

--------
63rd commit message:

(Navier-)Stokes: fix bug due to the transition to unit normals

now, all tests pass for this branch. The only things which need to be
fixed are some annoying performance regressions compared to master and
some bug in the splices feature of the property system...

--------
64th commit message:

some fix for the local residual of the immiscible model

--------
65th commit message:

Navier-Stokes: implement SCV center gradients

There seems to be a bug in the previous implementation (the jacobian
inverse transposed is evaluated using the local, not the global
geometry), so the reference solution for the stokes2c test problem has
also been updated...

--------
66th commit message:

remove the ALUGrid specialization of the LensGridCreator and the YaspGrid one for the fingerproblem

using different grid seems to sometimes cause a different vertex
order, which in turn causes the respective test to fail if the
reference solution was computed using the other grid...

--------
67th commit message:

VCFV: use the correct BorderListCreator

this makes MPI parallel computations work again. apart from
performance regressions, this branch does not exhibit any known
regressions compared to master anymore...

--------
68th commit message:

make verything compile with the element centered finite volume discretization

except the Navier-Stokes and the two-phase DFM models, of course...

--------
69th commit message:

minor fixes

- make the navier-stokes model slighly more generic by using the
  proper (in,ex)teriorIndex() methods on sub-control volumes
- make the signature of the calculateValue() template method of the
  common two-point gradient approximator match the one of the vertex
  centered finite volume one

--------
70th commit message:

fix fallout from the Big Rebase

--------
71st commit message:

ECFV: some bugs in the boundary

--------
72nd commit message:

make computeFlux() compute area-specific quantities

--------
73rd commit message:

fix more bugs in the element centered FV discretization

now eWoms should match Dumux pretty closely...

--------
74th commit message:

coalesce the common code of the multi phase porous medium models into "MultiPhaseBaseModel"

--------
75th commit message:

update reference solutions

these were changed because of the screw-up with the area of boundary
segments...

--------
76th commit message:

rename "ImplicitBase" to "FvBase"

because in eWoms, everything is implicit and these are currently the
base classes for all finite volume discretizations.

--------
77th commit message:

make the spatial discretization selectable using a splice

This requires an opm-core with a the patches from
https://github.com/OPM/opm-core/pull/446 merged...

--------
78th commit message:

rename the properties used for splices to *Splice

--------
79th commit message:

move the files in 'tests/models' to 'tests'

since 'tests' was empty except for the 'models' subdirectory...

--------
80th commit message:

improve and fix the tutorial

--------
81st commit message:

remove the -fno-strict-aliasing flag from the provided option files

seems like recent versions of Dune have been adapted...

--------
82nd commit message:

also compile all CO2 injection simulations using the element centered finite volume discretization

--------
83rd commit message:

PVS model: make it work properly with the element-centered finite volume discretiation

because DOF != number of vertices
2013-12-12 12:52:44 +01:00
Andreas Lauser
3c8229586f update the in-file copyright holder statements
this patch is quite large as there were various bug fixes to the
script which generates these statements
2013-12-02 17:20:09 +01:00
Andreas Lauser
10d80f01f9 replace in-file copyright notices by OPM the standard one 2013-12-02 15:53:54 +01:00