Commit Graph

5534 Commits

Author SHA1 Message Date
Markus Blatt
3be954fe98 Move multMatrixTransposed for better testability.
Otherwise we need to deal with the property system of ewoms.
2018-02-26 15:49:59 +01:00
Markus Blatt
e53374b8ec Check which each well whether to call apply for well contributions.
This allows for different implementations of wells in well_container
when adding well contributions to the matrix.
2018-02-26 15:47:25 +01:00
Markus Blatt
455cf79d8d Fixed comments in StandardWell 2018-02-26 15:16:07 +01:00
Markus Blatt
5ec804d362 Prevent unused variable warning 2018-02-26 15:16:07 +01:00
Markus Blatt
3f0d6f7dca Space 2018-02-26 15:16:07 +01:00
Markus Blatt
96a636f25b Let WellModel decide whether to apply well contributions.
It queries the Well whether the jacobian also contains well contributions.
If not then it applies them in the operator in addition. Thus the
well knows whether that is needed or not.
2018-02-26 15:16:07 +01:00
Markus Blatt
afb806bc3e Remove effectless typedef in version check.
The typedef is the same and has no effect since we
switched to Dune::FMatrixHelp::invertMatrix.
2018-02-26 15:16:07 +01:00
Markus Blatt
8e78f02230 Use Dune::FMatrixHelp::invertMatrix for inversion
Thus we always take advantage of the specializations in ISTLSolver.hpp
and do need to take care about the type of the matrix block.
2018-02-26 15:12:14 +01:00
Markus Blatt
b5d55b9fb2 Fix indentation and whitespace. 2018-02-26 14:35:04 +01:00
Markus Blatt
2e7313ac08 Cater for move of CpGrid header 2018-02-26 14:35:04 +01:00
Markus Blatt
9221bc958b Added missing header includes 2018-02-26 14:35:04 +01:00
Markus Blatt
01b90bce05 Improve well matrix products 2018-02-26 14:35:04 +01:00
Markus Blatt
22dfa6f135 Setup auxiliary module only once with all possible well completions.
Clearing the auxiliary modules will result in the sparsity pattern being
recomputed. Previously we did this before each nonlinear solve. But for the
master branch the sparsity pattern was only computed once for the whole
simulation.

To get the same behaviour (one sparsity pattern computation) we change the
auxiliary module to include all well perforations that might become active
during the simulation and do this once up front of a simulator run.

Please note that the new matrix entries might also improve convergence for
the ILU if the well is not active.
2018-02-26 14:35:04 +01:00
Markus Blatt
07f61c2a2b Add auxiliary module in BlackoilModelEbos constructor.
Previously, we did this during assemble. Unfortunately, this resulted
in the sparsity pattern being recomputed every time instead of just
once for a non-linear solve.
2018-02-26 14:35:04 +01:00
Markus Blatt
799cbb4b62 Add influences by well perforations to matrix.
This is only done upon request and uses the auxiliary module approach
provided by ewoms.

