Commit Graph

1275 Commits

Author SHA1 Message Date
Tor Harald Sandve
519b5dd8cc
Merge pull request #3810 from totto82/refactor_bhpFromThpLimit_1
Refactor bhp from thp limit
2022-03-22 13:57:52 +01:00
Tor Harald Sandve
c067e5fafd
Merge pull request #3834 from totto82/avoid_closing
Handle case where bhp target is violated
2022-03-22 11:56:21 +01:00
Tor Harald Sandve
7d5a0a74eb Handle case where bhp target is violated 2022-03-21 09:52:41 +01:00
Kai Bao
e05a0b276e fixing the scaling of segment rates
when initial segment rate is zero.
2022-03-14 14:01:24 +01:00
Kai Bao
ccfd4152d3 using addition to update segment pressure
when bhp is changed. It is much safer and more reasonable.

using multiplication is more likely to result in dramatic values.
2022-03-09 14:23:59 +01:00
Håkon Hægland
3cf181b2ee Throw exception instead of using assert
Throw an exception if two-phase gas lift optimization is used for
other phases than oil and water.
2022-03-07 15:58:11 +01:00
Håkon Hægland
438a712e54 Gas lift optimization for two-phase oil-water.
Add gas lift optimization support for two-phase oil-water flow.
2022-03-07 15:19:43 +01:00
Tor Harald Sandve
8cfbe1d791
Merge pull request #3816 from totto82/control_well_testing
Set well control to thp or bhp in well testing
2022-02-23 10:36:17 +01:00
Markus Blatt
1d44a4beac
Merge pull request #3817 from bska/fix-pedantic-warning
Remove Extraneous Semicolon
2022-02-18 10:10:44 +01:00
Bård Skaflestad
e1d55d4017 Remove Extraneous Semicolon
This generates warnings when using GCC's "-Wpedantic" option.
2022-02-17 23:13:31 +01:00
Tor Harald Sandve
b931c5ef97 Check if guiderate is violated
If guiderate is violated change to group controll.
Note that a factor 1.01 is added to minimize oscilations.
Fix missing  multiplication with group efficiency when accumulating guiderates
2022-02-17 10:41:43 +01:00
Tor Harald Sandve
d8934ea7a9 Set well control to thp or bhp in well testing 2022-02-17 09:01:32 +01:00
Tor Harald Sandve
418880730e cleanup2 2022-02-15 12:43:58 +01:00
Tor Harald Sandve
cb99a2fc74 check also the validity of the iterated solution 2022-02-15 12:39:42 +01:00
Tor Harald Sandve
650416c647 cleanup 2022-02-15 12:39:42 +01:00
Tor Harald Sandve
e0573e99b1 iterate in computeBhpAtThpLimitProdWithAlq if no solution or potentials are negative 2022-02-15 12:39:42 +01:00
Tor Harald Sandve
ec08f80405 Refactor out the solving algorithm of bhp from thp via VFP to make it usable for injectors 2022-02-15 12:39:42 +01:00
Tor Harald Sandve
1001d35418 Move computeBhpAtThpLimitProd MSW code to common and apply it for both MSW and STW
The computeBhpAtThpLimitProd for MSW is faster and sufficiently robust and should also be used by STW
2022-02-15 12:39:42 +01:00
Håkon Hægland
c7aa43a82b Rename some methods and variables.
Renames some methods and variables to reflect that the well is no
longer necessarily a StandardWell. It can be either a MultisegmentWell
or a StandardWell. This should avoid confusion about the nature of
the variable.
2022-02-15 10:21:09 +01:00
Håkon Hægland
54160827de Add gaslift optimization support for MSW.
Implements gas lift optimization support for multisegmented wells (MSW).
2022-02-14 21:38:50 +01:00
Tor Harald Sandve
0c8d0764d6 update well potensials in well state along with alq and update guide rates accordingly 2022-02-08 15:46:08 +01:00
Tor Harald Sandve
bb99d1437b reduce alq when alq + gas production target is violated 2022-02-03 12:11:03 +01:00
Tor Harald Sandve
0b923e505a Add support for maximum total gas (alq + gas rate) in GLIFTOPT
Dont increase gaslift if the groups alq + gas production rate is above the given target
2022-02-02 10:54:32 +01:00
Tor Harald Sandve
009134d037 Limit well rates to honor group rates
If a well is under a group that is limited by a target, it should use as little gaslift as possible.
The reduction algorithm will reduce the gaslift of the well as long as the groups potential is above the groups target.
2022-02-02 10:30:48 +01:00
Håkon Hægland
65c323e1a4 Replace assert with warning.
Replace assert with warning when group rates exceeds target.
2022-01-31 01:52:36 +01:00
Håkon Hægland
8810fa65af Cleanup code in GasLiftSingleWellGeneric
Introduces two new data types BasicRates and LimitedRates to capture
oil, gas, and water rates, and whether they have been limited by well
or group targets. This reduces the number of variables that are passed
to and returned from various methods and thus makes the code easier to
read.
2022-01-31 01:39:20 +01:00
Håkon Hægland
a14ed57921 Silence reorder warning in GasLiftCommon 2022-01-25 13:31:49 +01:00
Håkon Hægland
4970b0641e Improve debugging tools in gaslift code.
Introduces a gaslift debugging variable in ALQState in WellState. This
variable will persist between timesteps in contrast to when debugging
variables are defined in GasLiftSingleWell, GasLiftGroupState, or GasLiftStage2.

