Commit Graph

128 Commits

Author SHA1 Message Date
Tor Harald Sandve
5686d90c61
Merge pull request #3350 from totto82/maxNiWi
Change the inner iterations logic
2021-06-10 19:49:23 +02:00
Arne Morten Kvarving
eb06c4bd70 add StandardWellEval 2021-06-09 08:32:30 +02:00
Joakim Hove
023edc67e5 Remove first perf member from Well classes 2021-06-08 14:24:26 +02:00
Arne Morten Kvarving
10ff86af52 add StandardWellGeneric
avoid rebuilding this for all simulators when code
is only dependent on Scalar. specialized for double
2021-06-08 08:08:50 +02:00
Arne Morten Kvarving
4c09b5dde3 add WellInterfaceEval 2021-06-07 08:26:43 +02:00
Tor Harald Sandve
3ca6e215dc Change the inner iterations logic
This replace the Boolean switch to enable inner iterations with a
int that controls for which maximum number of newton iterations
inner iterations applies.

Default is set to 3
2021-06-04 10:51:15 +02:00
Arne Morten Kvarving
29137eae7c remove unused prototype 2021-06-02 15:27:03 +02:00
Arne Morten Kvarving
d55df4330e fixed: do not use Opm:: prefix when inside namespace Opm 2021-05-25 12:06:06 +02:00
Joakim Hove
23180e06d2 Rename WellStateFullyImplicitBlackoil -> WellState 2021-05-21 15:07:21 +02:00
Arne Morten Kvarving
539c83687c changed: (re)move unnecessary includes 2021-05-12 08:47:22 +02:00
Tor Harald Sandve
80413e0794 add useInnerIteration method and move assembleWellEq to the well interface to avoid code duplication 2021-05-10 09:41:18 +02:00
Tor Harald Sandve
eeb1b7e36c Initialize empty producers using the mobility ratio and the transmissbility ratio 2021-05-05 08:31:36 +02:00
Tor Harald Sandve
70150ab212 Remove code duplication between STW and MSW 2021-04-30 09:27:35 +02:00
Joakim Hove
e1d117c59f Extract group state and create WGState to manage well & group state 2021-04-27 10:55:38 +02:00
Håkon Hægland
434640fdf5 Implements gas lift optimization for groups.
Extends PR #2824 to include support for GLIFTOPT (item 2, maximum lift
gas supply for a group) and group production constraints.

