Commit Graph

173 Commits

Author SHA1 Message Date
Joakim Hove
506a349085
Use wellcontainer2 (#3255)
Use WellContainer<> to manage members in WellState
2021-05-20 16:16:12 +02:00
Joakim Hove
b0458cee33
Merge pull request #3268 from joakim-hove/wellstate-iget
Wellstate iget
2021-05-19 14:29:26 +02:00
Joakim Hove
6af03f4a6a Update WellState::thp() 2021-05-19 10:05:11 +02:00
Joakim Hove
3ec7feba75 Update WellState::bhp() 2021-05-19 10:05:11 +02:00
Arne Morten Kvarving
bcfab1fed3 use if constexpr to eliminate some brine code 2021-05-18 15:04:47 +02:00
Arne Morten Kvarving
db668e8d80 make has_energy constexpr and use if constexpr to eliminate code 2021-05-18 15:04:47 +02:00
Arne Morten Kvarving
268201eeb1 make has_polymermw constexpr and use if constexpr to eliminate code 2021-05-18 15:04:47 +02:00
Arne Morten Kvarving
dd04eb128a use if constexpr to eliminate some zFraction code 2021-05-18 10:18:11 +02:00
Arne Morten Kvarving
83595d84c3 use if constexpr to eliminate some polymer code 2021-05-18 10:18:11 +02:00
Arne Morten Kvarving
1fa74b5889 use if constexpr to eliminate some foam code 2021-05-18 10:18:11 +02:00
Arne Morten Kvarving
6157122bd8 use if constexpr to eliminate some solvent code 2021-05-18 10:17:21 +02:00
Joakim Hove
b5580f39fa Let the perforation index run over the indices for one well 2021-05-11 22:38:11 +02:00
Joakim Hove
846809ec29 Rename mutable perfPhaseRates() 2021-05-11 18:48:05 +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
Tor Harald Sandve
12880be916
Merge pull request #3159 from totto82/updateWellTargetFix
get bhp from thp without solving
2021-04-26 13:15:30 +02:00
Tor Harald Sandve
ebcaea3faa get bhp from thp without solving 2021-04-14 15:58:58 +02:00
Tor Harald Sandve
9d56588906 Make gaslift parallel 2021-04-14 14:14:39 +02:00
Håkon Hægland
a80ad54d7d Parallel runs not supported yet.
Gives a warning if gas lift optimization is attempted for more than one
process in the MPI communicator. The plan is to implement support for
muliple processes in a later commit.
2021-03-30 15:42:33 +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
Bård Skaflestad
65edfb702c Preparations for Recording Dynamic Well State
Coalesce blocks with same conditions, split long lines, and apply
'const' where appropriate.  While here, also tighten the "rate = 0"
criterion to include denormalised numbers.
2021-03-18 17:28:28 +01:00
Joakim Hove
fda1d65494 Pass table argument to VFP getFLo() 2021-02-15 22:21:56 +01:00
Joakim Hove
e4789d4eb7 Use std::reference_wrapper for VFP tables 2021-01-26 07:56:59 +01:00
Tor Harald Sandve
036a021c63 fix well model for gasoil thermal 2021-01-21 11:37:25 +01:00
Atgeirr Flø Rasmussen
3a0dbdc6e7
Merge pull request #2993 from blattms/stdwell-comm-rebase-split-cont-clean
Final fixes to make distributed wells work for Norne.
2021-01-15 15:42:45 +01:00
Kai Bao
286a7d2e5b
Merge pull request #3002 from totto82/moveWellOpCheck
move well operability check for STW
2021-01-08 11:28:35 +01:00
Joakim Hove
c1e10d81ba Use ScheduleState to access nupcol 2021-01-06 15:10:05 +01:00
Tor Harald Sandve
5ee75c45e3 move well operability check for STW 2021-01-05 15:10:40 +01:00
Markus Blatt
5b943761d7 Fixes StandardWell::computeConnectionDensities.
This computation is serial and needs a complete representation
of data attached to all preforations (even those stored on
another process). This commit uses the newly created factory to
correctly compute the connection densities for distributed wells.
2020-12-18 14:48:19 +01:00
Markus Blatt
4dff6fb168 Fixes StandardWell::updateProductivityIndex for distributed wells. 2020-12-18 14:48:19 +01:00
Markus Blatt
12f5a6aaff Fixes StandardWell::allDrawDownWrongDirection for distributed wells. 2020-12-18 14:48:19 +01:00
Markus Blatt
ba1feadb63 Added missing parallel reduction to computeCurrentWellRates.
This is supposed to be summation over values at all perforations.
Hence, it needs a parallel sum.
2020-12-18 14:48:19 +01:00
Markus Blatt
fc4a7fa3c1 Fixes StandardWell::updateIPR for distributed wells.
Of course the summation needs to be over all perforations of the
wells, no matter where they reside. Hence we need communication.
2020-12-18 14:48:19 +01:00
Markus Blatt
c09797355d Sum well rates in computeWellRatesWithBhp for distributed wells.
This needs summation over all procs that share the well as it needs
information from all perforations. Some of them might reside on other
processes.
2020-12-18 14:48:19 +01:00
Markus Blatt
c0c1897ea9 Fix computeConnectionPressureDelta for distributed wells.
As this is as sequential (ordering matters!) as it can get we need to
communicate all perforations, do the partial sum with them and save
result back to the local perforations.
2020-12-10 11:32:52 +01:00
Atgeirr Flø Rasmussen
6e87ec6266
Merge pull request #2955 from blattms/stdwell-comm-rebase-split-pwell-info
Last part of current distributed standard wells.
2020-12-10 08:56:00 +01:00
Tor Harald Sandve
a7664f9ea6 Add check for operability of MSW 2020-12-08 12:38:25 +01:00
Markus Blatt
f7ed1b21fa Determine pressure and depth above for distributed wells. 2020-12-07 16:32:33 +01:00
Markus Blatt
2e5b1c8d54 Use reference for WellInterface::parallel_well_info_ 2020-12-04 13:24:31 +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
Markus Blatt
ab114b2e95 Use WellInterface::perf_data_ to calculate PI.
that simplifies the code a bit and will work with
distributed wells. Previously, we assumed that all
non-shut perforations are stored locally. That does
not hold any more.
2020-12-01 14:11:05 +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
92589a697b PI/II Loop: Switch Order of Injection/Production Branches
For readability reasons.

Suggested by: [at]atgeirr
2020-11-24 21:53:58 +01:00
Bård Skaflestad
c8a43b982c PI/II Loop: Check That We Process All Active Connections
Assert that the 'subsetPerfID' is equal to number_of_perforations_
at the end of the loop.

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