Commit Graph

2643 Commits

Author SHA1 Message Date
Liu Ming
170607e60c check if the phase is present. 2016-09-05 16:14:27 +08:00
Liu Ming
1943978dbd update PAV formulation. 2016-09-05 10:38:57 +08:00
Atgeirr Flø Rasmussen
983c7d9957 Merge pull request #787 from totto82/fix_minpv_actnum
BUGFIX. Correctly handle ACTNUM in minPvFillProps_()
2016-09-02 15:17:28 +02:00
Markus Blatt
4a6be3d33b Fix step number used to create global well state in parallel output.
When running in parallel a well state object with the well information
of the whole grid needs to constructed to gather the information from all
processes. Previously, this was done with the report step exported by the
timer. This was wrong for the following reason:
The output occurs after solving the time step and the timer is already
incremented. This means that we constructed the well state for gathering the
data for the next report step, already. Unfortunately, at that step some
wells that we have computed results for might have been shut. In that case
an exception with message "global state does not contain well ..." was thrown.

This problem occured for Model number 2 and might have been due to shut wells
because of banned cross flow.

With this commit we use the last report step if this is not an initial write
and not a substep.
2016-09-02 14:41:47 +02:00
Markus Blatt
5ecead8e6f OutputWriter::writeTimeStep needs the report step and not the sub step.
At least that is what is documented.
2016-09-02 14:41:47 +02:00
Liu Ming
c5a490c75a fix typo. 2016-09-02 16:58:42 +08:00
Liu Ming
490dbbf133 correct the formulation for PAV calculations. 2016-09-02 16:53:39 +08:00
Joakim Hove
10d76d5bb1 shared_ptr<EclipseGrid> -> const EclipseGrid& 2016-08-31 19:39:39 +02:00
Atgeirr Flø Rasmussen
b5e986df5f Remove well state argument from computeFluidInPlace(). 2016-08-30 13:34:18 +02:00
Atgeirr Flø Rasmussen
a2001ca2e1 Avoid variable shadowing. 2016-08-30 13:33:50 +02:00
Atgeirr Flø Rasmussen
69812fddd2 Remove unnecessary override of computeFluidInPlace().
It also called itself, causing infinite recursion.
2016-08-30 13:18:54 +02:00
Atgeirr Flø Rasmussen
61af1fa53d Remove unused nnc arg from BlackoilOutputWriter constructor. 2016-08-30 13:18:06 +02:00
Liu Ming
46b0ef635b fix typo. 2016-08-30 10:30:26 +02:00
Liu Ming
a1bf3769fe format fip output. 2016-08-30 10:30:26 +02:00
Liu Ming
c9c7a5c744 compute hydrocarbon weighted pore voulme pressue and pv for fip regions. 2016-08-30 10:30:26 +02:00
Liu Ming
2ac3306c18 drop the for loop over fip regions. 2016-08-30 10:30:26 +02:00
Liu Ming
a492a60a64 document computeFluidInPlace function. 2016-08-30 10:30:26 +02:00
Liu Ming
b2432c871f fix typo. 2016-08-30 10:30:25 +02:00
Liu Ming
aa96931f69 use a separate function to output fip and compress fipnum from eclipseState. 2016-08-30 10:30:25 +02:00
Liu Ming
59a2668152 compute different fip regions. 2016-08-30 10:30:25 +02:00
Liu Ming
7c3148c1f3 get cell FIPNUM values. 2016-08-30 10:30:25 +02:00
Liu Ming
90086f690e only compute field fluid in place. 2016-08-30 10:30:25 +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
Liu Ming
78a5381f5d output water and gas fluid in place. 2016-08-30 10:29:24 +02:00
Liu Ming
148038939d add computeFIP method. 2016-08-30 10:29:24 +02:00
Liu Ming
60fd4add69 NOSIM is supported, should remove from the list. 2016-08-29 09:34:04 +08:00
Andreas Lauser
1d2a5d7f1b fix the headers
remove the now unnecessary inclusion of
"NewtonIterationBlackoilInterleaved.cpp" (mind the .cpp extension!)
and include "dune/istl/solvers.hh" instead.
2016-08-28 15:48:18 +02:00
Andreas Lauser
75d99fa335 Merge pull request #6 from totto82/reorg_wells
Remove usage of ADB and the residual struct.
2016-08-28 15:47:43 +02:00
Andreas Lauser
49f13e6664 Merge remote-tracking branch 'origin/master' into frankenstein 2016-08-28 15:36:11 +02:00
Robert Kloefkorn
b092b2504c make code compile and run. 2016-08-26 11:54:59 +02:00
Tor Harald Sandve
699a0ede01 Remove remaning usage of ADBs
-- the code is still kept for comparison
2016-08-26 10:55:09 +02:00
Tor Harald Sandve
190076f5da Temperary commit
-- works on SPE1 but not SPE9
-- if number of perforations are increased to 3 in SPE1 the same error
as in SPE9 occur.
2016-08-25 15:25:01 +02:00
Joakim Hove
5602e654c3 Merge pull request #795 from joakim-hove/arg-reorder
Illustrate support of properties like KRW and FLUX in restart file.
2016-08-23 11:30:36 +02:00
Tor Harald Sandve
4bdf74eb11 Reorganize the wellModel
- All well-related stuff is moved to StandardWellsDense.hpp
- Some unused functions are removed from BlackoilModelEbos.hpp
2016-08-23 09:58:21 +02:00
Atgeirr Flø Rasmussen
183d2f4477 Merge pull request #762 from qilicun/messages-for-keywords-options
Handle partially supported options manually.
2016-08-23 08:07:29 +02:00
Liu Ming
95ab7038ea Rename addUnsupported to addSupported. 2016-08-22 16:14:37 +08:00
Joakim Hove
0f7c9f4b97 Added optional simProps argument to restart. 2016-08-20 20:10:50 +02:00
Joakim Hove
56a7775fee Changed order of arguments to match opm-output. 2016-08-20 20:09:56 +02:00
Tor Harald Sandve
b023cb15a5 Reset wellcontrols from well_state 2016-08-19 13:50:27 +02:00
Tor Harald Sandve
cd76816ea5 Stay in sync with changes in restartWriter in the eclipseState 2016-08-19 10:30:49 +02:00
Tor Harald Sandve
0c9c5a031f Add copy constructure and operator to WellStateFullyImplicitBlackoil 2016-08-19 10:28:54 +02:00
Tor Harald Sandve
f60e26faf7 Minor convergence improvments
- set current control when initializing the wellstate
- re calculate wellVariable after well control has changed.
2016-08-18 12:23:46 +02:00
Tor Harald Sandve
49f478480d Remove usage of state in the model
1) The wellsolution is stored in wellVariables as a vector of DenseAD
objects. The wellVariables is computed from the wellstate  in
setWellVariables()
2) BHP and well fluxes are not stored directly but calculated based on
the wellVariables
3) The initial well accumulation term is stored as a vector of doubles.
4) addWellFluxEq() uses DenseAd flux and accumulation terms
5) computePropertiesForWellConnectionPressures() no longer uses state as
input. The wellstate is used to get the bhp pressure.
6) The current wellcontrol is set when updated in updateWellControls()
in order to use well_controls_get_current_type(wc) insted of
well_controls_iget_type(wc, currentIdx)

