Commit Graph

7662 Commits

Author SHA1 Message Date
Markus Blatt
07e676371e Get global index from Well connection instead of computing it. 2020-12-07 20:22:54 +01:00
Markus Blatt
f7ed1b21fa Determine pressure and depth above for distributed wells. 2020-12-07 16:32:33 +01:00
Markus Blatt
6f4fa114c1 barrier before and after MPI_Broadcast in non-production runs.
This helps with debugging as for some OpenMPI versions communication
might interfere with other communications if there are bugs.
2020-12-07 16:32:33 +01:00
Markus Blatt
901327ac54 Cater for empty parts of distributed wells for pvt region index. 2020-12-07 16:32:33 +01:00
Markus Blatt
a9df5065ae Use global number of perforations when initializing well.
The local number of perforations is not correct anymore
for distributed wells.
2020-12-07 16:32:33 +01:00
Markus Blatt
0d6c39be2f Fix distributed WellInterface::checkMaxRatioLimitCompletions
Not all connections are local, hence we need a sum across all processes
computing for this well.
2020-12-07 16:32:33 +01:00
Markus Blatt
6eb835c98e Only use connections in the interior for distributed wells. 2020-12-07 16:32:33 +01:00
Markus Blatt
91e951420f [bugfix] Pass references to gatherVectorOnRoot 2020-12-07 15:40:51 +01:00
Markus Blatt
fd4db9b933 Only sum rates for owned wells in WellGroupHelpers.
Well rates of distributed wells might be stored on multiple processes
but should be summed only once. Hence only the owner does the
summation with this commit.
2020-12-07 15:40:51 +01:00
Markus Blatt
c2f59b0629 Skip temp. reporting of some rates if distributed non-owned wells.
In the end of the report each the report from these wells will
come from another process, anyway.
2020-12-07 15:40:51 +01:00
Markus Blatt
472623d4a3 Output report for distributed wells only on owner.
For this we need to gather the connection data from
both WellState and WellStateFullyImplicitBlackoil.
2020-12-07 15:40:51 +01:00
Markus Blatt
580ef249b3 Skip wells not owned when communicating goup rates. 2020-12-07 15:40:50 +01:00
Markus Blatt
4edca71a1b Correct pressure and pvt region index for distributed wells.
To get this we need to determine which process has the
very first open well connection and use that to broadcast
pressure and pvt region index.
2020-12-07 15:40:50 +01:00
Markus Blatt
a9a733ebc1 Make check whether a connection exists work for distributed wells. 2020-12-07 15:20:42 +01:00
Arne Morten Kvarving
7d19091cb3 changed: make member variables constexpr
may as well use the compile time information to eliminate
unnecessary code
2020-12-07 12:16:04 +01:00
Arne Morten Kvarving
bbf0f7d6af remove unused members 2020-12-07 12:09:33 +01:00
Markus Blatt
932e3c8fb9 Use a custom handle for copying doubles for above.
The one previously used is unfortunately protected upstream (not noticed with gcc <=8).
2020-12-07 11:47:09 +01:00
Atgeirr Flø Rasmussen
d20641d97b Only modify initial rates for producers. 2020-12-07 10:05:46 +01:00
Atgeirr Flø Rasmussen
a07ee07c66 Add missing template qualification. 2020-12-07 08:31:10 +01:00
Kai Bao
7ecb2e4813
Merge pull request #2866 from bska/activate-welpi-scaling
Initial Implementation of WELPI Feature
2020-12-04 20:44:42 +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
Bård Skaflestad
d06b7f9ec2 Record Basic Support for WELPI
Remove 'WELPI' keyword from MissingFeatures.
2020-12-04 15:16:25 +01:00
Bård Skaflestad
319c240336 Run WELPI Scaling At Beginning of Report Step
This commit implements the WELPI feature.  We calculate new PI/II
values for all wells in the event of a WELPI request and use those
values for well-specific WELPI request, to calculate CTF scaling
factors.  We then apply those factors to all subsequent editions of
the well provided the connection factors are eligible for
WELPI-based rescaling.

If we trigger a rescaling event we also reset the WellState's
internal copies of the CTFs and reinitialize the Well PI calculators
to ensure the rescaling takes effect immediately.  Since we rely on
PI values being available at the end of each time step we must also
take care to forward those values from the WellState of one report
step to the WellState of the next report step.

Finally, take care not to redo a WELPI scaling if we've already
performed the scaling operation and restart a report step.  This,
in turn, happens if WELPI is requested on the first report step.
2020-12-04 15:16:25 +01:00
Bård Skaflestad
f6130861df Well Data: Report CTFs for Shut Connections
Needed to ensure that the CTFs reported to the summary files will be
correct in the presence of WELPI even for shut connections.
2020-12-04 15:16:25 +01:00
Bård Skaflestad
e780d107ab Split Well Stat Initialization Out to Helper Function
Mostly to reduce the complexity of the implementation of
beginReportStep() and to enable easier reordering of the stages.
2020-12-04 15:16:25 +01:00
Bård Skaflestad
4e9e60a71b Refactor Well Guide Rate Summary Assignment
In anticipation of adding more steps later.
2020-12-04 15:16:24 +01:00
Bård Skaflestad
c800c5376d Add Special-Purpose Operation to Reset WellState CTFs
This commit adds a new member function

    WellState::resetConnectionTransFactors

which overwrites the transmissibility factor of 'well_perf_data_'
pertaining to a particular well.  This is to keep the values in
sync following a rescaling operation such as WELPI.
2020-12-04 15:16:24 +01:00
Bård Skaflestad
aaca907f77 Productivity Index Calculator: Add Reinitialization operation
This commit adds a new member function

    WellProdIndexCalculator::reInit(const Well& well)

