Commit Graph
100 Commits
Author SHA1 Message Date
Markus Blatt fb76737bea Moved step_msg inside if-branch
as it is not used outside of it.
2016-07-04 15:07:02 +02:00
Markus Blatt 047ae8f444 Use termininal_output_ to only print time step status once for parallel runs.
Previously each process printed this to the terminal
2016-07-04 13:46:29 +02:00
Markus Blatt 79670b1c29 Prevent signed-unsigned-comparison warning. 2016-06-28 15:50:50 +08:00
Markus Blatt c7cca46b2c Adds missing parallel reduction to euclidianNorm for multiple components 2016-06-28 15:50:50 +08:00
Markus Blatt 72d0b8123b Fixes the parallel Euclidian product for multiple phases.
This is used to compute the Euclidian product for the saturations.
Thes are ordered in an interleaved manner (all saturations for cell
with index 0, the all for index 1, ...). Up to now the implementation
assumed a different ordering: blockwise (all saturations for phase 0 first,
then all saturations phase 1, ...).
With this commit the computation uses the right assumption.
2016-06-28 15:50:50 +08:00
Markus Blatt 302d881557 Removed trailing underscore for local variable. 2016-06-28 15:50:50 +08:00
Markus Blatt b4feb28389 Make numWellVars work for null well pointers. 2016-06-28 15:50:50 +08:00
Markus Blatt 1a1797a061 Set wellsActive to false for null well pointers. 2016-06-28 15:50:50 +08:00
Markus Blatt 68f9180a65 Allow access to wells pointer for wells.
Using &stdwells.wells() throws an assertion for null pointers
without -DNDEBUG, but was used nevertheless. That prevented running
models without wells.
2016-06-28 15:50:50 +08:00
Markus Blatt 227b7f49b7 Do not store number of phases in StandardWells.
The wells pointer might be null and we need to access its number of
phases in the constructor to store it. With this commit we prevent that
storage and simply ask the well struct whenever we need the number of
phases. Of course the code using it needs to check that there are wells
but that is done in most parts of the opm-simulators currently
(MultiSegmentWells and Solvent are/might be an exception).
2016-06-28 15:50:50 +08:00
Markus Blatt f0cdacc7a0 Fix handling of no wells in WellStateFullyImplicitBlackoil.hpp
In that case we cannot call numPhases() on the wells as it produces
a floating point exception. As we do not use that information in this case
anyway, we simply use -1 instead to prevent the call.
2016-06-28 15:50:50 +08:00
Markus Blatt 4c9d359638 Print all well switching in parallel.
As for each well only one process is responsible, the output process
does not see all wells. Ergo some well switching information was never
printed in a parallel run.

Therefore with this commit the well switching
message is printed regardless on which process it appears.
2016-06-28 15:50:50 +08:00
Markus Blatt b76887ca0b Prevent signed-unsigned-comparison warning. 2016-06-27 15:42:07 +02:00
Markus Blatt 6c69b2fd99 Adds missing parallel reduction to euclidianNorm for multiple components 2016-06-27 15:33:54 +02:00
Markus Blatt 9149c6ad13 Fixes the parallel Euclidian product for multiple phases.
This is used to compute the Euclidian product for the saturations.
Thes are ordered in an interleaved manner (all saturations for cell
with index 0, the all for index 1, ...). Up to now the implementation
assumed a different ordering: blockwise (all saturations for phase 0 first,
then all saturations phase 1, ...).
With this commit the computation uses the right assumption.
2016-06-27 15:33:54 +02:00
Markus Blatt 90132a3bc5 Removed trailing underscore for local variable. 2016-06-27 14:40:14 +02:00
Markus Blatt a1832f2e5e Make numWellVars work for null well pointers. 2016-06-27 13:06:16 +02:00
Markus Blatt f04eec04ba Set wellsActive to false for null well pointers. 2016-06-27 13:05:37 +02:00
Markus Blatt c20620534a Allow access to wells pointer for wells.
Using &stdwells.wells() throws an assertion for null pointers
without -DNDEBUG, but was used nevertheless. That prevented running
models without wells.
2016-06-27 13:03:30 +02:00
Markus Blatt 9a7b77af9c Do not store number of phases in StandardWells.
The wells pointer might be null and we need to access its number of
phases in the constructor to store it. With this commit we prevent that
storage and simply ask the well struct whenever we need the number of
phases. Of course the code using it needs to check that there are wells
but that is done in most parts of the opm-simulators currently
(MultiSegmentWells and Solvent are/might be an exception).
2016-06-27 12:14:17 +02:00
Markus Blatt 5ed788ce6f Fix handling of no wells in WellStateFullyImplicitBlackoil.hpp
In that case we cannot call numPhases() on the wells as it produces
a floating point exception. As we do not use that information in this case
anyway, we simply use -1 instead to prevent the call.
2016-06-27 11:57:04 +02:00
Markus Blatt d170bbb109 Print all well switching in parallel.
As for each well only one process is responsible, the output process
does not see all wells. Ergo some well switching information was never
printed in a parallel run.

