Commit Graph

45 Commits

Author SHA1 Message Date
Andreas Lauser
0304183361 Newton: fail earlier
i.e. give up after 10 instead of 15 Newton iterations. since this now
also causes the CNV convergence criterion to be ignored after 8
instead of after 13 Newton iterations, and because CNV stagnation
seems to be the cause for the vast majority of the failures, it does
not lead to worse results or more time step chopping on Norne but
causes fewer wasted iterations.
2017-06-14 14:22:22 +02:00
Rohith Nair
58285bb8f8 edit 2017-06-07 14:46:04 +02:00
Rohith Nair
c12665e04f -Added exception TooManyIterations
-Combined log messages from NonLinearSolver_impl.hpp and AdaptiveTimeStepping_impl.hpp
2017-06-07 10:37:25 +02:00
Arne Morten Kvarving
3c0cb9e950 adjust for changed ParameterGroup namespacing 2017-04-28 15:36:25 +02:00
Andreas Lauser
ef2a560fb3 flow_ebos: print statistics about failed time steps
the performance summary at the end of a Norne run which are printed by
`flow_ebos` now looks like this on my machine:

```
Total time (seconds):         773.757
Solver time (seconds):        753.349
 Assembly time (seconds):     377.218 (Failed: 23.537; 6.23965%)
 Linear solve time (seconds): 352.022 (Failed: 23.2757; 6.61201%)
 Update time (seconds):       16.3658 (Failed: 1.13149; 6.91375%)
 Output write time (seconds): 22.5991
Overall Well Iterations:      870 (Failed: 35; 4.02299%)
Overall Linearizations:       2098 (Failed: 136; 6.48236%)
Overall Newton Iterations:    1756 (Failed: 136; 7.74487%)
Overall Linear Iterations:    26572 (Failed: 1786; 6.72136%)
```

for the flow_legacy family, nothing changes.
2017-04-11 11:12:11 +02:00
Atgeirr Flø Rasmussen
e325dcd04b Excessive nonlinear iterations is reported as problem, not error. 2017-04-06 14:52:19 +02:00
Andreas Lauser
f50dc9507f fix a few pesky sign comparison warnings
the problem here is that some types used as the `BVector` template
parameters return signed integers for the `size()` method, others
return unsigned ones.
2017-01-09 12:05:32 +01:00
Andreas Lauser
c880efae5b mostly eliminate Eigen in the FIP and VFP code
this code mostly used the Eigen vectors as arrays anyway, so let's use
`std::vector`.

also, this patch only "mostly eliminates" Eigen from from these parts
of the code because the source files of the VFP code still use
AutoDiffBlock; Unfortunately this cannot easily be changed because
`flow_legacy` depends on these methods. (`flow_ebos` does not use the
incriminating methods.)
2016-12-30 11:46:27 +01:00
Atgeirr Flø Rasmussen
3e120d6e33 Merge pull request #964 from totto82/reuse_cache2
Reuse cache revisited
2016-12-20 14:46:00 +01:00
Tor Harald Sandve
bb83504172 Let the simulator to re-assemble when iteration == minIter()
Let the simulator re-assemble and re-calculate the residuls for the case
when the simultor is converged but it was forced to take one more
iteration due to iteration < minIter().
2016-12-20 10:46:03 +01:00
Atgeirr Flø Rasmussen
45fed6d591 Merge pull request #975 from totto82/clean_up_2p
Use templates to avoid hardcoded typedef
2016-12-19 13:01:05 +01:00
Markus Blatt
51dabf36f2 Only log messages about failed timesteps on one processes.
This OPM_THROW was introduced lately and results in all processes
logging the failure. With this commit the message is logged only once.
2016-12-16 11:30:04 +01:00
Tor Harald Sandve
2bfa96fddf Templatize to avoid hardcoded typedef
Prepare for changing the size of the blocks by templatize BVectors and
Evalution
2016-12-12 14:52:30 +01:00
Andreas Lauser
8c5f92dbc4 extend and clean up the SimulatorReport 2016-11-25 21:19:57 +01:00
Tor Harald Sandve
b66bb27a65 Revert som changes in default values
Make sure flow in Frankenstein and flow in master uses the same default
values
2016-11-16 15:09:54 +01:00
Tor Harald Sandve
739c0906ef Improvments in convergence for flow_ebos
- restrict pressure changes. Set default to 1.0 (this also effects flow)
- change default number of linear iterations to 150
- tell stabilized newton the residual occilates even if it occilates in
only one phase (this also effects flow)
- avoid problems realated to division on small numbers

Tested on SPE9, norne and Model 2 with significant improvments.
2016-11-14 13:26:38 +01:00
Andreas Lauser
5278b88e2e Merge remote-tracking branch 'remotes/totto82/frankenstein_mod' into frankenstein_merge_master
* remotes/totto82/frankenstein_mod:
  Fix seg-fault for cases without wells
  Some micro performance improvments and cleaning
  Add THP support in the denseAD well model
  Only solve the linear system when it is not converged.
  Revert changes to NewtonIterationBlackoilInterleaved.cpp
  add and use class wellModelMatrixAdapter
  Remove unused code and remove Eigen vectors
  New updateState
  Some cleaning and small changes
2016-09-14 15:03:17 +02:00
Andreas Lauser
4ecd6ca64a fix some serious screw-ups
almost all of them were caused by recent changes in the master
branch:

