Commit Graph

1750 Commits

Author SHA1 Message Date
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
Atgeirr Flø Rasmussen
80b8b5f12f Merge pull request #737 from atgeirr/sequential
Experimental sequential solvers
2016-06-27 11:38:13 +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
Atgeirr Flø Rasmussen
c1e5a64329 Merge pull request #712 from totto82/fix_2p_equil_init
Allow for 2 phase initialization using EQUIL
2016-06-24 14:42:54 +02:00
Atgeirr Flø Rasmussen
e7c70ddb71 Clone the Wells pointer for output use later. 2016-06-21 12:00:10 +02:00
Liu Ming
c2285c720d output date in step output. 2016-06-21 11:30:01 +08:00
Liu Ming
5e1e0d3711 initial wellIterations members. 2016-06-21 10:01:13 +08:00
Liu Ming
922490a9d8 Merge remote-tracking branch 'remotes/opm/master' into format-step-output 2016-06-21 09:28:30 +08:00
Liu Ming
0dfe945f25 output new step messages. 2016-06-21 09:28:08 +08:00
Liu Ming
66b8a2379b write residuals to PRT file. 2016-06-21 09:27:19 +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
82d0c81c13 Merge pull request #730 from atgeirr/add-store-fluxes
Changes to well model for supporting sequential approach.
2016-06-20 22:46:35 +02:00
Joakim Hove
efa9a604a8 Merge pull request #723 from jokva/deprecate-wellptr
Well shared_ptr alias deprecated
2016-06-20 14:57:02 +02:00
Atgeirr Flø Rasmussen
ba9e599ec7 Use 'Vector' in place of 'V'. 2016-06-20 14:08:00 +02:00
Atgeirr Flø Rasmussen
9c0ffee8e9 Changes to well model for supporting sequential approach.
The changes are:
 - Make the WellOps struct public (needed by transport solver).
 - Make it possible to store and retrieve total reservoir volume
   perforation fluxes with getStoredWellPerforationFluxes(), controlled
   by a flag set by setStoreWellPerforationFluxesFlag(), defaulting to
   false (needed by pressure solver).
2016-06-20 11:02:49 +02:00
Atgeirr Flø Rasmussen
6dfd5ec63d Merge pull request #729 from atgeirr/refine-nonlinear-solver-interface
Refine nonlinear solver interface
2016-06-17 12:37:15 +02:00
Atgeirr Flø Rasmussen
b811ec7715 Merge pull request #728 from atgeirr/improve-solverselection
Refine setting of (linear) solver_approach.
2016-06-17 12:23:19 +02:00
Atgeirr Flø Rasmussen
f1af4f945c Make variable const. 2016-06-17 11:48:04 +02:00
Atgeirr Flø Rasmussen
d29355d17d Remove unneeded (implicit) template argument. 2016-06-17 11:39:00 +02: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
Atgeirr Flø Rasmussen
d8390590f8 Refine setting of (linear) solver_approach.
Ensure that the parameter is printed also if defaulted.
2016-06-17 11:00:56 +02:00
Atgeirr Flø Rasmussen
3776ccab9e Add use_update_stabilization parameter.
This makes it easier to run without, for example for debugging.
The default is 'true', preserving existing behaviour.
2016-06-17 10:44:53 +02:00
Atgeirr Flø Rasmussen
6fed5a50c3 Merge pull request #726 from atgeirr/const-preparestep
Use const reference parameters for prepareStep()
2016-06-17 09:21:27 +02:00
Atgeirr Flø Rasmussen
b21f4e16da Merge pull request #725 from atgeirr/add-to-helperops
Add connection_cells member of HelperOps.
2016-06-17 09:03:26 +02:00
Atgeirr Flø Rasmussen
194288865b Fix forgotten prepareStep() signatures. 2016-06-17 08:41:12 +02:00
Atgeirr Flø Rasmussen
bf5fecfe9a Make prepareStep() parameters const. 2016-06-17 08:41:02 +02:00
Atgeirr Flø Rasmussen
5f51fea874 Add connection_cells member of HelperOps. 2016-06-16 16:21:37 +02:00
Jørgen Kvalsvik
dfac3adaea Pass NNC to OutputWriter constructor
Keep up with an interface change in opm-output.
2016-06-16 13:34:29 +02:00
Jørgen Kvalsvik
ef51e9a2eb Well shared_ptr alias deprecated
The shared_ptr aliasing is deprecated, and in the Well case this has
been removed upstream.
2016-06-16 10:01:04 +02:00
Liu Ming
49fbf5e493 document function and switch implementation. 2016-06-16 14:02:34 +08:00
Liu Ming
8224e7cef9 switch function calling order. 2016-06-16 09:48:39 +08:00
Liu Ming
936cd8dc33 Add separate function for setup logging. 2016-06-15 15:24:05 +08:00
Liu Ming
969ce5ca53 add blank line before and after "Reading Parameters" 2016-06-13 13:43:50 +08:00
Joakim Hove
dd5d9b34a2 Merge pull request #688 from jokva/refactor-output-restart
Breaking opm-core dependency in opm-output; new summary implementation
2016-06-10 13:15:46 +02:00
Liu Ming
8f04300ce3 use default prefix. 2016-06-10 09:27:49 +02:00
Atgeirr Flø Rasmussen
ccde26143c Merge pull request #709 from qilicun/add-new-type
Support new message type: Prtinfo
2016-06-08 11:35:31 +02:00
Tor Harald Sandve
d1d3b86299 Allow for 2 phase initialization using EQUIL 2016-06-08 09:22:52 +02:00
Liu Ming
7ca182f962 change Prtinfo to Note. 2016-06-08 09:18:10 +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
Atgeirr Flø Rasmussen
5d38c77881 Merge pull request #707 from blattms/support-ignoreconvergencefailure-for-cpr
Make CPR preconditioner honor linear_solver_ignoreconvergencefailure
2016-06-07 14:13:52 +02:00
Liu Ming
b2c126f7c2 Support new message type: Prtinfo 2016-06-07 14:11:24 +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
Atgeirr Flø Rasmussen
f9ecbaeefe Merge pull request #706 from andlaus/lad_to_dad
rename some variables from "Lad" to "Eval" (was: to "Dad")
2016-06-07 11:46:44 +02:00
Atgeirr Flø Rasmussen
bceaf56c7e Merge pull request #703 from atgeirr/log-output
Log well control switching message.
2016-06-07 11:39:01 +02:00
Atgeirr Flø Rasmussen
50e8c5dbd8 Merge pull request #708 from totto82/fix_hydrocarbonstate
Adds has_disgas and has_vapoil flags to hydrocarbonstate initialization
2016-06-07 11:38:27 +02:00
Andreas Lauser
a8df55e02f rename some variables from "*Lad" to "*Eval"
this was an involuntary omission in the "local AD" to "dense AD"
rename...
2016-06-07 11:12:33 +02:00
Jørgen Kvalsvik
71560b5fb2 BlackoilOutputWriter rewritten to use opm-output
Changes to BlackoilOutputWriter as mandated by the split and rewrite of
opm-output. Notable changes:

* BlackoilOutputWriter is no longer a child class of OutputWriter.
* Minor interface changes; writeTimeStep requires a Wells pointer
* restore requires a Wells* pointer
* VTK/Matlab support rewrites; no longer inherits OutputWriter
* WellStateFullyImplicitBlackoil::report added, to write its data to a
  opm-output understood format

Relies on utility/Compat.hpp for quick conversion to the opm-output
defined formats.
2016-06-07 10:15:07 +02:00
Tor Harald Sandve
d035881a0a Adds has_disgas and has_vapoil flags to hydrocarbonstate initialization
Gas saturation must be used as primalvariable if DISGAS and VAPOIL is
not used.
2016-06-07 08:23:47 +02:00
Atgeirr Flø Rasmussen
edae7da526 Merge pull request #705 from qilicun/use-debug-backend
Write debug information into a separate file.
2016-06-06 16:11:48 +02:00
Liu Ming
db1e0fa397 write all the messages into debug file. 2016-06-06 15:39:10 +02:00
Liu Ming
865577742f write debug information into a separate file. 2016-06-06 12:20:41 +02:00
Markus Blatt
a1096f222c Make CPR preconditioner honor linear_solver_ignoreconvergencefailure 2016-06-06 08:43:56 +00:00
Andreas Lauser
d45ba7732e rename "local AD" to "dense AD" 2016-06-02 20:20:04 +02:00
Atgeirr Flø Rasmussen
cf5dbf292a Log well control switching message.
Instead of writing to std::cout.
2016-05-30 10:26:20 +02:00
Robert Kloefkorn
7dd76cc967 NewtonIterationBlackoilInterleaved: added flag to allow to ignore solver convergence
failure.
2016-05-27 12:55:46 +02:00
Atgeirr Flø Rasmussen
decdd3185f Merge pull request #698 from blattms/prevent-dereferencing-null-point-during-paralle-IO
Prevent dereferencing a null pointer during parallel output.
2016-05-26 07:53:28 +02:00
Atgeirr Flø Rasmussen
ab0df10354 Merge pull request #696 from blattms/distribute-hydrocarbonstate
Correctly distribute the hydro carbon state for parallel runs.
2016-05-26 07:49:10 +02: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
Atgeirr Flø Rasmussen
0f290e3f6e Separate non-neighbour and non-cartesian connections.
The non-cartesian connections are required by the output facilities,
while the truly non-neighbour connections (meaning those not in the grid)
should be used by all other code.
2016-05-24 11:54:17 +02:00
Kai Bao
0ebd25f66a fixing the compilation error due to rebasing. 2016-05-23 15:42:05 +02:00
Kai Bao
d2d9bd8a80 moving depth difference calcualtion to init() for MultisegmentWells
instead of recalculating them for each iterations.
2016-05-23 15:11:52 +02:00
Kai Bao
c2bdaa1b92 fixing the calculation of volumeRatio.
due to the wrong use of parenthesis.
2016-05-23 15:11:52 +02:00
Kai Bao
879f127ae8 moving variableStateExtractWellsVars() from models to Well Models. 2016-05-23 15:11:52 +02:00
Kai Bao
846ff890de refactoring the interface of computeWellPotentials()
to reduce the cost of makeConstantState when not calculating the
potentials.
2016-05-23 15:11:52 +02:00
Kai Bao
19a256dce0 some pure cleaning up. 2016-05-23 15:11:52 +02:00
Kai Bao
f2b7f2a56c moving numWellVars from models to Wells. 2016-05-23 15:11:52 +02:00
Kai Bao
b3d1c0eabc initializing the pointers to be nullptr in the Wells classes 2016-05-23 15:11:52 +02:00
Kai Bao
4527034f29 removing variableStateInitials() from BlackoilMultiSegmentModel
which is not helpful anymore.
2016-05-23 15:11:52 +02:00
Kai Bao
a102e934ac removing baseSolveWellEq from BlackoilMultiSegmentModel
to solve the different interfaces of computeWellConnectionPressures for
StandardWells and MultisegmentWells, a function
computeWellConnectionPressures was introduced for the models.
2016-05-23 15:11:52 +02:00
Kai Bao
01328559e2 removing the updateWellState from the models. 2016-05-23 15:11:52 +02:00
Kai Bao
4e8099057e small cleaning up for BlackoilMultiSegmentModel_impl 2016-05-23 15:11:51 +02:00
Kai Bao
fcd541a1c1 removing the rebundant ms_wells_ in BlackoilMultiSegmentModel 2016-05-23 15:11:51 +02:00
Kai Bao
184bff95ba using well_model_ to represent the WellModel member 2016-05-23 15:11:51 +02:00
Kai Bao
06775ee02c Make BlackoilMultisegmentModel constructured from MultisegmentWells
Instead of being coustructed based StandardWells and having a
MultisegmentWells member.
2016-05-23 15:11:51 +02:00
Kai Bao
4254b48b57 unifying interface of a few functions of Wells classes
updateWellControls()
updateWellState()
addWellControlEq()