Therefore with this commit the well switching
message is printed regardless on which process it appears.
2016-06-07 16:56:37 +00:00
Markus Blatt 82d6d949db Fix the parallel L-infinity norm calculation.
It was computing a global maximum before, which obviously is not the same thing.
2016-06-07 15:10:25 +02:00
Markus Blatt 82556ca1d0 Fix uninitialized value 2016-06-07 12:40:24 +02:00
Markus Blatt 1656836f00 Change variable name along recommendation. 2016-06-07 12:38:56 +02:00
Markus Blatt af881e84b2 Fix whitespace. 2016-06-07 12:37:21 +02:00
Markus Blatt a1096f222c Make CPR preconditioner honor linear_solver_ignoreconvergencefailure 2016-06-06 08:43:56 +00:00
Markus Blatt 9bd2f7c1dc Fix incomplete type error for std::ofstream in examples
On my system I got
```c++
error: variable ‘std::ofstream file’ has initializer but incomplete type
         std::ofstream file(fname.str().c_str());
```
This is fixed with this commit by including fstream. Previously, this include might have happened implicitely.
2016-05-27 09:10:00 +00:00
Markus Blatt ecf4ab91c8 Fixes size in assrtion of BlackoilStateDatahandle::scatter 2016-05-25 14:36:33 +00:00
Markus Blatt e9b8721d2a Prevent dereferencing a null pointer during parallel output.
ParallelDebugOutput will always dereference its member variable
globalReservoirState_ even if it will not be used for any output.
In g++ this throws when using -D_GLIBCXX_DEBUG -DDEBUG -DGLIBCXX_FORCE_NEW.
I any case we will have a dangling reference into Nirvana in
PackUnPackSimulationDataContainer. This commit fixes this by always
initializing the pointer globalReservoirState_. In the case where the rank
does not perform any output its size will be zero.
2016-05-25 13:49:33 +00:00
Markus Blatt 8dd3794562 Fixes copy&paste bugs from resize code movement 2016-05-25 13:07:29 +00:00
Markus Blatt c247652188 Moved resizing of BlackoilState members to the data handle.
Seems much less messy.
2016-05-25 12:47:24 +00:00
Markus Blatt 509cd6f0b1 Use correct size when resizing hydroCarbonState.
The size is the number of cells and not dependent on the number of phases.
This was a typical copy&paste mistake that wasted space.
Kudos to atgeirr for catching this.
2016-05-25 12:43:12 +00:00
Markus Blatt 22e71dff08 Correctly distribute the hydro carbon state for parallel runs.
This is needed since hydro carbon state is used to get the
primal variables since PR #687, commit 9c771ab6. Therefore we
now distribute the state along with rest of the black oil state
variable at the start of a parallel simulation.

This closes issue #695
2016-05-24 20:02:24 +00:00
Markus Blatt c0b871a38a Improves NNC error message. 2016-02-18 22:05:01 +01:00
Markus Blatt 51b8d9acb1 Fixes the exception for models with threshold pressures.
Since the support for threshold pressures running Norne with
flow_mpi aborted error messages like
```
Program threw an exception: [/home/mblatt/DUNE-test/opm-autodiff/opm/autodiff/BlackoilModelBase_impl.hpp:383] Illegal size of threshold_pressures input ( 153924 ), must be equal to number of faces + nncs ( 78316 + 0 ).
```
This commit now distributes the threshold pressures (if present) just like the rest
of the model properties and Norne does not abort here any more.