Tested on SPE1, SPE9 and Norne.
Effects the convergence but the results are identical.
2016-08-18 12:23:46 +02:00
Tor Harald Sandve
dec60a8bd8 The well model no uses the fluidState and fluidsystem from ebos
The well model is modified to use the fluidState and fluidsystem from
ebos. UpdateLegacyState() is no longer needed.
2016-08-18 12:23:46 +02:00
Tor Harald Sandve
1754181761 BUGFIX Make the wellVariables constant
The wellVariables where left out in makeConstantState()
With this fix norne runs
2016-08-18 12:23:45 +02:00
Tor Harald Sandve
5cd7468b51 Implement new well model
Start using the well model desribed in SPE 12259 "Enhancements to the
Strongly Coupled, Fully Implicit Well Model: Wellbore CrossFlow Modeling
and Collective Well Control"

The new well model uses three well primary variables: (the old one had
4)
1) bhp for rate controlled wells or total_rate for bhp controlled wells
2) flowing fraction of water Fw = g_w * Q_w / (g_w * Q_w + q_o * Q_o +
q_g + Q_g)
3) flowing fraction of gas  Fg = g_g * Q_g / (g_w * Q_w + q_o * Q_o +
q_g + Q_g)
where g_g = 0.01 and q_w = q_o = 1;