- there were methods added which depend on the types `V` and
`DataBlock`. these do not make much sense in the context of the
frankenstein simulator. Also, these types are defined globally for the
whole Opm namespace in `BlackoilModelBase_impl.hpp` (which should be
prosecuted as a fellony IMO)! Besides this, their names are useless;
'V' is the letter which comes after `U` in the alphabet and when it
comes to computers basically everything can be seen as a chunk of data
(i.e., a `DataBlock`).
- it seems like the new and shiny dense-AD based well model was never
compiled with assertations enabled, at least some asserts referenced
non-existing variables.
- the recent output-related API changes were pretty unfortunate
because they had the effect of tying the (sub-optimal, IMO) internal
structure of the model even closer to the output code: as far as I can
see, `rq` does only make sense if the model works *exactly* like
BlackoilModelBase and friends. (for flow_ebos, this could be
replicated, but first it would be another unnecessary conversion step
and second, most of the quantities in `rq` are of type `ADB` and much
of the "frankenstein" excercise is devoted to getting rid of these.) I
thus reverted back to an old version of the output code and created a
`frankenstein` branch in my personal `opm-output` github fork.
2016-09-13 23:58:59 +02:00
Andreas Lauser
62de30d9b2 Merge remote-tracking branch 'origin/master' into frankenstein 2016-09-12 23:18:02 +02:00
Tor Harald Sandve
83ff3271af New updateState
-- a new updateState is implemented based on dune vectors
-- the old is kept for comparision in this PR
-- the updateState is not identical.
Tested on spe1, spe9 and norne and it improves the convergence compares
to the old one.
2016-09-07 10:37:42 +02:00
Atgeirr Flø Rasmussen
b5e986df5f Remove well state argument from computeFluidInPlace(). 2016-08-30 13:34:18 +02:00
Liu Ming
056708574c compute fluid in place by regions. 2016-08-30 10:30:25 +02:00
Liu Ming
28583e4237 Add computeFluidInPlace function. 2016-08-30 10:30:25 +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
Andreas Lauser
bec3ce31fd distinguish between the number of non linear iterations and the number of linearizations
while the printed number of "Non linear iterations" was correct in a
strict sense, it was very confusing if one was working on the
linearization code because the last Newton iteration of each time step
was linearized but not solved for (and the solution was thus not
updated hence it does not count as a "non linear iteration"). This
makes sense for large problems were the total runtime is completely
dominated by the performance of the linear solver, but smaller
problems exhibit the opposite behavior (i.e., for them, runtime is
typically dominated by the linearization proceedure), so one is more
interested in the number of linearizations, not the number of linear
solves.
2016-08-02 12:14:10 +02:00
Atgeirr Flø Rasmussen
a084d36da6 Merge pull request #752 from andlaus/pass_timer_instead_of_dt
pass the simulation timer object instead of the time step size
2016-08-02 11:05:27 +02:00
Liu Ming
3f4aa65180 add wellIterationsLast_. 2016-07-20 10:44:12 +08:00
Liu Ming
52d51e8565 remove wellIterationsLast_. 2016-07-18 09:02:30 +08:00
Liu Ming
b43cbe0531 drop useages of std::numeric_limits for counting well iterations. 2016-07-14 10:25:32 +08:00
Liu Ming
6af9aee20f counting well iterations correctly. 2016-07-13 09:00:15 +08:00
Andreas Lauser
5410d97701 pass the simulation timer object instead of the time step size
models may need a more detailed picture of where they are in the
simulation. Note that since the timer objects are available at every
call site, this is also not a very deep change.
2016-07-12 15:55:12 +02:00
Liu Ming
bb0164f39f fix well iterations counting bugs. 2016-07-11 11:47:29 +08:00
Atgeirr Flø Rasmussen
895a1de3fc Make iteration counts signed integers.
Generated warning when compared to the minimum int in well iteration count.
2016-06-30 15:31:07 +02:00
Liu Ming
5e1e0d3711 initial wellIterations members. 2016-06-21 10:01:13 +08:00
Liu Ming
b14ebe7616 return well iterations. 2016-06-21 08:35:44 +08:00
Liu Ming
969f6f1d1b return well iteration from simulators. 2016-06-21 08:35:33 +08:00
Atgeirr Flø Rasmussen
19f4cef6c1 Add new step() overload taking initial states separately. 2016-06-17 11:14:32 +02:00
Atgeirr Flø Rasmussen
fab64f5afb Add non-const overload of model(). 2016-06-17 11:14:21 +02:00
Kai Bao
8236a32aee sliencing a few shadowing warnings. 2016-05-06 17:59:00 +02:00
Atgeirr Flø Rasmussen
99fd5e977f Remove assert() that is now wrong due to minIter() treatment. 2015-11-25 11:08:10 +01:00
Atgeirr Flø Rasmussen
9275070bad Honor the min_iter parameter.
This also required the minIter() accessor to be made public,
so made all of the remaining accessors public.
2015-11-24 16:09:01 +01:00
Atgeirr Flø Rasmussen
88fbe5e9b6 Ensure non-null model in constructor. 2015-11-13 15:08:00 +01:00
Atgeirr Flø Rasmussen
87330984aa Adapt to renaming of class. 2015-11-12 17:55:13 +01:00
Atgeirr Flø Rasmussen
29a1a891d2 Make nonlinearIteration() the only interface to the model.
This means that details such as calling assemble(), solveJacobianSystem(),
updateState() etc. are now left to the model class. This will make it easier
to create new model classes with different behaviour (such as sequential models).
2015-11-12 17:47:18 +01:00
Atgeirr Flø Rasmussen
7c21a630e5 Rename NewtonSolver -> NonlinearSolver. 2015-11-12 17:42:47 +01:00