Commit Graph

145 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
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
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
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
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
Markus Blatt
b21b6cf28c
Merge pull request #2914 from ducbueno/rm-oclcontainer
Removed WellContributionsOCLContainer class
2020-11-19 21:27:55 +01:00
Atgeirr Flø Rasmussen
8716dbfcfd Add the option to include gas lift for network calculations. 2020-11-19 14:19:26 +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
Jose Eduardo Bueno
a9c2a684c6 Removed WellContributionsOCLContainer class (rebase) 2020-11-18 09:14:31 -03: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
Ove Sævareid
0f7e66e151 Alternative solvent extension for the black oil model. 2020-11-17 12:33:19 +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
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
Atgeirr Flø Rasmussen
24b2393334 Add parameter --alternative-well-rate-init.
With this, a slightly more sophisticated procedure is used for well rate intialization.
Since it changes existing results, it defaults to false, giving the existing behaviour.
2020-10-15 17:56:11 +02:00
Atgeirr Flø Rasmussen
6155188a70 Remove unused file SimFIBODetails.hpp. 2020-10-15 16:35:35 +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
Atgeirr Flø Rasmussen
ac3004da9d
Merge pull request #2847 from blattms/blackoilmodel-getLocalNonshutWells
Added BlackoilWellModel::getLocalNonshutWells to reduce code duplicat…
2020-10-09 16:35:50 +02:00
Markus Blatt
ba1bc7c23c Added BlackoilWellModel::getLocalNonshutWells to reduce code duplication. 2020-10-09 15:27:09 +02:00
Markus Blatt
5553d2d1f3 Renamed variables/functions for number of cells. 2020-10-05 20:02:13 +02:00
Markus Blatt
ca8de16285 Fixes parallel computation of average formation factors.
This was using the sum of the sum of all cells of the partitions.
Hence the shared cells were counted twice.
2020-10-05 14:08:59 +02:00
Tor Harald Sandve
165fa96250
Merge pull request #2824 from hakonhagland/gas_lift3
Implements support for gas lift optimization.
2020-10-02 14:48:27 +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
a01ae8a64c Removed unnecessary code.
Forgot to remove this call after refactoring.
2020-09-30 12:13:01 +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
Jose Eduardo Bueno
1ba81cece2 First commit 2020-09-24 16:35:36 -03:00
Markus Blatt
1d94357558 Refactored how well information is exported after load balancing.
Previously, we exported an unordered map containing all names of
wells that are not present in the local part of the grid.

As we envision to have wells that are distributed across multiple
processors, this information does not seem to be enough. We need
to be able to set up communication for each well. To do this we need
to find out who handles perforations of each well.

We now export a full list of well name together with a boolean
indicating whether it perforates local cells (vector of pair of string
and bool).
2020-09-22 20:04:01 +02:00
Bård Skaflestad
fde3c476c3 Chase Group/Node Summary API Update
This is in preparation of adding support for outputting the network
node pressure quantity, GPR, to the summary file.  In particular,
'GroupValues' is renamed to 'GroupAndNetworkValues' and has new
individual datamembers for the former group-level data and the new
node-level data.

Update BlackoilWellModel::groupData() and CollectToIORank
accordingly and bring the parallel restart facility in line with the
new layout.
2020-09-20 22:26:07 +02:00
Kai Bao
7b4142e9b6 adding timing for the well assembly
And changes the indentation of the linear solver setup time a little to
show it is part of the linear solve time.
2020-09-08 11:12:41 +02:00
Bård Skaflestad
6220cdf613 Restore Groups' Active Constraints on Restart
First step towards better restarts of models with group control.
2020-09-03 01:11:32 +02:00
Bård Skaflestad
144baeeb42 Well Model: Report Guiderates at Well and Group Levels
This commit adds support for reporting the simulator's guiderate
values at the well and group levels to the output layer through the
wellData() and groupData() member functions.  We add several new
member functions that collectively assemble the values and assign
them to objects of type Opm::data::GuideRateValue for subsequent
output to the summary and restart files.

In particular

    getGuideRateValues(const Well&) const
    getGuideRateValues(const Group&) const