Note 1:
This is the starting point of implementing a well model using denseAD
The plan is to gradually remove Eigen from the well model and instead
use the fluidState object provided by the Ebos simulator
Note 2:
This is still work in progress and substantial cleaning and testing is
still needed.
Note 3: Runs SPE1, SPE9 and norne until 950 days.
2016-08-18 12:23:45 +02:00
Atgeirr Flø Rasmussen
c14b19c48b Merge pull request #792 from qilicun/fix-polymer-inflow
look for water injector only, if not find, just continue to next step.
2016-08-15 17:35:15 +02:00
Andreas Lauser
3e8792b9cc some output related fixes
there was a screw-up with the output directory (to set it you need to
modify the EclipseState by means of the IOConfig object? WTF?) and it
seems like the FlowMain.hpp was modified since FlowMainEbos.hpp was
added so there was some terminal output missing.
2016-08-14 21:44:47 +02:00
Andreas Lauser
c919b1e6e1 flow_ebos: set the correct pressure value in all cases
for the gas-only case with vaporized oil enabled, the oil pressure was
used, but ebos uses the gas pressure as a primary variable in that
case. (the reason is that it is faster to check if oil appears if the
gas pressure is available in that case.) This patch corrects that and
does no longer use the PrimaryVariables::set$FOO_PV() methods because
these methods are hard to keep in sync with the indices for the
primary-variables-as-a-Dune::FieldVector feature (which is actually
quite important for the linear solver).
2016-08-12 16:52:36 +02:00
Liu Ming
5f059da0a4 look for water injector only, if not find, just continue to next step. 2016-08-12 08:27:07 +08:00
Jørgen Kvalsvik
ab95133d1c Match RestartConfig interface in opm-parser 2016-08-11 09:59:07 +02:00
Andreas Lauser
068ee3bc18 flow_ebos: no need to update the properties object
ebos does this internally. in flow_ebos these objects are only needed
for the well model...
2016-08-09 18:38:23 +02:00
Andreas Lauser
92eefb4718 flow_ebos: make the ebos simulator less verbose 2016-08-09 18:38:23 +02:00
Andreas Lauser
8e81023e1d BlackoilModelEbos: remove redundant constructor parameters 2016-08-09 18:38:23 +02:00
Andreas Lauser
626d3e1da5 flow_ebos: only instantiate a single deck and a single EclipseState 2016-08-09 18:38:23 +02:00
Andreas Lauser
17c1e1083e only instanciate the grid once
i.e., pass through the one which is created by ebos...
2016-08-09 18:38:23 +02:00
Andreas Lauser
adb8a2cf96 fix the end-of-episode detection code 2016-08-09 18:38:23 +02:00
Andreas Lauser
f29bf8f694 flow_ebos: retrieve the simulation grid from the ebos simulator object 2016-08-09 18:38:23 +02:00
Andreas Lauser
77f103fca5 instantiate the ebos Simulator object in SimulatorFullyImplicitBlackoilEbos
this gets rid of some ugly hacks with static variables...
2016-08-09 18:38:23 +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
Andreas Lauser
50ebb66041 make SimulatorFullyImplicitBlackoilEbos independent of SimulatorBase
currently this involves a lot of copy and paste but, it will be boiled
down soon.
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
Tor Harald Sandve
2b09aca23a BUGFIX. Currently handle ACTNUM in minPvFillProps_()
Make sure that inactive cells are not included in the averaging
2016-08-09 15:51:38 +02:00
Andreas Lauser
4d63a4b0ba BlackoilModelParameters: add the file name of the deck
this is needed by the ebos based model.
2016-08-09 12:23:29 +02:00
Andreas Lauser
4a66b4495b flow: move the internal classes to separate files
i.e., the contents of the Opm::details namespace, the IterationReport
and the DefaultBlackoilSolutionState classes. the purpose of this is
to share the code between the existing flow variants and flow_ebos.
2016-08-09 12:23:29 +02:00
Andreas Lauser
415bb25166 allow StandardWells.hpp to be included independently
i.e., without BlackoilModelBase.hpp.
2016-08-09 12:23:29 +02:00
Joakim Hove
0a4dfb6d69 Merge pull request #783 from pgdr/downstream-transmult-and-shared_ptrs
TransMult, Init, and SimConfig are references, applyModifierDeck take…
2016-08-09 09:33:18 +02:00
Atgeirr Flø Rasmussen
d6230f74d5 Merge pull request #784 from totto82/fix_ntg_minpv
BUGFIX. Use the modified NTG values in multiplyHalfIntersections_(..)
2016-08-09 08:29:39 +02:00
Tor Harald Sandve
b468d2baa1 BUGFIX. Use the modified NTG values in multiplyHalfIntersections_(..) 2016-08-08 13:22:02 +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
Atgeirr Flø Rasmussen
ac11db635c Merge pull request #778 from qilicun/polymer-well-iters
well iterations should start from 0.
2016-08-05 09:07:35 +02:00
Liu Ming
635c6b3986 well iterations should start from 0. 2016-08-04 10:54:31 +08:00
Liu Ming
6256199176 log the message to OpmLog. 2016-08-04 10:24:15 +08:00
Liu Ming
ec06eebc06 set polymer rates to the right well. 2016-08-04 10:22:49 +08:00
Atgeirr Flø Rasmussen
5581771917 Merge pull request #776 from qilicun/debug-polymer
fix polymer in flow bug.
2016-08-03 08:52:17 +02:00
Liu Ming
3e2907f4bd fix polymer in flow bug. 2016-08-03 11:10:37 +08: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
4ae5a0a85b change message type from error to warning. 2016-07-27 16:14:22 +08:00
Markus Blatt
b6c06738b5 Do not assume ordering in an unordered_map when gathering data.
The order of an unordered_map is quite unpredictable. (The same
order will only hold with the same hash function, comparison
operator, and insertion order). Therefore we cannot assume that
the global SimulationDataContainer uses the same order for the
cell data as the local one (This was done before this commit).
But we can assume that the local one uses the same order on every
process.

