Commit Graph

420 Commits

Author SHA1 Message Date
Markus Blatt
317e29d15a Utility for checking connections of distributed well. 2020-12-03 11:10:36 +01:00
Markus Blatt
3d92e41cad Recover prev. iteration count and curves for undistributed wells
Rounding errors for `B.mmv(x,y)` are slightly different from
```
Y temp(y);
B-mv(x, temp);
y -= temp;
```
2020-12-03 11:10:36 +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
3996967344 Added a class with information and comunicator for parallel wells.
BlackoilWellModel now stores an instance of this class for each
well. Inside that class there is a custom communicator that only
contains ranks that will have local cells perforated by the well.
This will be used in the application of the distributed well operator.

This is another small step in the direction of distributed wells,
but it should be safe to merge this (note creation of the custom
communicators is a collective operation in MPI but done only once).
2020-12-03 09:29:43 +01:00
Bård Skaflestad
b7fd9e42f4 Well Model: Add Helper for Well Pointer Creation
This commit adds a new helper function,

  WellInterfacePtr createWellPointer(wellID, reportStep) const

which is responsible for creating appropriately typed derived well
pointers depending on well types (multi-segment vs. standard).
This, in turn, allows us to centralise this logic and use the same
factory function both when creating the 'well_container_' and when
forming the well-test objects.

Finally, this helper will become useful for calculating PI/II values
of shut/stopped wells in the context of WELPI.
2020-12-02 16:30:46 +01:00
Atgeirr Flø Rasmussen
30856af1ab
Merge pull request #2959 from blattms/fix-initCompletions
[bugfix] Do not iterate pass end of perf_data_ in initCompletions
2020-12-02 16:11:05 +01:00
Markus Blatt
fdf6f4244c [bugfix] Do not iterate pass end of perf_data_ in initCompletions
IMHO this might have happened if perf_data_ is empty
or if the last connection is closed. (Discovered while
working on distributed wells but might happen already
before!)
2020-12-01 14:54:48 +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
b0dc5c0a63 Well PI: Use Appropriate Calculator for Each Well
The original code assumed that

    well_container_.size() == numLocalWells()

This assumption does not hold when wells open/shut dynamically in
the context of WECON and/or WTEST.

Switch to indexing into the 'prod_index_calc_' vector using the
well's own linear index instead of manually advancing iterators.

Pointy Hat: [at]bska
2020-11-27 14:50:08 +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
Cintia Goncalves Machado
f0ba56652e restructure if 2020-11-24 09:05:18 +01:00
Cintia Goncalves Machado
82c8201f00 fix well Control Single-Phase 2020-11-23 18:40:37 +01:00
Atgeirr Flø Rasmussen
ea34c2c2df
Merge pull request #2911 from atgeirr/network-add-glift
Add the option to include gas lift for network calculations.
2020-11-20 15:23:12 +01:00
Atgeirr Flø Rasmussen
69d04b7000 Set and communicate ALQ properly in parallel. 2020-11-20 08:03:21 +01:00
Atgeirr Flø Rasmussen
e15db6a892
Merge pull request #2934 from blattms/stdwell-assign-totalrate-once
StandardWell only assing primary_variables_[WQTotal] once.
2020-11-20 07:54:43 +01:00
Markus Blatt
b21b6cf28c
Merge pull request #2914 from ducbueno/rm-oclcontainer
Removed WellContributionsOCLContainer class
2020-11-19 21:27:55 +01:00
Markus Blatt
fb5f2eb9d0 StandardWell only assing primary_variables_[WQTotal] once.
There seems to be no need to assign the same value consecutively
as often as there are phases.
2020-11-19 19:50:01 +01:00
Atgeirr Flø Rasmussen
8716dbfcfd Add the option to include gas lift for network calculations. 2020-11-19 14:19:26 +01:00
Atgeirr Flø Rasmussen
307315a03d
Merge pull request #2932 from atgeirr/glift-constify
Make consistent use of const for alq-related state.
2020-11-19 12:56:37 +01:00
Atgeirr Flø Rasmussen
376aecfad5 Store producer status, only call getALQ() for producers.
As it was, the getALQ() call would insert injectors into the ALQ maps,
leading to trouble.