In the case of adding the influences we do not execute applyWellModelScaleAdd
or applyWellModel in the operator
2018-02-26 14:35:04 +01:00
Markus Blatt
d0fcd1a8e9 Add non neighboring connections induced by well perforations to matrix sparsity pattern
This is only done upon request and uses the auxiliary module approach
provided by ewoms.
2018-02-26 14:32:50 +01:00
Kai Bao
a8f560b046 addressing the comments. 2018-02-21 14:45:22 +01:00
Kai Bao
89bb589755 update the reservoir volume in WellState 2018-02-21 12:20:43 +01:00
Kai Bao
abfe9d445b recoring solution gas rate and solutiion oil rate in StandardWell 2018-02-21 12:20:43 +01:00
Kai Bao
f33657aabf adding a few memebers to WellStateFullyImplicitBlackoil
to get ready for populating well reservoir rates, solution gas
production rates and solution oil production rates.
2018-02-21 12:20:43 +01:00
Atgeirr Flø Rasmussen
d4ca28ec61
Merge pull request #1409 from totto82/fix_default_output_dir
Fix default output dir
2018-02-19 17:04:35 +01:00
Atgeirr Flø Rasmussen
1b33769922
Merge pull request #1399 from totto82/MoveWell
Some more cleaning in the output code in opm-output, ewoms and opm-simulator
2018-02-19 15:05:20 +01:00
Tor Harald Sandve
bcb501e3d3 Fix default output dir 2018-02-19 13:09:07 +01:00
Atgeirr Flø Rasmussen
8e9b13584d
Merge pull request #1403 from lars-petter-hauge/empty_wells_init
Allow Wells struct initialization without wells
2018-02-14 10:31:52 +01:00
Lars Petter Øren Hauge
011143829d Allow Wells struct initialization without wells
Calling wells()->number_of_wells on nullptr causes segmentation fault. This
occurs when running a deck without wells. Allowing WellsManager::init to
continue for decks without wells enables the well struct to be set.

Authored by Sveinung Rundhovde & Lars Petter Hauge
2018-02-13 16:43:10 +01:00
Atgeirr Flø Rasmussen
4f414b78ed Ensure we do not dereference nullptr. 2018-02-13 16:22:11 +01:00
Tor Harald Sandve
a89a6af854 Some more cleaning in the output code in opm-output, ewoms and opm-
simulator

1) Don't depend on legacy code for communicating the data::wells
2) Bugfix. Store globalIdx instead localIdx in data::wells::complitions
3) Move ThreadHandle to ebos
2018-02-12 08:44:43 +01:00
Atgeirr Flø Rasmussen
cf9b7c39b9 Adapt to moved opm-grid headers. 2018-02-10 08:33:33 +01:00
Andreas Lauser
3d0fca2f08 adapt to the gridManager() -> vanguard() change in ewoms 2018-02-08 16:27:42 +01:00
Andreas Lauser
7f3a9f1f43 catch NumericalIssue instead of NumericalProblem
the underlying problem is that the OPM build system does not define a
HAVE_OPM_COMMON macro in config.h.
2018-02-08 12:02:25 +01:00
Markus Blatt
a82598abe7 include ErrorMacros.hpp to safely make use of OPM_THROW (and not abort) 2018-02-07 16:56:12 +01:00
Markus Blatt
f381336dff Remove unused function parameters and default arguments for AMG construction.
It turned out that they are not needed and used.
2018-02-07 16:32:00 +01:00
Andreas Lauser
58a1b7df1f adapt to the move of infrastructure from opm-common to opm-material 2018-02-07 13:32:52 +01:00
Markus Blatt
bf3132e9cf Fixes unused variable warning 2018-02-06 19:48:26 +01:00
Markus Blatt
cda0c22d0f Avoid negation in if clause 2018-02-06 15:36:23 +01:00
Markus Blatt
034b1840ae Fixed comment about smoother arguments needed for construction 2018-02-06 15:34:13 +01:00
Markus Blatt
4c590c17d6 Moved definition of CPRParameter to top of header as needed for constructor call. 2018-02-06 15:32:35 +01:00
Markus Blatt
fc9acf963e Spelling fixes in BlackoilAmg.hpp 2018-02-06 15:31:50 +01:00
Markus Blatt
14cde5bafc Made use of range based for for graph traversal. 2018-02-06 15:30:24 +01:00
Markus Blatt
a8dde44afc Removed dead code und commented code. 2018-02-06 15:28:10 +01:00
Markus Blatt
6bcfce1733 Prevent problems to due oversight in parallel AMG.
Currently we run into issues with the parallel AMG if
redistribution happened on the coarsest level. That is
not detected by AMG and it will construct smoothers on
all processors present before the redistribution. Some of
them will get OwnerOverlapCommunication objects that have
an invalid MPI communicator in them (MPI_COMM_NULL) and an
MPI_ERROR will be raised as we communicate in the constructor.

