Commit Graph

190 Commits

Author SHA1 Message Date
Tor Harald Sandve
f9832d8830 split RateConverter 2021-09-07 08:53:09 +02:00
Tor Harald Sandve
9d2f26f7e8 Add support for gpmaint 2021-09-07 08:52:52 +02:00
Tor Harald Sandve
31ac5378cf fix case where wells are shut behind our back 2021-08-19 13:08:33 +02:00
Bård Skaflestad
71de144399
Merge pull request #3239 from osae/tracer
Tracer summary curves, collect well rates.
2021-06-25 17:48:40 +02:00
Bård Skaflestad
6d3da3d2e0 Report Pressure Dependent Pore Volume in PRT File
This commit distinguishes the reference condition pore volume from
the dynamic, pressure (and/or temperature) dependent pore volume
value.  Previously we would report the latter as the 'PORV' value in
the "Field Totals" and "FIPNUM region" reports, but this commit
switches to reporting the former instead-mostly for compatibility.
We still report the dynamic pore volume value, but now we report
this on a line of its own, before the table, using one of the forms

Field total pressure dependent pore volume = 12345 RM3
FIPNUM report region 1 pressure dependent pore volume = 123 RM3
2021-06-22 12:00:56 +02:00
Håkon Hægland
fbb24e2a5a Check group limits in gas lift stage 1.
Check group limits in gas lift stage 1 to avoid adding too much ALQ which must
anyway later be removed in stage 2. This should make the optimization
more efficient for small ALQ increment values. Also adds MPI support.
2021-06-16 12:00:54 +02:00
Ove Sævareid
33511b45c1 Relegating implementation details. 2021-06-15 17:18:46 +02:00
Ove Sævareid
581408c760 Batchwise tracer calculations. 2021-06-15 17:18:46 +02:00
Arne Morten Kvarving
6b5c7b66fd fixed: mark methods as override 2021-06-14 09:09:33 +02:00
Tor Harald Sandve
28a567550b removed dissolved gas and vapporized oil from RESV injection rates 2021-06-08 20:17:01 +02:00
Arne Morten Kvarving
0ef68b452a BlackoilWellModel: move runWellPIScaling to generic class 2021-06-07 15:01:10 +02:00
Arne Morten Kvarving
7219f09fdc BlackoilWellModel: mutate well_container_ directly in createWellContainer 2021-06-07 14:49:41 +02:00
Arne Morten Kvarving
2c5942595c BlackoilWellModel: put well container init in a separate method 2021-06-07 14:35:34 +02:00
Arne Morten Kvarving
30a59cd190 BlackoilWellModel: move updateWellPotentials to generic class 2021-06-07 14:22:30 +02:00
Arne Morten Kvarving
004abd942b BlackoilWellModel: put code for computing potentials in separate method 2021-06-07 14:09:36 +02:00
Arne Morten Kvarving
b0b0ae20d3 BlackoilWellModel: move some glift stuff to generic class 2021-06-07 13:36:22 +02:00
Arne Morten Kvarving
2b9141035e BlackoilWellModel: move setRepRadiusPerfLength to generic class 2021-06-07 13:36:17 +02:00
Arne Morten Kvarving
c5fae280f3 bring setWSolvent closer to original code
by introducing a getter for generic wells
2021-06-07 13:04:29 +02:00
Arne Morten Kvarving
60e7c90b1e BlackoilWellModel: move calculateEfficiencyFactors to generic class 2021-06-07 12:56:45 +02:00
Arne Morten Kvarving
811afb854b BlackoilWellModel: move updateNetworkPressures to generic class 2021-06-07 12:46:14 +02:00
Arne Morten Kvarving
172d344ab2 BlackoilWellModel: move inferLocalShutWells to generic class 2021-06-07 12:32:01 +02:00
Arne Morten Kvarving
ad4b34dc30 BlackoilWellModel: move forceShutWellByNameIfPredictionMode to generic class 2021-06-07 12:25:04 +02:00
Arne Morten Kvarving
54ff1c4c45 BlackoilWellModel: move hasTHPConstraints to generic class 2021-06-07 12:20:49 +02:00
Arne Morten Kvarving
059140f2ee split out typetag independent code from BlackoilWellModel 2021-06-07 12:04:06 +02:00
Arne Morten Kvarving
122ac87c55 GasLiftStage2: no longer a need to template on TypeTag 2021-05-28 08:24:07 +02:00
Arne Morten Kvarving
775177d73a GasLiftStage2: use GasLiftSingleWellGeneric 2021-05-28 08:24:07 +02:00
Arne Morten Kvarving
8f14e51c9e GasLiftStage2: use WellInterfaceGeneric
to lessen typetag dependence
2021-05-28 08:24:07 +02:00
Arne Morten Kvarving
7993e045c4 BlackoilWellModel: drop type alias GLiftWellState 2021-05-25 12:57:24 +02:00
Joakim Hove
23180e06d2 Rename WellStateFullyImplicitBlackoil -> WellState 2021-05-21 15:07:21 +02:00
Arne Morten Kvarving
31cb01ae24 no reason for GasLiftWellState to be typetag dependent 2021-05-20 12:17:24 +02:00
Tor Harald Sandve
1cd6ea14a9 only compute well potential when needed 2021-05-06 12:59:02 +02:00
Arne Morten Kvarving
a4c0af09d9 fixed: do not use Opm:: prefix when inside namespace Opm 2021-05-05 11:59:18 +02:00
Joakim Hove
8a78dc1c59 Add class GlobalWellInfo and use it from WellState 2021-05-03 13:28:28 +02:00
Bård Skaflestad
a6c374a27c Compute Well-Level PI For Shut Wells
This commit includes the shut wells in 'wells_ecl_' and expands the
PI/II value calculation to apply to those shut wells too.  With this
in place we are able to run cases that have a 'WELPI' keyword before
the well opens, even at the very first report step.
2021-04-27 14:51:18 +02:00
Bård Skaflestad
6e9d2bd89e Initialise More Data Members at Construction Time
In particular, apply explicit default constructors to most data
members and push initialisation to initialiser list if convenient.

