Commit Graph

131 Commits

Author SHA1 Message Date
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
Atgeirr Flø Rasmussen
e7e4cf6f20 Silence warnings and fix whitespace. 2020-04-08 10:41:20 +02:00
Tor Harald Sandve
70b7bed057 dont check if group has converged in solveWellEq 2020-04-02 13:57:38 +02:00
Tor Harald Sandve
66931b9cb7 Various fixes and refactoring.
- Communicate all well rates.
 - When changing controls, modify rates to satisfy failed constraint.
 - Ensure targets are positive.
 - Always solve for potentials for MSW (temporary fix).
2020-04-02 13:57:05 +02:00
Atgeirr Flø Rasmussen
27f62399f5 Handle guide-rate based well constraints from groups. 2020-04-02 10:41:57 +02:00
Bård Skaflestad
d95eb32510 Save and Restore Well's Current Control Target Mode
This commit uses the new restart file support for active well
control target modes to save and restore the run's active targets.
2020-03-26 14:20:12 +01:00
Markus Blatt
c0a82ff335
Merge pull request #2475 from Tongdongq/separate_wellcontributions_for_gpu
Separate wellcontributions for gpu
2020-03-20 12:14:06 +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
Jostein Alvestad
6a659339f1 various corrections to code and coding style 2020-03-16 10:39:56 +01:00
Jostein Alvestad
3f81d68c0a corrections due to rebase to current master 2020-03-16 10:39:54 +01:00
Jostein Alvestad
4006319ff7 further changes to report currentStatusGroupControls to Summary 2020-03-16 10:39:52 +01:00
Jostein Alvestad
0dcacb41d4 intial changes to add current group controls to summary 2020-03-16 10:39:51 +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
150dc54e79
Merge pull request #2298 from totto82/muliple-group-inj-phases
Allow for multiple group injection phases
2020-02-14 10:31:45 +01:00
Atgeirr Flø Rasmussen
5fe48dab8b
Merge pull request #2327 from akva2/bump_dune
Bump required dune version to 2.6
2020-02-11 09:41:44 +01:00
Tor Harald Sandve
e39e327451 fix 2p 2020-02-11 09:33:58 +01:00
Tor Harald Sandve
469ffa2cbe allow for multiple group injection phases 2020-02-11 09:30:19 +01:00
Arne Morten Kvarving
4978e72039 bump required dune version to 2.6
remove compatiblity code with older versions
2020-02-06 16:24:39 +01:00
Tor Harald Sandve
b499180776 only double check the current group constraint at the start of a report step 2020-01-30 11:18:23 +01:00
Tor Harald Sandve
f5c6bafd90 make group constrain check conditional 2020-01-29 14:52:01 +01:00
Tor Harald Sandve
df6774c45c froze wellState at nupcol iterations 2019-12-18 14:37:16 +01:00
Atgeirr Flø Rasmussen
bddeaba880 Delete obsolete include directives and functions.
Also make other minor adjustments, in particular moving the function
getCubeDim() from WellsManagerDetail to WellHelpers.hpp.
2019-11-25 10:58:44 +01:00
Atgeirr Flø Rasmussen
87188f5862 Avoid using the Wells struct. 2019-11-25 08:36:18 +01:00
Joakim Hove
fce5d2f369 Rename Well2 -> Well and Group2 -> Group 2019-11-13 23:18:01 +01:00
Markus Blatt
a5506956fb renamed numWells to numLocalWells in BlackoilWellmodel
as this better reflects that it is not the number of wells in
the whole domain but just the one in the part of the domain
stored in the local process.
2019-11-01 15:11:21 +01:00
Tor Harald Sandve
c21428419a support REIN for solvent 2019-10-18 16:08:07 +02:00
Tor Harald Sandve
f71d6c8623 implement proper guiderate support
Tested on simple problems including GUIDERAT
2019-10-18 16:08:07 +02:00
Tor Harald Sandve
53896ffca8 Use well and group controls from opm-common.
This PR remove the usage of well_control_ from opm-core
and instead uses the control classes for wells and groups
from opm-common.
This PR also removes the usage of the group classes from
opm-core.
2019-10-18 16:08:07 +02:00
Robert Kloefkorn
f708286111 [cleanup][Wells] Consequently use SparseMatrixAdapter in addWellContributions. 2019-10-09 10:27:38 +02:00
Arne Morten Kvarving
5599bb6d8c changed: namespace Ewoms -> namespace Opm 2019-09-05 17:14:38 +02:00
Kai Bao
fec9d1feee recovering the interface of function createWellContainer
in BlackoilWellModel, which makes its usage easier.
2019-08-09 10:02:28 +02:00
Arne Morten Kvarving
4d893c35e8 changed: remove unused method BlackoilWellModel::extractLegacyPressure_ 2019-07-08 11:23:55 +02:00
Kai Bao
53b15527c2 fixing warnings under simulator/wells 2019-06-26 09:52:38 +02:00
Atgeirr Flø Rasmussen
5749a7150c Move files out of opm/core/simulator. 2019-06-20 11:00:52 +02:00
Atgeirr Flø Rasmussen
fa016a6008 Moved all remaining files out of opm/autodiff. 2019-06-20 11:00:51 +02:00
Atgeirr Flø Rasmussen
a33cfbf0bc Moved Flow-related classes and files to opm/simulators/flow. 2019-06-20 11:00:51 +02:00
Kai Bao
3dcec6a436 removing StandardWellV 2019-06-13 14:49:04 +02:00
Tor Harald Sandve
613473082f Address PR comments 2019-05-24 16:45:27 +02:00
Tor Harald Sandve
821794b0ad Add well potential output to MSW
The common part is moved to the well interface class
This commit also adds iterations to the standardWells
well potential calculations to improve the results
2019-05-23 15:32:48 +02:00
Joakim Hove
b6840db604 Use new well implementation Well2 from opm-common 2019-05-22 21:47:45 +02:00
Atgeirr Flø Rasmussen
c17adf788f Moved files to opm/simulators/ subdirs. 2019-05-08 12:58:19 +02:00