which reinitializes the internal arrays in the same way as the
constructor.  This is needed to ensure that the PI calculation
device is synchronised in the case of CTF rescaling-e.g., as a
result of WELPI.
2020-12-04 15:16:24 +01:00
Bård Skaflestad
3ac2f02f4f
Merge pull request #2839 from akva2/remove_liftopt_missing
remove LIFTOPT and WLIFTOPT from missing features
2020-12-04 13:52:09 +01:00
Markus Blatt
10fd57f37f BlackoilWellModel: Skip capturing this and simulator in lambda
Instead create local variables and capture them.
2020-12-04 13:43:45 +01:00
Markus Blatt
2e5b1c8d54 Use reference for WellInterface::parallel_well_info_ 2020-12-04 13:24:31 +01:00
Markus Blatt
eb03712027 Factored out creation of parallel well infos from getLocalNonshutWells. 2020-12-04 13:02:01 +01:00
Markus Blatt
9c17628995 Renamed pinfo to parallel_well_info 2020-12-03 15:34:48 +01:00
Markus Blatt
9cada4a5a5 Fix indentation 2020-12-03 15:29:12 +01:00
Markus Blatt
575120d4f0 Improce documentation a bit. 2020-12-03 15:24:05 +01:00
Kai Bao
61bebb2ec5 addressing reviewing comments for OPM/opm-simulators#2951 2020-12-03 15:23:14 +01:00
Kai Bao
6e8394eba6 supporting WSEGAICD 2020-12-03 15:23:14 +01:00
Markus Blatt
c5dd4f4533 Make CommunicateAbove constructor explicit. 2020-12-03 15:12:35 +01:00
Markus Blatt
0126243f02 Utility to communicate above value of a perf of distributed well
This adds an utility that creates a vector of all above values for
the local perforations. For distributed wells this is needed as the
perforation above might live on another processor. We use the parallel
index sets together with the global index of the cells that are
perforated.
2020-12-03 11:10:36 +01:00
Markus Blatt
73919d6136 Support broadcasting value of first perforation for distributed well
This needed to e.g. determine bottom hole pressure, pvt region, etc.
2020-12-03 11:10:36 +01:00
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
Paul Egberts
877c0b723d fix missing argument for BlackoilTwophaseIndices 2020-12-03 09:04:11 +01:00
Paul Egberts
d0421582e1 add gas-water simulator 2020-12-03 09:04:11 +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
Atgeirr Flø Rasmussen
374764fc6f
Merge pull request #2946 from atgeirr/add-more-amg-options
Add more AMG options to allow setting from JSON.
2020-11-27 08:57:04 +01:00
Atgeirr Flø Rasmussen
5617a2ef5c
Merge pull request #2919 from blattms/do-not-filter-distributed
Do not filter connections on the schedule of the loadbalanced grid.
2020-11-26 16:43:09 +01:00
Atgeirr Flø Rasmussen
6e31c77234 Add more AMG options to allow setting from JSON. 2020-11-26 15:37:50 +01:00
Tor Harald Sandve
f924ac7ffe
Merge pull request #2933 from totto82/dunefem
WIP make Flow compile with dune-fem
2020-11-26 15:10:34 +01:00
Atgeirr Flø Rasmussen
a0ca8dd0b5 Use better-suited AMG criterion.
Use SymmetricDependency instead of SymmetricMatrixDependency.
Our matrices are structurally symmetric, but not numerically symmetric.
2020-11-25 16:40:03 +01:00
Markus Blatt
19bebcefe2 Broadcast schedule another time after filtering connection on rank 0
Only after rank zero does the filtering the schedule the well
definitions in there are guarateed to have no perforations to inactive
cells. Therefore we broadcast the schedule another time to publish
this to all processes.

Previously, we did the filtering locally on these processes bit that
did also remove perforations to cells that are active globally but
not locally. That seems very hard to work with when allowing
distributed wells.
2020-11-24 22:46:49 +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
Bård Skaflestad
9f12a2edba
Merge pull request #2931 from alfbr/guiderat-supported
Removed supported keywords from list
2020-11-24 21:51:30 +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
Tor Harald Sandve
c4c0b7a756 Make it compile with dune-fem 2020-11-19 15:45:37 +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
Alf Birger Rustad
b651469f34 Removed supported keywords from list 2020-11-19 09:36:30 +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
Arne Morten Kvarving
7b58071b8e
Merge pull request #2924 from akva2/janitoring
remove unused variable
2020-11-18 10:53:50 +01: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
Arne Morten Kvarving
cff02ee105 remove unused variable 2020-11-17 13:22:35 +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
f967d82ad5 Make --alternative-well-rate-init=true the default. 2020-11-17 11:56:02 +01:00
Markus Blatt
09a4a04c22
Merge pull request #2896 from atgeirr/refactor-well-calc
Refactor well calculations
2020-11-17 09:40:19 +01:00
Markus Blatt
64fa5a2b30
Merge pull request #2858 from Tongdongq/ilu-reorder-strategy
Added cmdline parameter --ilu-reorder-strategy
2020-11-17 09:35:12 +01:00
Markus Blatt
0dcfc60363
Merge pull request #2912 from totto82/polyhedrealgrid
Make a flow version that uses the polyhedreal grid
2020-11-16 17:04:38 +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
db7cd1053f Add the multMatrixImpl() 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
Atgeirr Flø Rasmussen
6f7e83a2ce
Merge pull request #2916 from blattms/stdwell-comm-backport
Parts of the distributed well work backported to original approach.
2020-11-13 08:43:00 +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