With this patch we detect this situaton and set the pointer to
OwnerOverlapCommunication to null to prevent communication. A
sanity check that the matrix has zero rows has been added.
2018-02-06 13:19:59 +01:00
Atgeirr Flø Rasmussen
532403c5fb
Merge pull request #1391 from totto82/RFIP
Use FIP, EGRID and INIT output code in ebos.
2018-02-06 12:54:01 +01:00
Markus Blatt
28e566ba02 [bugfix] Prevent indexing an array of zero size for matrices with zero rows. 2018-02-06 12:45:13 +01:00
Markus Blatt
cfa311e055 recover compilation support for dune versions <2.6 2018-02-05 22:09:37 +00:00
Markus Blatt
cf1cdbd375 Improved documentation 2018-02-05 22:37:01 +01:00
Markus Blatt
8fc20456c5 Allow user to request aggregating the pressure system before solving it.
For this we added a new parameter cpr_pressure_aggregation. If it is true
we will aggregate the pressure already for the first system.
2018-02-05 22:37:01 +01:00
Markus Blatt
e24d338ddc Resort to support the usual parameters (as for flow_legacy)
These are solver_approach=cpr cpr_use_amg=(true|false), etc.
2018-02-05 22:37:01 +01:00
Markus Blatt
c367382a59 Prepare to use ILU for pressure system. 2018-02-05 22:37:01 +01:00
Markus Blatt
abacbe2cfc Do not use expensive aggregation when forming pressure system unless requested.
That means that for traditional CPR no aggregation is used and we simply extract
the pressure component.
2018-02-05 22:37:01 +01:00
Markus Blatt
5d8da52679 Use decoupling strategy of Scheichl/Masson in the CPR preconditioner.
Often it is claimed by CPR-AMG evangelists that this will make the pressure
system more elliptic. That may be the case. But even more important it also
decouples the pressure from the saturations.

Without this approach the pressure correction influences the smoothing of the
full system too much and e.g. for Norne CPR is worse than simple block ILU0.
2018-02-05 22:37:01 +01:00
Markus Blatt
6d21214fa7 Switch to ParallelOverlappingILU0 for CPRPreconditioner.
This seems to have been forgotten previously. Now the code int CPRPreconditioner.hpp
uses ParallelOverlappingILU0 instead of SeqILU[0n]/BlockPreconditioner which
makes the code more slim.
2018-02-05 22:37:01 +01:00
Markus Blatt
e6e18a3aa9 Make Blackoil system amg / CPR (flow_ebos) DUNE 2.6 aware. 2018-02-05 22:37:01 +01:00
Markus Blatt
c089a59cba Fix compiler lookup of get method. 2018-02-05 22:37:01 +01:00
Markus Blatt
f5d81513da First version of a AMG for the Blackoil equations.
The approach is inspired by Geiger's system-amg but we use dune-istl
aggregation AMG for it. On the fine level all unknowns attached to a cell
form a matrix block and are treated fully coupled. To form the first
coarse level system we use only the pressure component to guide the aggregation
and neglect all other unknowns on the fine level. All other level are formed
in the usual way by scalar aggregation.