Please note:
1. If there are NNCs flow_mpi will abort with an error.
2. We might want to resort to reading and calculating the threshold pressure
  (and maybe other properties) on distributed grids instead of using communication.
2016-02-18 17:00:08 +01:00
Markus Blatt 696dfc23ee Account for variable change in 2.4.1
Due to the upcomming release the name changes (j->j_, nnz->nnz_)already appear
in 2.4.1. This commit now checks for 2.4.1 and newer instead of 3.0 and newer.
2016-02-16 19:17:27 +00:00
Markus Blatt afc3ad3522 Guard access of well variable with asImpl().localWellsActive()
Since PR #541 the arrays cq_s, mob_perfcells, and b_perfcells are
empty if there are no wells in the domain of the process. This
caused segementation faults at various places where we compute
on the wells. With this commit we now guard this places using
asImpl().localWellsActive() and only using the array if the call
returns true.
2015-12-09 15:18:03 +01:00
Markus Blatt cb9d566ec2 Added braces to one-line for loop. 2015-12-02 11:29:38 +01:00
Markus Blatt 99c1b988a7 Fixed typo "consistent consistent" -> consistent. 2015-12-01 15:13:22 +01:00
Markus Blatt 0da66bf45b Removed more dead and code that was already commented out. 2015-12-01 15:11:27 +01:00
Markus Blatt fd78f1c0b9 Moved includes to \*.cpp file. 2015-12-01 14:56:29 +01:00
Markus Blatt 4adf8487ea Uses more speaking names for template parameter and adds more documentation. 2015-12-01 14:49:07 +01:00
Markus Blatt e05e3fa478 Removes code that was commented out. 2015-12-01 14:48:35 +01:00
Markus Blatt 0fdd27267b Adds empty lines around namespaces and comment about the end of a namespace. 2015-12-01 14:47:28 +01:00
Markus Blatt dc1d7c526f Moved ParallelOverlappingILU0 to its own file. 2015-12-01 14:41:06 +01:00
Markus Blatt ea187da888 Honor transmissibilities when loadbalancing 2015-11-25 08:43:46 +00:00
Markus Blatt dd77556252 Added restricted parallel schwarz and overlapping ILU0 preconditioner 2015-11-25 08:43:46 +00:00
Markus Blatt 5449047682 Splits a very long line. 2015-11-13 15:52:01 +01:00
Markus Blatt 8148c37d57 Improved documentation 2015-11-13 15:46:45 +01:00
Markus Blatt 980928bfa9 Fix boolean in specialization.
The default implementation is the parallel version. Therefore the boolean
in the specialization (sequential run) needs to be false.
2015-11-13 15:46:34 +01:00
Markus Blatt f8715e31e7 Calculate parallel averages in RateConverter.
Previously, local averages were calculated and used in the
well equations. With this commit we add versions of defineState and
calcAverages that take into account the parallel domain decomposition
and calculate correct averages.