The optimization is split into two phases. First the wells are optimized
separately (as in PR #2824). In this phase LIFTOPT and WLIFTOPT constraints
(e.g. maxmimum lift gas injection for a well, minimum economic gradient) are
considered together with well production constraints.

Then, in the next phase the wells are optimized in groups. Here, the ALQ
distribution from the first phase is used as a starting point. If a group
has any production rate constraints, and/or a limit on its total rate of
lift gas supply, lift gas is redistributed to the wells that gain the most
benefit from it by considering which wells that currently has the largest
weighted incremental gradient (i.e. increase in oil rate compared to
increase in ALQ).
2021-03-30 15:41:46 +02:00
Tor Harald Sandve
8283b53f3b only compute Bavg once pr timestep and use the stored variable instead of passing it around 2021-03-23 15:30:36 +01:00
Joakim Hove
9662d4019e Use enum Well::Status to indicate well status instead of bool 2021-03-20 20:33:28 +01:00
Tor Harald Sandve
036a021c63 fix well model for gasoil thermal 2021-01-21 11:37:25 +01:00
Tor Harald Sandve
a7664f9ea6 Add check for operability of MSW 2020-12-08 12:38:25 +01:00
Markus Blatt
8ee58096ba Make the parallel reduction when applying the Wells.
The B matrix is basically a component-wise multiplication
with a vector followed by a parallel reduction. We do that
reduction to all ranks computing for the well to save the
broadcast when applying C^T.
2020-12-03 11:10:36 +01:00
Bård Skaflestad
bd79d4b9d5 PI/II: Switch to Using Values Only
We don't need to do the calculations in terms of EvalWell when we're
going to reduce this to the .value() before calling the PI/II
calculation routine.  We can also get by with a simpler approach to
computing the II by assuming we always inject pure phases and no
cross flow in injectors.

Suggested by: [at]atgeirr
2020-11-24 21:53:58 +01:00
Bård Skaflestad
a46a732f9e PI: Treat Production Differently From Injection
This commit makes the PI/II calculation more closely mirror the
approach taken when computing connection flow rates.  In particular,
we switch to using total mobility, mixing and volume ratios for
injecting connections while producing connections continue to use
the phase mobilities and formation volume factors derived from
conditions in the connecting cells.  We also include dissolved
gas/oil ratios and vaporised oil/gas ratios in order to fully
capture the surface flow conditions.

We split the handling of producing/injecting connections out to
separate helper functions in order to make the overall logic in
updateProductivityIndex() more manageable.ex() more manageable.
2020-11-24 21:53:58 +01:00
Bård Skaflestad
75156cd872 Unconditionally Calculate PI at End of Timestep
This commit ensures that we calculate the well and connection level
per-phase steady-state productivity index (PI) at the end of a
completed time step (triggered from endTimeStep()).

We add a new data member,

    BlackoilWellModel<>::prod_index_calc_

which holds one WellProdIndexCalculator for each of the process'
local wells and a new interface member function

    WellInterface::updateProductivityIndex

which uses a per-well PI calculator to actually compute the PI
values and store those in the WellState.  Implement this member
function for both StandardWell and MultisegmentWell.  Were it not
for 'getMobility' existing only in the derived classes, the two
equal implementations could be merged and moved to the interface.

We also add a new data member to the WellStateFullyImplicitBlackoil
to hold the connection-level PI values.  Finally, remove the
conditional PI calculation from StandardWell's well equation
assembly routine.
2020-11-24 21:53:58 +01:00
Atgeirr Flø Rasmussen
8a5203814b Make consistent use of const for alq-related state.
A const well state was passed to functions that were modifying it by
calling setALQ(). Now the setALQ() method is made non-const, mutable
references to the well state are passed where sensible. The getALQ()
method uses map::at() instead of map::operator[] and no longer modifies
current_alq_. With this, it is now easy to see which methods modify the
well state and which don't. The alq-related members in the
WellStateFullyImplicitBlackoil class are no longer 'mutable'-qualified.
2020-11-19 10:09:52 +01:00
Ove Sævareid
63c97d54d0 Rebase issue. 2020-11-17 14:50:57 +01:00
Ove Sævareid
0f7e66e151 Alternative solvent extension for the black oil model. 2020-11-17 12:33:19 +01:00
Atgeirr Flø Rasmussen
cb928f90f0 Refactor per-perforation code into separate function.
Also make some methods const.
2020-11-16 11:19:03 +01:00
Atgeirr Flø Rasmussen
7e87ea3200 Refactor to put updateWellStateRates() in base class. 2020-10-15 14:15:05 +02:00
Atgeirr Flø Rasmussen
52c695937b Implement extended network model. 2020-10-15 10:54:03 +02:00
Håkon Hægland
c0b493c4ce Fix inconsistent-missing-override warnings 2020-10-03 10:43:09 +02:00
Håkon Hægland
52f6f819ee Simplified using fmt::format()
Simplified debug output formatting by using fmt::format(). Also switched
off glift debug output by default.
2020-10-01 18:40:05 +02:00
Håkon Hægland
d707967f58 Implements support for gas lift optimization.
Implements gas lift optimization for a single StandardWell. Support for
gas lift optimization for multi-segment wells, groups of wells and
networks is not implemented yet.

The keywords LIFTOPT, WLIFTOPT, and VFPPROD are used to supply parameters for
the optimization. Also adds support for summary output of liftgas
injection rate via keyword WGLIR.
2020-09-30 10:04:39 +02:00
Kai Bao
a38dc27bcb refactoring for iterateWellEquations 2020-08-11 09:10:19 +02:00
Kai Bao
11807747cb renaming solveWellEqUntilConverged to be iterateWellEquations 2020-08-11 09:10:19 +02:00
Tor Harald Sandve
fefa5c22ce make assembleWellEqIteration private 2020-08-11 09:10:19 +02:00
Tor Harald Sandve
fc45b1bd47 Add inner iterations for standard wells also 2020-08-11 09:10:19 +02:00
Markus Blatt
faaee51d09
Merge pull request #2682 from Tongdongq/openclSolver
Added openclSolver
2020-07-10 13:38:32 +02:00
Markus Blatt
7a571c98db include missing header for OpenCLSolver with g++-8.3
Without I got compilation errors.
2020-07-07 11:10:19 +02:00
T.D. (Tongdong) Qiu
8913e1d057 Make sure OpenCL can be used without CUDA 2020-06-25 18:44:49 +02:00
Atgeirr Flø Rasmussen
c59f4f7118 Make ghost-last feature available in PreconditionerFactory. 2020-06-25 10:56:11 +02:00
Tor Harald Sandve
cf702a5384 use relaxed tolerance for MSW when solution stagnates 2020-05-22 20:52:14 +02:00
Atgeirr Flø Rasmussen
3a5a8c23df Use generic control equation implementation. 2020-04-02 13:54:58 +02:00
Atgeirr Flø Rasmussen
766d02cacc Unify group control equation codes. 2020-04-02 13:54:58 +02:00
T.D. (Tongdong) Qiu
8223cd1db8 Simplified filling of WellContributions object. Added comments 2020-03-19 11:15:49 +01:00
T.D. (Tongdong) Qiu
fdcf46792a BdaBridge and WellContributions are only included and compiled when CUDA is found 2020-03-18 19:03:14 +01:00
T.D. (Tongdong) Qiu
581cbc6a3e cusparseSolver can now apply wellcontributions separately, so --matrix-add-wellcontributions=true is not required anymore 2020-03-13 14:21:59 +01:00
Joakim Hove
9268bcb2ac InjectorType enum is moved out from Well class 2020-03-03 09:08:02 +01:00
Arne Morten Kvarving
bea2459c65 replace boost::optional with std::optional 2020-02-19 11:20:16 +01:00
Trine S. Mykkeltvedt
99e7785fb5 renamed saltwater-->brine and removed keywords from missingFeatures 2020-01-09 14:14:38 +01:00
Trine S. Mykkeltvedt
5749615bd8 addd simple salt/brine implementation 2020-01-09 14:14:38 +01:00
Atgeirr Flø Rasmussen
87188f5862 Avoid using the Wells struct. 2019-11-25 08:36:18 +01:00
Joakim Hove
fce5d2f369 Rename Well2 -> Well and Group2 -> Group 2019-11-13 23:18:01 +01:00
Tor Harald Sandve
9dc536bc82 add computeBhpAtThpLimitInj 2019-11-05 14:18:30 +01:00
Atgeirr Flø Rasmussen
32b31a2606 Address review comments. 2019-10-18 16:08:07 +02:00
Atgeirr Flø Rasmussen
6b011c1bfb Use new method to determine operability under THP control. 2019-10-18 16:08:07 +02:00
Atgeirr Flø Rasmussen
a536b90891 Improve stopped wells logic and log messages. 2019-10-18 16:08:07 +02:00
Atgeirr Flø Rasmussen
2b9f5fb4fb Use robustSolveBhpAtThpLimitProd() for potentials and initialization. 2019-10-18 16:08:07 +02:00
Atgeirr Flø Rasmussen
7581275b03 Add robustSolveBhpAtThpLimitProd() method. 2019-10-18 16:08:07 +02:00
Tor Harald Sandve
53896ffca8 Use well and group controls from opm-common.
This PR remove the usage of well_control_ from opm-core
and instead uses the control classes for wells and groups
from opm-common.
This PR also removes the usage of the group classes from
opm-core.
2019-10-18 16:08:07 +02:00
Atgeirr Flø Rasmussen
2d9f41b1aa Rename getPerfPressure() -> getPerfCellPressure(). 2019-10-11 08:19:18 +02:00
Halvor M. Nilsen
d873ae165d Enable single-phase runs. 2019-10-11 08:19:18 +02:00
Robert Kloefkorn
f708286111 [cleanup][Wells] Consequently use SparseMatrixAdapter in addWellContributions. 2019-10-09 10:27:38 +02:00
Arne Morten Kvarving
7048589ec1 changed: ewoms/models/blackoil -> opm/models/blackoil 2019-09-19 11:12:45 +02:00
Arne Morten Kvarving
5599bb6d8c changed: namespace Ewoms -> namespace Opm 2019-09-05 17:14:38 +02:00
Atgeirr Flø Rasmussen
b9e7881878 Finalize integration of foam module. 2019-08-07 10:39:16 +02:00
Franz G. Fuchs
7fb90bff47 Use foam module. 2019-08-07 10:39:16 +02:00
Kai Bao
53b15527c2 fixing warnings under simulator/wells 2019-06-26 09:52:38 +02:00
Atgeirr Flø Rasmussen
a33cfbf0bc Moved Flow-related classes and files to opm/simulators/flow. 2019-06-20 11:00:51 +02:00
Kai Bao
4449f0c172 adding updateConnectionRatePolyMW to StandardWell 2019-06-13 14:49:04 +02:00
Kai Bao
2256395957 adding updateExtraPrimaryVariables to StandardWell 2019-06-13 14:49:04 +02:00
Kai Bao
94057a53f9 adding checkConvergenceExtraEqs to StandardWell 2019-06-13 14:49:04 +02:00
Kai Bao
4f7b899290 fixing the compilation problem due to rebasing
and also some small cleaning up
2019-06-13 14:49:04 +02:00
Kai Bao
3dcec6a436 removing StandardWellV 2019-06-13 14:49:04 +02:00
Tor Harald Sandve
613473082f Address PR comments 2019-05-24 16:45:27 +02:00
Tor Harald Sandve
821794b0ad Add well potential output to MSW
The common part is moved to the well interface class
This commit also adds iterations to the standardWells
well potential calculations to improve the results
2019-05-23 15:32:48 +02:00
Joakim Hove
b6840db604 Use new well implementation Well2 from opm-common 2019-05-22 21:47:45 +02:00
Kai Bao
4593453d10 adding function checkConvergenceControlEq to refactor getWellConvergence
only functional change is that rate control or BHP control has different
tolerance for MSW now.
2019-05-15 16:28:18 +02:00
Atgeirr Flø Rasmussen
c17adf788f Moved files to opm/simulators/ subdirs. 2019-05-08 12:58:19 +02:00