Commit Graph

67 Commits

Author SHA1 Message Date
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
c23094b299 make another throw tread safe 2021-02-24 15:54:02 +01:00
Atgeirr Flø Rasmussen
18a8d78f02
Merge pull request #3008 from GitPaean/cleaningup_after_aicd_pr
refactoring the pressure assemble equations for ICD
2021-01-22 08:26:16 +01:00
Tor Harald Sandve
91ab0f4d93 fix phase index for WELLPI for MSW 2021-01-21 11:58:24 +01:00
Tor Harald Sandve
036a021c63 fix well model for gasoil thermal 2021-01-21 11:37:25 +01:00
Kai Bao
00ca6dc492 putting all the pressure assmeble function to one function
assemblePressureEq for MSW
2021-01-08 16:46:32 +01:00
Kai Bao
2dc63b7a57 putting the three ICD assembleEq function to be one
to reduce the code duplication.
2021-01-08 15:09:27 +01:00
Tor Harald Sandve
273538e1f4 some cleanup 2020-12-16 12:58:17 +01:00
Tor Harald Sandve
d027205c34 Initial well rates with the well potentials and scale the segment rates
Initialize the well rates with well potentials when computing rates from bhp or bhp(thp)
The bhp was already initialized.

Scale the segment rates and pressure to adapt to changes in well rate and bhp

Improves convergence of the well potential calculations
2020-12-15 08:39:22 +01:00
Tor Harald Sandve
a7664f9ea6 Add check for operability of MSW 2020-12-08 12:38:25 +01:00
Atgeirr Flø Rasmussen
83a6c2abae
Merge pull request #2947 from blattms/fix-parallel-well-red
Prepares for apply distributed standard wells.
2020-12-04 20:32:30 +01:00
Kai Bao
6e8394eba6 supporting WSEGAICD 2020-12-03 15:23:14 +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
Atgeirr Flø Rasmussen
8eb4d1dc70 Implemented computeCurrentWellRates() for multisegment wells.
Also add effect of rock compressibility on well connection transmissibility factors,
which was added to StandardWell earlier but not MultisegmentWell.
2020-10-15 16:24:55 +02:00
Atgeirr Flø Rasmussen
7e87ea3200 Refactor to put updateWellStateRates() in base class. 2020-10-15 14:15:05 +02:00
Kai Bao
64746e21bf
Merge pull request #2826 from akva2/janitoring
fixed: make some indices constexpr
2020-10-06 11:21:40 +02:00
Håkon Hægland
c0b493c4ce Fix inconsistent-missing-override warnings 2020-10-03 10:43:09 +02:00
Arne Morten Kvarving
7ffceeba57 fixed: make some indices constexpr
also use the bool conditions for conditional deref'ing with the indices.
this helps avoid maybe uninitialized warnings with gcc
2020-10-01 11:46:31 +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
Tor Harald Sandve
c2c009ecb6 clean-up based on review 2020-09-14 15:42:48 +02:00
Tor Harald Sandve
1a7b617074 guards against non-exsisting phases 2020-09-14 14:44:16 +02:00
Tor Harald Sandve
a323487b3b Fix the equation index for 2p oil-water simulations 2020-09-14 14:44:16 +02:00
Arne Morten Kvarving
914053ac3c changed: remove GET_PROP_VALUE macro usage 2020-08-27 13:01:51 +02:00
Markus Blatt
7261759065 Reuse UMFPack decomposition whenever possible.
We hold a shared pointer to the umpfack solver that gets reset
whenever the matrix is changed. When applying the decomposition
we will be recomputed if the solver pointer is null.
2020-08-18 17:55:50 +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
T.D. (Tongdong) Qiu
8913e1d057 Make sure OpenCL can be used without CUDA 2020-06-25 18:44:49 +02:00
Tor Harald Sandve
43d434d42e trivial clean up 2020-06-17 08:39:19 +02:00
Joakim Hove
5b940836ec Remove MultisegmentWell::calculateSICDFlowScalingFactors() 2020-06-04 14:13:14 +02:00
Tor Harald Sandve
cf702a5384 use relaxed tolerance for MSW when solution stagnates 2020-05-22 20:52:14 +02:00
T.D. (Tongdong) Qiu
04ee2be348 cusparseSolver can now handle MultisegmentWells, they are actually applied on CPU via SuiteSparse/UMFPACK 2020-05-15 16:40:34 +02:00
Kai Bao
251c09a288 adding the several pressure drop values to WellState for MSW
segpress_ and segrates_ are renamed to help the name style.
2020-04-17 00:38:38 +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
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
Kai Bao
61ed33c458 implementing the support for WSEGVALV 2019-12-11 14:43:09 +01:00
Kai Bao
196e997e79 various fixes and improvements 2019-12-06 10:15:11 +01:00
Kai Bao
cc77c0e826 importing the old WSEGSICD implementation
with small adjustments to make it compile
2019-12-06 10:14:20 +01:00
Atgeirr Flø Rasmussen
d96e0a2478 Refactor solving functions to take control objects directly.
This allows us to avoid some very hacky manipulation of the Well object.
2019-12-05 12:40:35 +01:00