Before this commit data got mixed up (e.g. gasoilratio with surfacevol)
when gathering local data for writing eclipse files on the master
process. This commit fixes this.

Instead of iterating over the cell data of the global state when
writing the data received, we again iterate over the cell data of
the local state and simply use the key to request the correct data
for writing from the global state.
2016-07-25 17:17:06 +02:00
Markus Blatt
d6aea1663d Call writeInit with global grid and properties.
Previously, the call was made after the grid was distributed.
This means that each process wrote it, but only with his cells
active which was just a part of the whole domain.

With this commit we make the writeInit call before distributing the
grid and make sure that only one process calls it.
2016-07-22 17:37:14 +02:00
Bård Skaflestad
01ec7befb4 Merge pull request #758 from qilicun/fix-wellIterations-bugs
fix well iterations counting bugs.
2016-07-20 11:20:28 +02:00
Liu Ming
3f4aa65180 add wellIterationsLast_. 2016-07-20 10:44:12 +08:00
Liu Ming
b62834f81c Treat unsupported options in a more general way. 2016-07-20 10:27:30 +08:00
Liu Ming
a9e51eeb42 treat partially supported options by different multimap. 2016-07-18 12:32:28 +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
776ab451de handle partially supported options manually. 2016-07-14 09:31:24 +08:00
Kai Bao
2f5045bb85 removing some white spaces in MissingFeatures 2016-07-13 09:16:18 +02:00
Liu Ming
6af9aee20f counting well iterations correctly. 2016-07-13 09:00:15 +08:00
Kai Bao
ab31ab470b removing two supported keywords from MissingFeatures. 2016-07-12 16:59:45 +02: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
Liu Ming
daf1eb9e74 use const reference instead of shared_prt. 2016-07-08 14:52:37 +08:00
Liu Ming
3f819e908d Merge remote-tracking branch 'opm/master' into missing-features-handle 2016-07-08 14:49:38 +08:00
Liu Ming
77fedce11e remove unused argument. 2016-07-08 08:19:03 +08:00
Liu Ming
c5fd3b2161 remove some keywords only related to parser. 2016-07-07 15:52:28 +08:00
Liu Ming
1b5b112031 call checkDeck() in FlowMain instead of checkKeywords(). 2016-07-07 15:38:03 +08:00
Liu Ming
3e01b42d55 use std::unordered_set. 2016-07-07 13:50:32 +08:00
Liu Ming
064f512893 Diagnostics keywords that not supported by flow. 2016-07-07 10:38:29 +08:00
Andreas Lauser
88519d70c4 adapt to the EclMaterialLawManager's rename of the *Pointer methods 2016-07-06 13:00:35 +02:00
Kai Bao
399298be21 using mapentry_t instead of iterator. 2016-07-05 15:28:02 +02:00
Kai Bao
a8c2626e5a fixing comments.
no functional change.
2016-07-05 13:02:28 +02:00
Kai Bao
4dad47f90d adding warning tags to all the WECON related warnings. 2016-07-05 13:02:28 +02:00
Kai Bao
ddec62288a fixing the warning messages. 2016-07-05 13:02:28 +02:00
Kai Bao
6a70450422 wrtiting state to report at the end of each time step
insead of writing in the begining of each time step.
2016-07-05 13:02:28 +02:00
Kai Bao
8e52e71993 changing shutted to shut. 2016-07-05 13:02:28 +02:00
Kai Bao
b2524a7dc3 making a forwarded updateListEconLimited in SimulatorBase.
and some changes to make the code compile for all the simulators.
2016-07-05 13:02:28 +02:00
Kai Bao
98a6495abc makeing wellModel public for flow_polymer and flow_solvent. 2016-07-05 13:02:27 +02:00
Kai Bao
cc957a77fe some well will go to stopped list and infomation output. 2016-07-05 13:02:27 +02:00
Kai Bao
e817719d48 When last connection is closed, the well is shut done. 2016-07-05 13:02:27 +02:00
Kai Bao
109b55f61c using OpmLog to give warning. 2016-07-05 13:02:27 +02:00
Kai Bao
41b9fca434 implementing checkRatioEconLimits 2016-07-05 13:02:27 +02:00
Kai Bao
9220a2bbaf refactoring updateListEconLimited based on new functions. 2016-07-05 13:02:27 +02:00
Kai Bao
dd59762c0b adding checkMaxWaterCutLimit to StandardWells. 2016-07-05 13:02:27 +02:00
Kai Bao
c77aa5af09 adding checkRateEconLimited to StandardWells
to check rate related to economic limits.
2016-07-05 13:02:27 +02:00
Kai Bao
d48399ac3a WIP for handling the water cut ecnomic limit 2016-07-05 13:02:27 +02:00
Kai Bao
a019460268 warning if requesting opening a new well after closing a well
it is not supported yet.
2016-07-05 13:02:27 +02:00
Kai Bao
e903690107 giving a warning if the WECON request ending running
It is not supported yet to stop the whole program after a well is closed
due to economic limits.
2016-07-05 13:02:27 +02:00
Kai Bao
53490270e1 adding updateListEconLimited to StandardWells 2016-07-05 13:02:27 +02:00
Kai Bao
18fa442721 adapted to the interface change of WellsManager
At the moment, for the ParallelDebugOutput, we put a dummy
dyanmic_list_econ_limited, not sure how it will the parallel running.