Function  calcAverages has a boolean template parameter
indicating whether this is a parallel run. Additionally we introduce
AverageIncrementCalculator with the same boolean template parameter.
In a parallel run we check whether the cell is owned by the process and
only in this case return an increment bigger than zero. In a sequential run
(no MPI or just one process -> empty boost::any parameter) no overhead is
introduced.
2015-11-13 15:46:34 +01:00
Markus Blatt e729c26b26 Only specialize distributeGridAndData for CpGrid if MPI is found. 2015-10-30 13:23:52 +01:00
Markus Blatt 113949190b Removes unused typedef 2015-10-29 16:35:58 +01:00
Markus Blatt d29a181336 Adapts flow_solvent to change in redistribution interface. 2015-10-29 16:15:30 +01:00
Markus Blatt 1916c8d35a Prevent copying the porevolume when checking for convergence.
As it is just used to compute the tempV value there is no need to
copy it to a new vector. With commit we use a reference to
geo.poreVolume() instead to prevent the copy.
2015-10-29 16:12:54 +01:00
Markus Blatt f167d321aa Added some spaces around parenthesis. 2015-10-28 16:44:14 +01:00
Markus Blatt 134b47a5e2 Fixes SaturationPropsFromDeck handling during redistribution.
It needs a material law manager that works on the processes local
grid partition. Therfore copying the one from the global representation
does not work. Instead we now create an new SaturationPropsFromDeck and
initialize it with the local material law manager.
2015-10-28 16:44:14 +01:00
Markus Blatt 4526cce41b Setup a distributed material law manager and copy values.
Since the refactoring to using opm-material a material law  manager for
the global grid was used. This meant that the properties used for
elements of the local grid were wrong. With this commit we set up a
manager that is based on the local grid only.
2015-10-28 16:39:47 +01:00
Markus Blatt 6ee021f0c6 Fixed indentation. 2015-10-28 16:26:45 +01:00
Markus Blatt c17af8efe6 Update and improve documentation. 2015-10-28 16:23:07 +01:00
Markus Blatt f447cf648a fix compilation of flow_solvent. 2015-10-27 17:13:01 +01:00
Markus Blatt e555cd45f1 Correctly compute the scaling factor for the equations in parallel.
When running parallel one cannot use Eigen::Array::mean() for this
as the it is just a local part of the complete array. With this commit
we correctly compute the number of global cells in the grid and use this
together with a parallel reduction to compute a global mean value.
2015-10-27 01:58:16 +01:00
Markus Blatt 87e02a1059 Communicate rock properties, too.
Somehow I was mislead by the name rock properties that the data stored in
them is not associated to grid cells, but to rock regions. With this commit
we determine the porosity and permeability by communication.
2015-10-26 10:49:35 +01:00
Markus Blatt 975ac0dc37 Removes superfluous wellMap_ member from WellStateFullyImplicitBlackoil.hpp
There is a using `BaseType::wellMap` directive that redirects all the
well map accesses to the base class. In consequence the local wellMap_
is alway empty and just makes debugging harder. Therefore it is
removed in this commit.
2015-10-23 10:47:14 +02:00
Markus Blatt ba9f227a5b Cater for wells null pointer
In the rare occasion that there are no wells int the model the wells_ pointer in
BlackoilModelBase class is a null pointer. Therefore we need to test whether it is
null and only process well information if it is not.

This problem was reintroduced with PR #460 and gets fixed by this
one. No we can run the equilibrium examples without wells again.
Sorry for the inconvenience.
2015-10-22 16:28:18 +02:00
Markus Blatt f5e34e01ca Remove unnecessary shared_ptr for geology and black oil properties. 2015-10-22 15:24:25 +02:00
Markus Blatt 82a73d969e Renamed flow_cp to flow_mpi 2015-10-12 10:59:01 +02:00
Markus Blatt d7e6886f4b Return 0 as hydrostatic correction for unperforated cells.
There might be wells without any perforations. It it happens
to be the last well will supscript over the bounds. In other
cases we actually return the correction for the next well.

Not sure whether returning 0 makes any sense, though.
2015-09-24 14:47:45 +02:00
Markus Blatt 32b8ed654e Prevent memory leaks in case SeqILU0 throws an exception. 2015-09-08 14:38:29 +02:00
Markus Blatt 3c1498ce92 Only construct SeqILU0 in try block.
The rest is not needed and this simplyfies code.
2015-09-08 12:06:03 +02:00
Markus Blatt 2d50408b5f Catch and process exception during ILU0 in parallel for CPR, too. 2015-09-08 12:05:27 +02:00
Markus Blatt c97f125b56 Include rank into error message. 2015-09-08 11:48:06 +02:00
Markus Blatt 315251da2c Fix typo wether->whether. 2015-09-08 11:44:46 +02:00
Markus Blatt de8c638308 Put space around braces where it seems approppriate. 2015-09-08 11:15:46 +02:00
Markus Blatt ccac548420 Introduces parallel exception handling for ILU0 preconditioner.
When running Norne with the interleaved solver sometimes exceptions
(diagonal matrix block is not invertible) occur for some rows in the
ILU decomposition. In a parallel run this means that some, but not all
processes will see the exceptions. This leads to a classic deadlock.

With this commit we catch the exception during the setup of the preconditioner,
determine with the other processes whether there were any exceptions, and
in this case all the processes will throw an exception.