Currently only an integer variable debug_counter is added to ALQState,
which can be used as follows: First debugging is switched on globally
for BlackOilWellModel, GasLiftSingleWell, GasLiftGroupState, and
GasLiftStage2 by setting glift_debug to a true value in BlackOilWellModelGeneric.
Then, the following debugging code can be added to e.g. one of
GasLiftSingleWell, GasLiftGroupState, or GasLiftStage2 :

    auto count = debugUpdateGlobalCounter_();
    if (count == some_integer) {
        displayDebugMessage_("stop here");
    }

Here, the integer "some_integer" is determined typically by looking at
the debugging output of a previous run. This can be done since the
call to debugUpdateGlobalCounter_() will print out the current value
of the counter and then increment the counter by one. And it will be
easy to recognize these values in the debug ouput. If you find a place
in the output that looks suspect, just take a note of the counter
value in the output around that point and insert the value for
"some_integer", then after recompiling the code with the desired value
for "some_integer", it is now easy to set a breakpoint in GDB at the
line

    displayDebugMessage_("stop here").

shown in the above snippet. This should improve the ability to quickly
to set a breakpoint in GDB around at a given time and point in the simulation.
2022-01-23 20:37:26 +01:00
Tor Harald Sandve
2fdff5c1e4
Merge pull request #3758 from totto82/fixAssertInWECON
Handle case where no completions have ratio above the limit while the well has
2022-01-21 12:31:11 +01:00
Tor Harald Sandve
6fee9173c0 Remove assert in ratio check for completions
Handle special cases with injection or trivial completion rates and all completions have ratio below the limit while the well has
above
2022-01-21 10:51:40 +01:00
Bård Skaflestad
9fc9f5421c
Merge pull request #3771 from totto82/fixUpdateGR
Update guiderates after with new rates from newly opened wells
2022-01-21 10:33:00 +01:00
Tor Harald Sandve
d1c2032e73 Update guiderates after with new rates from newly opened wells 2022-01-21 09:15:00 +01:00
Atgeirr Flø Rasmussen
357ba55de5
Merge pull request #3773 from GitPaean/return_zero_thp_zero_rate_inj
return zero thp value for extremely small injection rate
2022-01-20 14:49:25 +01:00
Tor Harald Sandve
a57f92527f
Merge pull request #3777 from totto82/support_min_wait_glift
support none trivial item 3 in LIFTOPT.
2022-01-19 14:58:50 +01:00
Atgeirr Flø Rasmussen
9f7d4f2fc2
Merge pull request #3760 from GitPaean/thp_fixing_model_2
fixing the failure that bhp could not be calculated with thp limit
2022-01-19 12:48:39 +01:00
Tor Harald Sandve
c3571c50a3 support none trivial item 3 in LIFTOPT. i.e. not optimize gaslift every timestep 2022-01-19 10:14:47 +01:00
Kai Bao
913ad21733 return zero thp value for extremely small injection rate
it is a finding from one of the test case.
2022-01-18 10:12:20 +01:00
Bård Skaflestad
3317f10c4a
Merge pull request #3729 from goncalvesmachadoc/gaswater_brine
allow for gas-water + brine
2022-01-12 12:31:34 +01:00
Bård Skaflestad
abf92eed52 Accumulate Dissolved Gas and Vaporized Oil Flow Rates Across Ranks
This is needed to get consistent estimates for the summary vectors

  * {F,G,W}OP{R,T}{F,S} -- Free/Vaporized Oil Production
  * {F,G,W}GP{R,T}{F,S} -- Free/Dissolved Gas Production