Also, this gets rid of the slightly weird thing that the output data
structure's producer/injector status was only set after creation,
in BlackoilWellModel::wellData().
2020-11-19 11:22:25 +01:00
Arne Morten Kvarving
a95cc3dcbc fixed: signed/unsigned comparison warnings 2020-11-19 11:03:06 +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
Tor Harald Sandve
0ac2f922d3
Merge pull request #2851 from osae/extboSimulators
Alternative solvent extension for the black oil model.
2020-11-18 14:01:36 +01:00
Markus Blatt
ea3c899080
Merge pull request #2882 from atgeirr/msw-add-well-contrib
Implement addWellContributions() for multi-segment wells
2020-11-18 13:44:24 +01:00
Jose Eduardo Bueno
a9c2a684c6 Removed WellContributionsOCLContainer class (rebase) 2020-11-18 09:14:31 -03:00
Ove Sævareid
940af0f15d Fixed typo. 2020-11-17 19:42:41 +01:00
Ove Sævareid
63c97d54d0 Rebase issue. 2020-11-17 14:50:57 +01:00
Markus Blatt
41843f2667 Use consistent pvt region index for groups in parallel.
In serial we use the first cell of the first well to determine the
pvt region index for a group. Previously, we used the first cell of
the first local well in a parallel run. Unfortunately that may lead
to different pvt region indices being used for the same goup on
different processes.

We fix this by using the same approach in parallel as we already use
in serial. For this we use Well::seqIndex() to determine the needed
ordering.
2020-11-17 12:54:45 +01:00
Atgeirr Flø Rasmussen
d69dbf598e Response to review comments. 2020-11-17 12:53:04 +01:00
Ove Sævareid
98b2ed5bd4 Cleaning up various issues. 2020-11-17 12:39:21 +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
82ecb1e7cd Implement addWellContributions() for MultisegmentWell. 2020-11-16 11:42:29 +01:00
Atgeirr Flø Rasmussen
963a8b640a Add the invertWithUMFPack() utility. 2020-11-16 11:37:44 +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
Markus Blatt
d6e2e87efc WellInterface::initComletions: stop relying on open connections being local.
Instead use the perforation data to add the correct indices.
2020-11-12 17:22:36 +01:00
Markus Blatt
049aaad326 Adds original ECL index of well connection to PerforationData
and use it in the WellInterface instead of creating a vector
with these indices there. The original approach recreates
information in another path of the well and assumes that all
connections are in a process's local partition. That assumption
does not hold any more for distributed wells.
2020-11-12 17:21:37 +01:00
Markus Blatt
010ff83f26 Use functor iterating container when communicating group rates.
Makes the code more compact.
2020-11-12 16:28:36 +01:00
Tor Harald Sandve
73b384f8cd
Merge pull request #2902 from totto82/fixWlift
Fixes to the wlift implementation
2020-11-06 15:58:24 +01:00
Tor Harald Sandve
2795d1713f avoid oscilating between decreasing and increasing when rates are limited 2020-11-06 15:19:21 +01:00
Paul Egberts
7ef854f32f
Two fixes
1) Corrected phaseIsActive with PhaseIdx argument instead of CompIdx argument in "subtraction of dissolved gas from oil phase and vapporized oil from gas phase".
2) Fix for well accumulation calculation in case oil is absent.
2020-11-05 17:09:25 +01:00
Tor Harald Sandve
bd370c6470 fixes to the wlift implementation 2020-11-05 13:05:01 +01:00
Bård Skaflestad
3058047d3c Extract Correct Connection-Level Rates
The Polymer, Brine, and Solvent quantities would be extracted from
elements 0..#perf-1 of their pertinent container rather than from
the elements associated to the particular well.
2020-10-23 22:24:00 +02:00
Atgeirr Flø Rasmussen
5d48923994
Merge pull request #2856 from plgbrts/temp
fix temperature reporting for injectors
2020-10-22 14:25:35 +02:00
Tor Harald Sandve
990ce70287
Merge pull request #2849 from goncalvesmachadoc/aquifer
Prepare Well Implemantion For Water and Water-Gas System
2020-10-22 14:08:12 +02:00
Arne Morten Kvarving
7d13d347db changed: remove unused parameters 2020-10-21 13:32:12 +02:00
Atgeirr Flø Rasmussen
7e737b143d Address review comments. 2020-10-21 09:50:31 +02:00