retrieve the guiderate values for all phases for those individual
wells and groups for which the guideRate_ data member defines a
value.  The most complicated function of this commit is

    calculateAllGroupGuideRates

which aggregates those individual contributions from the well (leaf)
level up to the root of the group tree (the FIELD group).  This
process uses an ancillary array ('up') to keep track of the parent
groups of all wells and all groups, and to ensure that we only visit
each parent group once (sort+unique on subsets of the 'up' array).

We do not currently support outputting guiderates for reservoir
voidage volume (GuideRateModel::Target::RES).
2020-09-02 17:22:04 +02:00
Bård Skaflestad
efed640e63 Broken Constraints: Fix Diagnostic Message
Especially, grab a copy of the "oldControl" to avoid reading through
a reference for which the underlying object is reset in

    setCurrent*GroupControl()

This in turn avoids generating confusing diagnostic messages of the
form

    Switching production control mode for group G from FLD to FLD
2020-08-31 13:04:39 +02:00
Arne Morten Kvarving
914053ac3c changed: remove GET_PROP_VALUE macro usage 2020-08-27 13:01:51 +02:00
Markus Blatt
13ff454e56 Remove unused variable groups from BlackoilWellModel::wellsToState.
Alternatively it could be marked as [[maybe_unused]] if it will be
used sometime in the future.
2020-07-21 11:35:43 +02:00
Markus Blatt
faaee51d09
Merge pull request #2682 from Tongdongq/openclSolver
Added openclSolver
2020-07-10 13:38:32 +02:00
Joakim Hove
b9b1e734cb Add data::GroupValues member to RestartValue 2020-07-04 10:06:03 +02:00
Bård Skaflestad
5bb4321824 Simulator Group Data: Chase Upstream API Update
This commit makes the 'groupData()' function return a

    map<string, Opm::data::GroupData>

object instead of a

    map<string, Opm::data::GroupConstraints>

object.  The 'GroupData' structure adds a level of indirection to
the current per-group summary quantities that are directly assigned
by the simulator.  While here, also move the assignment of the
current group constraints/control values out to a separate helper
to reduce the body of the per-group loop in 'groupData()'.

This is in preparation of adding support for reporting group-level
production/injection guiderates (Gx[IP]GR) to the summary file.
2020-07-01 22:52:26 +02:00
Atgeirr Flø Rasmussen
a66260fe87
Merge pull request #2684 from totto82/convertUsingPriviousRates
use rates from previous time-step in the guiderate conversion
2020-07-01 11:04:22 +02:00
T.D. (Tongdong) Qiu
8913e1d057 Make sure OpenCL can be used without CUDA 2020-06-25 18:44:49 +02:00
Tor Harald Sandve
a99254f917 clean up based on review 2020-06-24 09:48:09 +02:00
Tor Harald Sandve
8e3c124b23 use rates from privious time-step in the guiderate conversion to reduce oscilation 2020-06-24 09:38:18 +02:00
Bård Skaflestad
4ea5b7e989 Check GCONSALE Limits: Remove Unused Variable
Fixes a warning.
2020-05-24 13:16:47 +02:00
Markus Blatt
55b3a65230
Merge pull request #2628 from Tongdongq/multisegmentwells-gpu
cusparseSolver can now handle MultisegmentWells
2020-05-22 16:24:58 +02:00
T.D. (Tongdong) Qiu
04ee2be348 cusparseSolver can now handle MultisegmentWells, they are actually applied on CPU via SuiteSparse/UMFPACK 2020-05-15 16:40:34 +02:00
Atgeirr Flø Rasmussen
5aa2a785af Correct messages for group control switching. 2020-05-14 17:31:21 +02:00
Atgeirr Flø Rasmussen
8dd53a38e9 Refactor SimulatorReport system.
Now SimulatorReport object contains a vector of SimulatorReportSingle objects,
for both successful and failing steps.
2020-05-07 16:13:39 +02:00
Atgeirr Flø Rasmussen
7dbbc0f2e5
Merge pull request #2588 from totto82/addMinMaxSupportGCONSALE
Implement min/max for GCONSALE
2020-05-05 15:46:36 +02:00