Commit Graph

7602 Commits

Author SHA1 Message Date
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
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