Currently,it has to be requested for flow_ebos manually by passing
"linear_solver_use_amg=true amg_blackoil_system=true" to it.
2018-02-05 22:37:01 +01:00
Arne Morten Kvarving
2da361414e changed: relocate the remaining files in opm/core/utility
move to opm/common/utility/numeric
2018-01-30 16:33:46 +01:00
Arne Morten Kvarving
141186ad1d changed: opm/[core -> common]/utility/parameters 2018-01-30 16:33:45 +01:00
Arne Morten Kvarving
e9e5c15e99 changed: opm/[core/linalg -> common/utility/numeric]/blas_lapack.h 2018-01-30 12:47:10 +01:00
Arne Morten Kvarving
e9404486bb changed: opm/common/[->utility]/ResetLocale.hpp 2018-01-30 12:34:04 +01:00
Arne Morten Kvarving
742d2d2158 changed: opm/common/[util->utility]/numeric/cmp.hpp 2018-01-30 12:13:30 +01:00
Tor Harald Sandve
cdeefc3a34 Fix command line argument for double precision restart output 2018-01-29 08:56:55 +01:00
Tor Harald Sandve
84a8b8eca6 Pass empty regionSummaryData and blockSummaryData to output 2018-01-29 08:56:55 +01:00
Tor Harald Sandve
b38430ea2e Output TCPU for every substep. 2018-01-29 08:56:55 +01:00
Tor Harald Sandve
6d0c716d76 Clean-up FIP 2018-01-29 08:56:55 +01:00
Tor Harald Sandve
36f6b7ad00 Remove writInit()
The EGRID and INIT files are written using ebos
2018-01-29 08:56:55 +01:00
Andreas Lauser
386ade39f4 flow: let core ebos handle the output directory for the result files
this adds a new parameter --ecl-output-dir=$FOO to the "virtual"
command line arguments of the ebos simulator.
2018-01-29 08:54:30 +01:00
Tor Harald Sandve
137ff53ae7 Remove output of FIP 2018-01-29 08:54:30 +01:00
Arne Morten Kvarving
4945c9b2ed changed: pass the mcmg element layout as a parameter for dune 2.6
the template parameter is deprecated
2018-01-22 17:25:14 +01:00
Arne Morten Kvarving
2aa0043550 changed: use Dune::createScalarProduct for dune 2.6
ScalarProductChooser is no more
2018-01-22 17:24:58 +01:00
Arne Morten Kvarving
4315665b64 changed: expose category as member for dune 2.6
the enum can only be used with a define, and that would
just be a temporary solution in any case
2018-01-22 17:23:22 +01:00
Arne Morten Kvarving
83d4dae117 changed: do not ifdef the entire implementation
better to handle this in build system
2018-01-17 18:16:26 +01:00
Arne Morten Kvarving
c03a980199 Import the remaining code from opm-core 2018-01-17 15:18:56 +01:00
Andreas Lauser
f34cfafc22
Merge pull request #1377 from totto82/useEbosEclOutput
Start using ecl output from Ebos
2018-01-10 15:01:27 +01:00
Atgeirr Flø Rasmussen
6c8b0d68ca Remove use of old implicit imcomp 2p transport. 2018-01-08 17:23:43 +01:00
Atgeirr Flø Rasmussen
8ad9c979f8 Remove old 2p simulator. 2018-01-08 17:22:50 +01:00
Atgeirr Flø Rasmussen
aca95895c9 Fix: set precision of the correct stream. 2018-01-08 17:18:47 +01:00
Tor Harald Sandve
0e6fe26a61 Start using ecl output from Ebos
The wells, FIP and initial output of NNCs is still handled
by code in opm-simulators. The plan is to move more of the
functionality to ebos.

