Commit Graph

629 Commits

Author SHA1 Message Date
Andreas Lauser
e65790224e replace #if HAVE_CONFIG_H by #ifdef HAVE_CONFIG_H
it seems like most build systems pass a -DHAVE_CONFIG_H flag to the
compiler which still causes `#if HAVE_CONFIG_H` to be false while it
clearly is supposed to be triggered.

That said, I do not really see a good reason why the inclusion of the
`config.h` file should be guarded in the first place: the file is
guaranteed to always available by proper build systems, and if it was
not included the build either breaks at the linking stage or -- at the
very least -- the runtime behavior of the resulting libraries will be
very awkward.
2017-10-27 17:48:26 +02:00
Andreas Lauser
cede806bd5 flow: refactor the specializations
The motivation for this PR is that currently the build fails on my
Ubuntu 17.10 laptop with two processes because that machine "only" has
8 GB of RAM (granted, the optimization options may have been a bit too
excessive). under the new scheme, each specialization of the simulator
is put into a separate compile unit which is part of
libopmsimulators. this has the advantages that the specialized
simulators and the main binary automatically stay consistent, the
compilation is faster (2m25s vs 4m16s on my machine) because all
compile units can be built in parallel and that compilation takes up
less RAM because there is no need to instantiate all specializations
in a single compile unit.

on the minus side, all specializations must now always be compiled,
the approach means slightly more work for the maintainers and the
flow_* startup code gets even more complicated.
2017-10-06 15:35:00 +02:00
Andreas Lauser
0c92c24dcb flow_ebos*: make it build and (the sequential part) work if dune-fem is available
in particular, this implied some changes to the MPI initialization
code. since dune-fem's GridPart class currently has issues with
CpGrid's implementation of loadBalance(), parallel computations still
do not work if dune-fem is around, but at least sequential ones now
do even if MPI is enabled.
2017-10-06 15:35:00 +02:00
Tor Harald Sandve
69c608829f Include RESV in the scaling factor
- solvent + RESV is not correct. Make the simulator throw until this is
sorted out.

- remove unused parameter
2017-09-18 11:28:13 +02:00
Tor Harald Sandve
352dccd5e9 Make 2p gas oil compile and runs
-- use mapping from canonicalToActiveCompIdx from Ebos
-- add guards againts non-existing components
2017-09-18 11:28:13 +02:00
Robert Kloefkorn
4266f89397 [cleanup] remove logFile line since it does not make sense. 2017-08-25 12:57:25 +02:00
Robert Kloefkorn
36c2133783 [cleanup] improvement of output message. 2017-08-24 11:39:46 +02:00
Robert Kloefkorn
07e0d71906 [feature][flow] Add a common executable for all flow variants, i.e.
flow_ebos, flow_ebos_polymer, flow_ebos_solvent, flow_ebos_2p.
2017-08-23 16:21:15 +02:00
Robert Kloefkorn
ce7f3f46a1 [feature] Added two-phase executable for numEq = 2. 2017-06-29 12:56:37 +02:00
Atgeirr Flø Rasmussen
4590481686 Added flow_reorder. 2017-06-28 07:47:15 +02:00
Markus Blatt
8759c3a89a Set defines in *.cpp files.
That way we can keep the old order of includes which seems to be needed for compilation.
2017-06-27 10:00:31 +00:00
Markus Blatt
59ca0b4424 Fix the PR that said it activated AMG.
Actually, it did not as it did set the define eith wrong
or the wrong locations. This commit fixes this and finally
makes AMG available.
2017-06-27 10:00:31 +00:00
Tor Harald Sandve
0068c175a7 Add polymer option to flow_ebos
No extra equation is added for polymer in the well equation.

Seperate executables are added for polymer: flow_ebos_polymer
and solvent: flow_ebos_solvent

Tested and verified on the test cases in polymer_test_suite

This PR should not effect the performance and results of the blackoil
simulator
2017-06-26 08:03:54 +02:00
Atgeirr Flø Rasmussen
699b0678a0 Remove unused simulator program.
This stand-alone simulator is no longer needed since
flow_polymer supports two-phase runs.
2017-06-14 14:15:13 +02:00
Atgeirr Flø Rasmussen
1a3c1d3058 Further templatized sequential model and simulator classes.
Now the actual pressure and transport model classes are not specified,
but taken as template template parameters, also grid and well model
are templates for both the sequential model and the simulator class,
although at this point only StandardWells is expected to work with
the sequential model.
2017-06-08 11:03:26 +02:00
Arne Morten Kvarving
3c0cb9e950 adjust for changed ParameterGroup namespacing 2017-04-28 15:36:25 +02:00
Atgeirr Flø Rasmussen
85e1544553 Use ensureDirectoryExists() instead of boost::filesystem directly.
Motivated by
 - proliferation of identical code
 - need to avoid strange behaviour with "." directory on some boost versions
 - potenial for further refactoring to avoid boost entirely