The basic problem is that when initialzing the globalWellState_, what
will happen if they can not find state information for a well in the Wells*.

If some defaulted values are used, then no big problem here.
2016-07-05 13:02:27 +02:00
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
Joakim Hove
be71a2f8b2 Removed NNC argument from EclipseWriter ctor. 2016-07-01 12:26:25 +02:00
Joakim Hove
e262d0da68 Renamed writeInit -> writeInitAndEgrid( ) 2016-07-01 12:26:25 +02:00
Joakim Hove
5a89598788 Write TRAN? to the INIT file. 2016-07-01 12:26:25 +02: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
Atgeirr Flø Rasmussen
c7e6070d31 Correctly override NOSIM. 2016-06-30 15:30:49 +02:00
Atgeirr Flø Rasmussen
86b66863b4 Merge pull request #734 from qilicun/format-step-output
Format step output
2016-06-30 09:19:54 +02:00
Liu Ming
d3e6a657cd Initial well iterations as a special number, output it if it is valid. 2016-06-30 09:04:44 +08:00
Liu Ming
136839bd20 fix warnings. 2016-06-29 16:42:43 +08:00
Joakim Hove
09f22f370a Will look for param: 'nosim' and override deck. 2016-06-29 08:03:38 +02:00
Liu Ming
e6930df28c make assemble method return IterationReport. 2016-06-28 16:20:33 +08:00
Atgeirr Flø Rasmussen
baeab02bd6 Adapt to changed updateWellControls() signature. 2016-06-28 15:50:50 +08: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
Atgeirr Flø Rasmussen
6572aeed5e 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-28 15:50:50 +08:00
Kai Bao
a1cc880ad7 only calculating repesentative radius when having PLYSHLOG. 2016-06-28 15:50:50 +08:00
Atgeirr Flø Rasmussen
2c50e208dd Clone the Wells pointer for output use later. 2016-06-28 15:50:50 +08:00
Tor Harald Sandve
9bfb3f909e Allow for 2 phase initialization using EQUIL 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
Liu Ming
ad01934670 initial IterationReport. 2016-06-28 15:48:20 +08:00
Liu Ming
4000582952 use only one ostringstream. 2016-06-28 15:00:58 +08:00
Liu Ming
ed09cfa7e4 fix indentation. 2016-06-28 14:38:20 +08:00
Liu Ming
c6586d36c8 return IterationReport for assemble and solver well eq methods. 2016-06-28 14:37:48 +08:00
Liu Ming
9bf934363c output iterations depends on conditions. 2016-06-28 13:45:20 +08:00
Atgeirr Flø Rasmussen
d2300e79e4 Merge pull request #714 from blattms/fix-euclidian-norm
Fixes the parallel Euclidian product for multiple phases.
2016-06-28 00:25:46 +02:00
Atgeirr Flø Rasmussen
85fdb20c4e Adapt to changed updateWellControls() signature. 2016-06-27 16:52:45 +02:00
Atgeirr Flø Rasmussen
5e18aab106 Merge pull request #744 from blattms/fix-wells-for-null-pointers
Fix wells for null pointers
2016-06-27 16:24:01 +02:00
Atgeirr Flø Rasmussen
bcf210c03e Merge pull request #711 from blattms/print-all-well-switching-in-parallel
Print all well switching in parallel.
2016-06-27 16:22:02 +02: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
Atgeirr Flø Rasmussen
4d834ee371 Merge pull request #742 from blattms/fix-wellstate-for-no-wells
Fix handling of no wells in WellStateFullyImplicitBlackoil.hpp
2016-06-27 14:54:48 +02:00
Markus Blatt
90132a3bc5 Removed trailing underscore for local variable. 2016-06-27 14:40:14 +02:00
Atgeirr Flø Rasmussen
ce9ddedc76 Merge pull request #739 from GitPaean/fixing_bugs_without_plyshlog
only calculating representative radius when having PLYSHLOG.
2016-06-27 13:52: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
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
Kai Bao
d2c822e37a only calculating repesentative radius when having PLYSHLOG. 2016-06-24 10:00:06 +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
d13d21231d keep the unity of the API. 2016-06-21 08:36:15 +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
fbe7143f54 using WellModel functions in BlackoilPolymerModel.
reducing some repeated code.
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