All tests pass and MPI restart works
2018-01-04 09:29:58 +01:00
Tor Harald Sandve
969d8f238d Use phase and comp info from FluidSystem
TODO: The output, fip and restart still uses a mixture of old and
new phase indices. This needs to be adressed in future PRs
2018-01-03 08:44:37 +01:00
Atgeirr Flø Rasmussen
9f14b63b82
Merge pull request #1370 from totto82/changeDpMaxDefault
Change dp_max_rel default from 1.0 to 0.3
2017-12-20 16:59:43 +01:00
Tor Harald Sandve
7567748f2d Adapt to changed initial FluidState type in ebos 2017-12-15 08:19:01 +01:00
Tor Harald Sandve
4097a07572 Change dp_max_rel default from 1.0 to 0.3 2017-12-14 11:16:16 +01:00
Andreas Lauser
5bf53148c0 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-12-11 11:33:52 +01:00
Andreas Lauser
db1f257184 make call_umfpack.c compile even if UMFPACK is not available
That said, don't try to call any of its functions or you'll regret it
at runtime!
2017-12-11 11:33:52 +01:00
Andreas Lauser
503c7d1ca8 make the PETSc code compile even if PETSc is not available
if PETSc is not available, the .cpp file will compile fine because it
will be reduced to be empty, but trying to include
LinearSolverPetsc.hpp in this case will result in an error.
2017-12-11 11:33:52 +01:00
Andreas Lauser
244871829d PhaseUsage: handle polymer and solvent the same way as energy 2017-12-11 10:30:14 +01:00
Andreas Lauser
4571a8f841 add an energy "phase"
This is quite a hack: Even though energy is not a "phase" and it is
also not considered in MaxNumPhases and pu.num_phases because this
would break a lot of assumptions in old code, it is nevertheless
assigned an "canonical index" that can be translated "active index"
via PhaseUsage::phase_pos[]. This awkwardness is needed because much
of the legacy OPM code conflates the concepts of "fluid phase" and
"conserved quantity" and fixing that issue would basically mean an
almost complete rewrite of much of the legacy code. That said, the
same statement applies to polymer and solvent, but these are currently
handled as even more second-class citizens because they are not even
given a canonical index and also cannot be translated into an active
one.
2017-12-11 10:30:14 +01:00
Arne Morten Kvarving
075d518bea fixed: add ENERGY to switch to quell unhandled enum value warning 2017-12-05 17:13:08 +01:00
Arne Morten Kvarving
dfd91d162b quell signed/unsigned comparison mismatch warning 2017-12-05 16:50:58 +01:00
Arne Morten Kvarving
b702d3834b remove unused variable 2017-12-05 16:50:52 +01:00
Atgeirr Flø Rasmussen
03a0baf447
Merge pull request #1343 from GitPaean/single_phase_resv
making the single phase RESV injection work.
2017-12-05 14:06:44 +01:00
Atgeirr Flø Rasmussen
8f1adadeae
Merge pull request #1355 from totto82/removeInitDupl
Only compute the initial solution once.
2017-12-05 08:44:11 +01:00
Roland Kaufmann
5284497bad Remove superfluous backing class for share_obj
I originally wanted to make share_obj a class so that I could hide the
helper function, but it turned out that I needed a function after all
since a function template can be inferred from the parameters but the
type cannot from the constructor.

By returning a shared_ptr directly, the compiler can do return object
optimization.
2017-12-04 16:24:14 +01:00
Roland Kaufmann
f173dad56e Provide stream that ignores everything written to it
Use this stream when you want a straight code path, but also be able
to disable output at will.
2017-12-04 16:24:14 +01:00
Roland Kaufmann
9193105410 Change from pass-by-value to pass-by-const-ref
The object is copied when put into the list, so there should be no
danger of dangling references.
2017-12-04 16:24:14 +01:00
Roland Kaufmann
0c53ac1509 Add classes for event-handling
The new classes Event and EventSource can be used as a simple mechanism
for implementing event-based callbacks in the simulators.
2017-12-04 16:24:14 +01:00
Atgeirr Flø Rasmussen
a767e166ae Make DataMap.hpp properly include its dependencies. 2017-12-04 16:24:14 +01:00
Joakim Hove
3725ac8f7d Added DataMap.hpp 2017-12-04 16:24:14 +01:00
Tor Harald Sandve
095b82212c Use the initial solution from Ebos 2017-12-04 10:35:30 +01:00
Atgeirr Flø Rasmussen
65034250d1
Merge pull request #1356 from dr-robertk/PR/fix-minor-issue-gridview
[bugfix] make code compile when GridView is not Grid::LeafGridView.
2017-12-04 09:25:43 +01:00
Tor Harald Sandve
31657a5d1c Add efficiencyFactor to GuideRate 2017-12-01 11:32:35 +01:00
Kai Bao
9317c1f023 removing the current argument in updateWellStateWithTarget
and some other cleaning up.
2017-11-30 17:14:29 +01:00