Currently this limited to Dune::MatrixBlockError, but we could extend this.
2015-09-08 09:46:35 +02:00
Markus Blatt b91fb70e92 Adds new header to CMakeLists_files.cmake
The new header 	opm/autodiff/AdditionalObjectDeleter.hpp
was not there yet.
2015-09-07 11:03:08 +02:00
Markus Blatt 8ed72cdf9f Remove unused experimental header include.
The include of ParallelRestrictedAdditiveSchwarz.hh was a left over
from some experiments and should not be here yet.
2015-09-07 10:48:34 +02:00
Markus Blatt 02120d14d1 Directly initialize variable with global value.
Previously we initialized a variable for a global
(i.e. sum over all processes) value with the local
value first and the overwrote it with the computed
global. This meant the name did not reflect the value
during the first initialization.

With this commit we fix this by using an additional
variable for the local value that is used to compute
the global one.
2015-09-07 09:50:36 +02:00
Markus Blatt 4cc87c28f6 Fixes parallel runs with solve_welleq_initially
If this option was set there were some branches in
the code that did depend on the local number of wells
but should depend on the number of wells in the reservoir
no matter on which process they are stored.

With this commit we introduce BlackOilModelBase::localWellsActive()
which only takes local wells into account. The function now
BlackOilModelBase::wellsActive() considers all active wells in the
reservoir.
2015-09-05 20:24:50 +02:00
Markus Blatt 45fdb3ac48 [bugfix] Use correct parameters for ParallelIstlInformation::copyValuesTo.
The last parameter of this functions specifies how vector/martix
entries there are per index/cell of the grid. For the interleaved
versions all components end up in one block. Therefore this number
needs to be one here (in contrast to the number of phases for the
non-interleaved version).

This commit new uses the correct number.
2015-09-05 16:09:33 +02:00
Markus Blatt 0adde744bf [bugfix] Make sequential preconditioner live as long as the parallel one.
It holds a reference to the sequential code. Previously this reference
point to a temporary object that was deleted upon exit of
constructPrecond.

With this commit use a unique_ptr to store the parallel
preconditioner. It also gets a custom deleter that will delete the
nested sequential iterator during destruction.
2015-09-05 16:09:33 +02:00
Markus Blatt 6890e8db71 Renames ParallelPreconditionerDeleter and moves it to a separate header.
The class is not limited to parallel preconditioners. To reflect this
we rename it to AdditionalObjectDeleter. As it will also be used for
the parallel interleaved version we move the class to a separate header.
2015-09-05 16:09:33 +02:00
Markus Blatt c527e15b63 Use well information during load balancing.
With this commit we pass the well information to
the loadbalance method of CpGrid to ensure that
each well is stored completely on one process.
2015-09-03 20:28:13 +02:00
Markus Blatt ff669bc32b [bugfix] Correctl resize satOilMax in a parallel run.
Previously, we tried to make an empty container bigger by
resizing it with its current size. Of course this is wrong and does
not change anything. With this commit we use the size of another
container which already has the correct size.
2015-09-01 20:30:30 +02:00
Markus Blatt 67d5a1f503 Prevents initializing std::shared_ptr from nullptr.
For g++-4.4 support for nullptr is not complete. Using it
to initialize an empty shared_ptr breaks compilation:

/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp: In constructor ‘Opm::HelperOps::HelperOps(const Grid&, Opm::EclipseStateConstPtr)’:
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp:87: error: no match for ternary ‘operator?:’ in ‘(bool)eclState ? eclState->.Opm::EclipseState::getNNC() : nullptr’
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp:87: note: candidates are: operator?:(bool, const Opm::NNC* std::__shared_ptr<const Opm::NNC, (__gnu_cxx::_Lock_policy)2u>::*, const Opm::NNC* std::__shared_ptr<const Opm::NNC, (__gnu_cxx::_Lock_policy)2u>::*) <built-in>
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/AutoDiffHelpers.hpp:87: note:                 operator?:(bool, const Opm::NNC* std::__shared_ptr<const Opm::NNC, (__gnu_cxx::_Lock_policy)2u>::*, T*) <built-in>

Here no conversion to shared_ptr happens.