in the case of distributed wells.

Thanks to [at]blattms for the suggested fix.
2022-01-10 14:14:39 +01:00
Kai Bao
2b9b6e5155 addressing reviewing comments for PR#3760 2022-01-10 11:33:11 +01:00
Kai Bao
dec3100247 fixing a bug in funcion bisectBracket 2022-01-09 00:21:31 +01:00
Kai Bao
3b7e62979c refactoring to shorten the function computeBhpAtThpLimitProd
better readibility hopefully.
2022-01-07 15:49:48 +01:00
Kai Bao
5824acbf92 making bruteforce bracket as a function
for better readbility.
2022-01-07 15:13:33 +01:00
Kai Bao
3273f310e3 prototyping the brute force for bracketing bhp
to fix the situation the existing approach fails.
2022-01-07 14:32:16 +01:00
Tor Harald Sandve
3e4e62bc4f
Merge pull request #3751 from hakonhagland/glift_swg_fx3
Refactor some methods in `GasLiftSingleWellGeneric.cpp` (part 2)
2022-01-03 14:14:15 +01:00
Joakim Hove
6b92443cb4 Downstream filesystem reorganisation in opm-common 2022-01-02 14:33:34 +01:00
Håkon Hægland
4bdf7c1b58 Refactor methods getXyzRateWithLimit_()
Refactors getOilRateWithLimit_(), getGasRateWithLimit_(), and
getWaterRateWithLimit_() in GasLiftSingleWellGeneric.cpp. The
common part of the methods is split out into a new method called
getRateWithLimit_(). The purpose of the refactorization is to reduce
reptetive code and make the code easier to maintain.
2021-12-22 10:45:31 +01:00
Håkon Hægland
f28b906782 Made some methods in GasLiftGroupInfo const
This is in agreement with C++ Core Guidelines. A member function should
be marked const unless it changes the object’s observable state. This
gives a more precise statement of design intent, better readability, more
errors caught by the compiler, and sometimes more optimization opportunities.
2021-12-21 23:24:58 +01:00
Håkon Hægland
11ad879472 Make parameters to getLiquidRateWithGroupLimit_() const
To improve readability, we make the parameters of
getLiquidRateWithGroupLimit_() const as discussed in
https://github.com/OPM/opm-simulators/pull/3748
2021-12-20 23:19:40 +01:00
Håkon Hægland
837f33e679 Refactor some methods in GasLiftSingleWellGeneric.
Refactor getOilRateWithGroupLimit_(), getGasRateWithGroupLimit_(),
getWaterRateWithGroupLimit_(), and getLiquidRateWithGroupLimit_() into
a single generic method called getRateWithGroupLimit_().
2021-12-20 23:08:31 +01:00