2017-04-06 12:14:54 +02:00
Atgeirr Flø Rasmussen
27c0430932 Change include paths for moved headers. 2017-02-10 16:07:25 +01:00
Arne Morten Kvarving
86fbb36fd2 adjustments for imported files
- adjust include paths
- add new test to build system
- add new example to build system
2017-02-10 13:02:00 +01:00
Arne Morten Kvarving
109780f62f Import adaptive time stepping and simulator timer from opm-core
also import associated tests / examples
2017-02-10 12:04:11 +01:00
Andreas Lauser
42ec0ca3c3 do not explicitly pass the permeability to the well model anymore
this information is already part of the EclipseState. The reason why
this should IMO be avoided is that this enforces an implementation
detail (ordering of the permeability matrices) of the simulator on the
well model. If this needs to be done for performance reasons, IMO it
would be smarter to pass an array of matrices instead of passing a raw
array of doubles.  I doubt that this is necessary, though: completing
the full Norne deck takes about 0.25 seconds longer on my machine,
that's substantially less than 0.1% of the total runtime.
2017-01-27 13:06:09 +01:00
Andreas Lauser
04a1c25ebf do not explicitly pass the permeability to the well model anymore
this information is already part of the EclipseState. The reason why
this should IMO be avoided is that this enforces an implementation
(ordering of the permeability matrices) the simulator on the well
model. If this needs to be done for performance reasons, IMO it would
be smarter to pass an array of matrices, instead of passing a raw
array of doubles.  I doubt that this is necessary, though: completing
the full Norne deck takes about 0.25 seconds longer on my machine,
that's substantially less than 0.1% of the total runtime.

in order to avoid code duplication, the permeability extraction
function of the RockFromDeck class is now made a public static
function and used as an implementation detail of the WellsManager.

finally, the permfield_valid_ attribute is removed from the
RockFromDeck class because this data was unused and not accessible via
the class' public API.
2017-01-27 12:51:12 +01:00
Joakim Hove
270e5f9c0e Passing keys to the restart load function.
- Renamed EclipseWriter -> EclipseIO.
 - Loading from restart file is a method on the EclipseIO class.
2017-01-25 23:16:08 +01:00
Atgeirr Flø Rasmussen
86b71e7d48 Merge pull request #989 from jokva/read-rock-compressibility-from-eclipsestate
RockCompressibility takes only EclipseState
2017-01-09 09:33:41 +01:00
Andreas Lauser
ef731672c9 remove the BlackoilPropsAdInterface abstraction layer
instead, directly use BlackoilPropsAdFromDeck.
2017-01-02 13:19:23 +01:00
Jørgen Kvalsvik
d2b5327a72 RockCompressibility takes only EclipseState 2016-12-20 12:39:34 +01:00
Jørgen Kvalsvik
6e92374d34 Read ROCK from EclipseState, not Deck 2016-12-20 12:24:27 +01:00
Atgeirr Flø Rasmussen
e223c03647 Merge pull request #800 from OPM/frankenstein
Frankenstein V2
2016-11-18 15:49:31 +01:00
Atgeirr Flø Rasmussen
71bd419c03 Do not assign to dereferenced null pointers. 2016-11-17 13:18:02 +01:00
Andreas Lauser
d989c1e2fc Merge remote-tracking branch 'origin/master' into frankenstein
* origin/master:
  Do not throw for unrecognized file when merging log files.
  Do not populate cellData but issue a warning in parallel.
  Removed ternary operator in inline initialization.
  Correctly mark transfer of ownership for ouptut writer
  Indent nested #if
  Remove Solution.sdc assignment
  Cater variable name change in BCRSMatrix of DUNE 2.5
  Fix using local active cells for writing eclipse files in parallel.
  add restart test for SPE1CASE2_ACTNUM
  rename the 'flow' binary to 'flow_legacy' and set a symbolic link
  Added ctest for restart files
2016-11-11 18:29:46 +01:00
Atgeirr Flø Rasmussen
129db89dc0 Merge pull request #900 from blattms/fix-parallel-eclipse-writing
Fix using local active cells for writing eclipse files in parallel.
2016-11-11 15:28:46 +01:00
Markus Blatt
3eba3353d0 Correctly mark transfer of ownership for ouptut writer 2016-11-10 13:04:30 +01:00
Markus Blatt
077dc02481 Fix using local active cells for writing eclipse files in parallel.
Previously, the eclipseGrid used by EclipseWriter was constructed from
the one in the EclipseState with the current CpGrid. Unfortunately the
latter was the distributed version resembling only the local part that
the processor works on. Therefore the information about the active cells
was wrong when writing results (which raised an exception in the writer).