/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/ImpesTPFAAD.cpp: In constructor ‘Opm::HelperOps::HelperOps(const Grid&, Opm::EclipseStateConstPtr) [with Grid = UnstructuredGrid]’:
/home/mblatt/src/dune/opm/opm-autodiff/opm/autodiff/ImpesTPFAAD.cpp:160: error: no matching function for call to ‘std::shared_ptr<const Opm::EclipseState>::shared_ptr(const dune_nullptr_t&)’
/usr/include/c++/4.4/bits/shared_ptr.h:1263: note: candidates are: std::shared_ptr<_Tp>::shared_ptr(std::shared_ptr<_Tp>&&) [with _Tp = const Opm::EclipseState]
/usr/include/c++/4.4/bits/shared_ptr.h:1238: note:                 std::shared_ptr<_Tp>::shared_ptr() [with _Tp = const Opm::EclipseState]
/usr/include/c++/4.4/bits/shared_ptr.h:1236: note:                 std::shared_ptr<const Opm::EclipseState>::shared_ptr(const std::shared_ptr<const Opm::EclipseState>&)

Here the DUNE's nullptr implementation is used with std::shared_ptr which are not
compatible.

We fix this by using the emptry constructor of std::shared_ptr to create a nullptr.
2015-07-23 15:33:45 +02:00
Markus Blatt 2180ccddbc Activates the parallelism in the adaptive time stepping schemes.
It does this simply by passing the information about the
parallelization to the adaptive time stepper.
2015-05-22 21:12:10 +02:00
Markus Blatt f6e3be5381 Adds space around some binary operators. 2015-05-20 17:54:43 +02:00
Markus Blatt f0f38d7ac2 Fix seting of parallel_run_ member.
We are having a parallel only if there are more than one processes,
and not already with only one.

Kudos to @atgeirr for finding this in the review.
2015-05-20 17:53:54 +02:00
Markus Blatt 11211ca7d2 Update copyright notices 2015-05-20 09:26:25 +02:00
Markus Blatt 764e1e26c1 Used the correct parallel information for the whole system.
The whole system consists out of three equations per cell. Using
the parallel index set of the grid cells for it is wrong. Therefore
we use PR OPM/opm-core#803 to set up an  additional parallel index set
for the whole system and use this for the communication that is needed e.g.
by the ILU preconditioner.
2015-05-19 19:41:32 +02:00
Markus Blatt cb4970c9a6 Prevent unused paramerter warning for RedistributeDatahandle. 2015-05-19 19:40:59 +02:00
Markus Blatt d987e75b6d Rename createPreconditioner to the more accurate name createEllipticPreconditioner. 2015-05-19 19:40:11 +02:00
Markus Blatt 523ba001f6 Correctly compute the infinity norms of the well equations in parallel.
Here we assume that a complete well can be represented on one process.
Thus we only need to compute the local norms followed by a global reduction.
2015-05-15 15:57:50 +02:00
Markus Blatt bf13922ff9 Correctly compute the infinity norm in parallel.
For this we need to use ParallelIstlInformation for the reduction operation.
2015-05-15 15:57:50 +02:00
Markus Blatt 48ce90fcc7 Compute scaled well residuals correctly for parallel runs.
This commit adapts the PR #375 for parallel runs. That is, the norms are
calculated over all wells, not just the ones that perforate the local grid
cells.
As this is a reduction, too, we move the computation to convergenceReduction
method.
2015-05-15 15:57:50 +02:00
Markus Blatt 9e0b2fed4f Notify well manager whether this is a parallel run.
In a parallel the well handling needs to be slightly
adapted, see PR OPM/opm-core#799. Therefore, we need to
pass a boolean flag to the well manager indicating whether
this is a parallel run or not.

With this commit we do this.
2015-05-15 15:57:50 +02:00
Markus Blatt f4ff1ea4c4 Added missing explicite braces around if branch. 2015-05-15 15:10:42 +02:00
Markus Blatt 0cd174f246 Adds spaces to binary operator. 2015-05-15 14:58:06 +02:00
Markus Blatt c37cf08ee0 Removes unused residualNorm method.
This method seems to be some leftover from refactoring.
In flow we now use computeResidualNorms() instead and
residualNorm() is not used anywhere. Therefore this commit
removes it to prevent confusion.
2015-05-12 17:30:27 +02:00