The change of function computeWellConnectionPressures() is not done
completely. Should find a solution later.
2016-05-23 15:11:51 +02:00
Kai Bao
be165a26e0 adding a few more members to the Wells classes.
gravity, vfp_properties_ and depth_.

to further simplify the interfaces.
2016-05-23 15:11:51 +02:00
Kai Bao
50385013fe adding variableWellStateInitials to MultisegmentWells 2016-05-23 15:11:51 +02:00
Kai Bao
7886e4b9d2 adding computeWellConnectionPressures to MultisegmentWells 2016-05-23 15:11:51 +02:00
Kai Bao
b4f4878901 fixing the errors from rebasing. 2016-05-23 15:11:51 +02:00
Kai Bao
60fb868727 adding updatePerfPhaseRatesAndPressures to MultisegmentWells 2016-05-23 15:11:51 +02:00
Kai Bao
508de4dc37 adding extractWellPerfProperties to MultisegmentWells
removing extractWellPerfProperties in all the model classes.
2016-05-23 15:11:51 +02:00
Kai Bao
718ba5470b adding const Wells* wells_ for MultisegmentWells
for interface refactoring.
At the moment, both wells_ and wells_multisegment_ contain all the
wells.
2016-05-23 15:11:51 +02:00
Kai Bao
4180fea951 refactoring the construcor of MultisegmentWells
MultisegmentWells is initialized with Wells structure.
2016-05-23 15:11:51 +02:00
Kai Bao
7d0d50eb53 changing reservoir related members to pointers for MultisegmentWells 2016-05-23 15:11:51 +02:00
Kai Bao
66cd66e61b change reservoir related members to be pointers in StandardWells
to fullfil the requirement of interface design.
2016-05-23 15:11:51 +02:00
Kai Bao
89a8f133fd adding variableWellStateIndices to MultisegmentWells
to remove the using of stdWells() in BlackoilMultiSegmentModel
The code is copied from StandardWells, better solution need to be
exploited.
2016-05-23 15:11:50 +02:00