With this commit we construct the EclipseWriter before distributing the grid
and use this writer later on in the OutputWriter.
2016-11-07 19:35:53 +01:00
Andreas Lauser
511a9039ab rename the 'flow' binary to 'flow_legacy' and set a symbolic link
this is a precursor of merging flow_ebos into the master
branch. hopefully, this won't break any existing setups...
2016-11-04 16:19:15 +01:00
Andreas Lauser
6754bad00b Merge branch 'master' into frankenstein
* master:
  Update to shared_ptr-less parser interface.
2016-10-20 20:16:42 +02:00
Jørgen Kvalsvik
1c6a4b34da Update to shared_ptr-less parser interface. 2016-10-20 14:08:04 +02:00
Jørgen Kvalsvik
ad6b77cc15 Update to shared_ptr-less parser interface. 2016-10-20 10:14:41 +02:00
Andreas Lauser
7cfe8322e2 Merge branch 'master' into frankenstein
* master:
  adapt to the removal of the unit system of opm-core
2016-10-19 13:30:44 +02:00
Andreas Lauser
d76bf11902 adapt to the removal of the unit system of opm-core
the one which is in opm-parser is now a drop-in replacement.
2016-10-10 17:00:09 +02:00
Andreas Lauser
62de30d9b2 Merge remote-tracking branch 'origin/master' into frankenstein 2016-09-12 23:18:02 +02:00
Joakim Hove
5aa2b97c31 shared_ptr<EclipseGrid> -> const EclipseGrid& 2016-09-03 17:49:46 +02:00
Joakim Hove
10d76d5bb1 shared_ptr<EclipseGrid> -> const EclipseGrid& 2016-08-31 19:39:39 +02:00
Atgeirr Flø Rasmussen
61af1fa53d Remove unused nnc arg from BlackoilOutputWriter constructor. 2016-08-30 13:18:06 +02:00
Andreas Lauser
2e56597d0e fix Dune 2.3 build issue
this time I tested it.
2016-08-10 15:05:31 +02:00
Andreas Lauser
4b4ecb1145 fix a build issue with dune 2.3
(hopefully)
2016-08-10 14:45:20 +02:00
Andreas Lauser
3027e1f39d flow_ebos: do no longer use the generic FlowMain class
this will allow to boil the code down.
2016-08-09 18:38:23 +02:00
Robert Kloefkorn
3db63b0a22 add flow_ebos, an ebos based simulator
it uses ebos for linearization of the mass balance equations and the
current flow code from opm-simulators for all the rest. currently, the
results match the ones from plain `flow` for SPE1, SPE9 and Norne, but
performance is not optimal: on SPE9, converting from and to the legacy
data structures takes about a third of the time to do the actual mass
balance assembly. nevertheless `flow_ebos` is almost as fast as plain
`flow` for SPE9. (for Norne `flow_ebos` is about 15% slower, even
though the results match quite closely. the reason for this is that it
requires more iterations for some reason.)
2016-08-09 18:38:23 +02:00
Pål Grønås Drange
bd58792714 TransMult, Init, and SimConfig are references, applyModifierDeck takes reference, and EclipseState constructor too 2016-08-08 10:07:09 +02:00
Pål Grønås Drange
9579e4acd8 transmult and initconfig are ref's, use ref for EclipseState constructor 2016-08-08 10:02:53 +02:00
Atgeirr Flø Rasmussen
7489f15ee9 Add sequential models for black oil.
This commit adds sequential solvers, including a simulator variant
using them (flow_sequential.cpp) with an integration test (running
SPE1, same as for fully implicit).

The sequential code is capable of running several (but not all) test
cases without tuning or special parameters, but reducing ds_max a bit
(from default 0.2 to say 0.1) helps with transport solver
convergence. The Norne model runs fine (esp. with a little tuning). A
parameter iterate_to_fully_implicit (defaults to false) is available,
when set the simulator will iterate with alternating pressure and
transport solves towards the fully implicit solution. Although that
takes a lot extra time it serves as a correctness check.

Performance is not competitive with fully implicit at this point:
essentially both the pressure and transport models inherit the fully
implicit model and do a lot of double (or triple) work. The point has
been to establish a proof of concept and baseline for further
experiments, without disturbing the base model too much (or at all, if
possible).

Changes to existing code has been minimized by merging most such
changes as smaller PRs already, the only remaining such change is to
NewtonIterationBlackoilInterleaved. Admittedly, that code (to solve
the pressure system with AMG) is not ideal because it duplicates
similar code in CPRPreconditioner.hpp and is not parallel. I propose
to address this later by refactoring the "solve elliptic system" code
from CPRPreconditioner into a separate class that can be used also
from here
2016-06-27 10:28:09 +02:00