While here, also split long lines and apply const in more places.
Finally, reset well- and connection-level PI values to zero in
WellState::shutWell().  This is in preparation of including shut
wells in BlackoilWellModel's internal state.
2021-04-27 14:50:37 +02:00
Joakim Hove
e1d117c59f Extract group state and create WGState to manage well & group state 2021-04-27 10:55:38 +02:00
Joakim Hove
a68589eb9a WellState will internalize PhaseUsage member 2021-04-27 00:11:04 +02:00
Joakim Hove
7d825ba9d0 Rename function wellToState -> loadRestartData 2021-04-13 21:02:36 +02:00
Håkon Hægland
61e67b143d Adds a simple test case for gas lift.
Adds a simple test case for gas lift optimization. Currently this is
very simplistic and only covers a fraction of the gas lift optimization
code. The plan is to use this as a building block to add more tests
in the future.
2021-04-01 16:41:46 +02:00
Håkon Hægland
434640fdf5 Implements gas lift optimization for groups.
Extends PR #2824 to include support for GLIFTOPT (item 2, maximum lift
gas supply for a group) and group production constraints.

The optimization is split into two phases. First the wells are optimized
separately (as in PR #2824). In this phase LIFTOPT and WLIFTOPT constraints
(e.g. maxmimum lift gas injection for a well, minimum economic gradient) are
considered together with well production constraints.

Then, in the next phase the wells are optimized in groups. Here, the ALQ
distribution from the first phase is used as a starting point. If a group
has any production rate constraints, and/or a limit on its total rate of
lift gas supply, lift gas is redistributed to the wells that gain the most
benefit from it by considering which wells that currently has the largest
weighted incremental gradient (i.e. increase in oil rate compared to
increase in ALQ).
2021-03-30 15:41:46 +02:00
Joakim Hove
98f6a9a7ac Update collection of wells after ACTIONX 2021-03-29 16:20:10 +02:00
Joakim Hove
5fe43c09cb Implement updateEclWell() as an internal function in wellPI code 2021-03-29 16:20:10 +02:00
Joakim Hove
405b9d2244 Add accessor functions to maintain WellState objects in well model 2021-03-29 15:30:32 +02:00
Tor Harald Sandve
8283b53f3b only compute Bavg once pr timestep and use the stored variable instead of passing it around 2021-03-23 15:30:36 +01:00
Tor Harald Sandve
8882b8027a
Merge pull request #3115 from totto82/onlyComputeGuideRateOnce
only compute guiderates at the beginning of a timestep
2021-03-23 08:43:47 +01:00
Joakim Hove
e2d75b608b Rename well filter -> not_on_process_() 2021-03-20 20:33:28 +01:00
Tor Harald Sandve
78d351676f only update guide rates at the beginning of a timestep 2021-03-19 11:09:14 +01:00
Bård Skaflestad
b982ad0fd2 Record Dynamic Well Status in 'wellData()' Output
This commit sets the 'data::Well::dynamicStatus' based on the
dynamically updated 'Schedule' object (i.e., from ACTIONX and
similar) and the results of well/operability testing (WECON and/or
WTEST).  If a well is closed due to economic limits (WECON) we still
provide summary-style data at the timestep that closed the well, but
omit this data at later steps until the well reopens.

We add a new parameter to WellState::report() to distinguish these
situations.

This is in preparation of making the 'BlackoilWellModel' manage both
open and shut wells alike.
2021-03-18 17:28:28 +01:00
Bård Skaflestad
65edfb702c Preparations for Recording Dynamic Well State
Coalesce blocks with same conditions, split long lines, and apply
'const' where appropriate.  While here, also tighten the "rate = 0"
criterion to include denormalised numbers.
2021-03-18 17:28:28 +01:00
Joakim Hove
cd7c4d9927
Merge pull request #3112 from totto82/refact_ginj
Add support for explicit guiderate for injection groups
2021-03-18 17:03:53 +01:00
Tor Harald Sandve
58fa3eaf31 replace asserts with OPM_DEFLOG_THROW 2021-03-18 11:58:05 +01:00
Tor Harald Sandve
f4ac7f555b Add support for explicit guiderate for injection groups
With this commit the guiderate logic used for the production groups is also used for injectors
This allows for setting guiderates explicit at different group levels
Only RATE, NETV and VOID guiderate type is suppored.
2021-03-16 15:56:31 +01:00
Paul Egberts
646dafe78f introduced computeWellTemperature() to be called at each timestep 2021-03-08 15:11:50 +01:00
Joakim Hove
ff51c2d7ee Handle WELLPI keyword in ACTIONX
When an ACTIONX has evaluated to True we inspect the keyword payload and if it
contains WELPI we query the well model for current wellpi values and pass that
along as context to the Schedule::applyAction()
2021-02-18 16:53:50 +01:00
Joakim Hove
99a61e120b Implement BlackoilWellModel::hasWell() method 2021-02-13 10:37:45 +01:00
Joakim Hove
0299af26ed Extract method wellPI() from existing lambda implementation 2021-02-12 11:49:04 +01:00
Joakim Hove
89eb6e5659 Extract functionality to update ecl wells to separate function 2021-02-10 15:17:36 +01:00
Arne Morten Kvarving
9b74b5dfac changed: this is known on compile time
use info to disable code
2021-01-28 14:33:56 +01:00
Arne Morten Kvarving
77692c1f99 quell unused parameter warning 2021-01-28 12:52:19 +01:00
Kai Bao
d8f8b9f0cc
Merge pull request #3028 from totto82/quarryPerfLengthAndRadius
get connection length and radius from the connection object
2021-01-28 11:21:21 +01:00
Tor Harald Sandve
9277b2edee get connection length and radius from the connection object 2021-01-25 14:08:59 +01:00
Tor Harald Sandve
fbcd230eb2 substitute solveWellEq with one inner solve for newly opened wells 2021-01-18 15:12:17 +01:00
Joakim Hove
17fcdfc87a Use ScheduleState to handle VFP propertes + simplifications 2021-01-14 19:22:34 +01:00
Markus Blatt
6eb835c98e Only use connections in the interior for distributed wells. 2020-12-07 16:32:33 +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
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
Markus Blatt
eb03712027 Factored out creation of parallel well infos from getLocalNonshutWells. 2020-12-04 13:02:01 +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
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
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
Ove Sævareid
0f7e66e151 Alternative solvent extension for the black oil model. 2020-11-17 12:33:19 +01:00
Arne Morten Kvarving
7d13d347db changed: remove unused parameters 2020-10-21 13:32:12 +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
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
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
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
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
Arne Morten Kvarving
93a3ebf8f7 changed: remove NEW_PROP_TAG macro usage 2020-08-28 10:44:53 +02:00
Arne Morten Kvarving
74fac38d85 changed: remove GET_PROP_TYPE / GET_PROP macro usage 2020-08-27 08:19:39 +02:00
Arne Morten Kvarving
70908d9017 changed: remove BEGIN_PROPERTIES/END_PROPERTIES macro usage 2020-08-21 15:50:35 +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
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
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
Tor Harald Sandve
85e95fb87d Implement min/max for GCONSALE
Only default action RATE is implemented for violation of maximum sales target
2020-05-05 14:24:17 +02:00
Tor Harald Sandve
a046977946 Fix GCONSALE
1) Only check GCONSALE limits at the end of a timestep. NB. The simulator still throws if some of the limits are violated
2) BUGFIX: don't remove gas consumption twice
2020-04-24 16:10:07 +02:00