Commit Graph

130 Commits

Author SHA1 Message Date
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
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
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
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
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
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
cb928f90f0 Refactor per-perforation code into separate function.
Also make some methods const.
2020-11-16 11:19:03 +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
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
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
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
Cintia Goncalves Machado
a697e7faf6 fix return position 2020-10-14 14:55:38 +02:00
Cintia Goncalves Machado
920f071f5f fix fractions 2020-10-12 16:46:39 +02:00
Cintia Goncalves Machado
23e7886297 prepareWellImplForLackOfOil 2020-10-10 16:05:12 +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
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
Tor Harald Sandve
88ee892fdf pass the saltConcentration to the waterPVT 2020-07-02 13:44:01 +02:00
Tor Harald Sandve
6a7e816368 Add brine to output 2020-06-30 14:15:54 +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
39e23c4d41 store polymer rates for output 2020-06-23 12:01:34 +02:00
Tor Harald Sandve
8a5c9e82df add run time parameters for msw convergence tuning. Default values are set to minimize convergence failures for model2 based tests. These parameters are also tested on bigger models with good results 2020-05-22 20:52:14 +02:00
Tor Harald Sandve
cf702a5384 use relaxed tolerance for MSW when solution stagnates 2020-05-22 20:52:14 +02:00
Tor Harald Sandve
904353367d compute initial volume fractions on the well copies also 2020-05-08 19:29:20 +02:00
Atgeirr Flø Rasmussen
e7e4cf6f20 Silence warnings and fix whitespace. 2020-04-08 10:41:20 +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
Tor Harald Sandve
92ee56c3b3 scale guiderate by current well rate 2020-04-02 13:54:47 +02:00
Atgeirr Flø Rasmussen
27f62399f5 Handle guide-rate based well constraints from groups. 2020-04-02 10:41:57 +02:00
T.D. (Tongdong) Qiu
ab2d9a8c76 Changed int idx to indicate which matrix is added to WellContributions to an enum 2020-03-20 10:04:58 +01: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