Merge pull request #3135 from hakonhagland/glift_tests

Adds a simple test case for gas lift optimization
This commit is contained in:
Tor Harald Sandve
2021-04-06 08:34:33 +02:00
committed by GitHub
13 changed files with 51763 additions and 20 deletions

View File

@@ -94,6 +94,7 @@ list (APPEND TEST_SOURCE_FILES
tests/test_wellprodindexcalculator.cpp
tests/test_wellstatefullyimplicitblackoil.cpp
tests/test_parallelwellinfo.cpp
tests/test_glift1.cpp
)
if(MPI_FOUND)
@@ -138,6 +139,16 @@ list (APPEND TEST_DATA_FILES
tests/rhs3rep.txt
tests/options_flexiblesolver.json
tests/options_flexiblesolver_simple.json
tests/GLIFT1.DATA
tests/include/flowl_b_vfp.ecl
tests/include/flowl_c_vfp.ecl
tests/include/permx_model5.grdecl
tests/include/pvt_live_oil_dgas.ecl
tests/include/relperm.inc
tests/include/rock.inc
tests/include/summary.inc
tests/include/test1_20x30x10.grdecl
tests/include/well_vfp.ecl
)

View File

@@ -384,7 +384,19 @@ namespace Opm {
double wellPI(const int well_index) const;
double wellPI(const std::string& well_name) const;
void updatePerforationIntensiveQuantities();
// it should be able to go to prepareTimeStep(), however, the updateWellControls() and initPrimaryVariablesEvaluation()
// makes it a little more difficult. unless we introduce if (iterationIdx != 0) to avoid doing the above functions
// twice at the beginning of the time step
/// Calculating the explict quantities used in the well calculation. By explicit, we mean they are cacluated
/// at the beginning of the time step and no derivatives are included in these quantities
void calculateExplicitQuantities(Opm::DeferredLogger& deferred_logger) const;
// some preparation work, mostly related to group control and RESV,
// at the beginning of each time step (Not report step)
void prepareTimeStep(Opm::DeferredLogger& deferred_logger);
void initPrimaryVariablesEvaluation() const;
void updateWellControls(Opm::DeferredLogger& deferred_logger, const bool checkGroupControls);
WellInterfacePtr getWell(const std::string& well_name) const;
protected:
Simulator& ebosSimulator_;
@@ -502,8 +514,6 @@ namespace Opm {
// xw to update Well State
void recoverWellSolutionAndUpdateWellState(const BVector& x);
void updateWellControls(Opm::DeferredLogger& deferred_logger, const bool checkGroupControls);
void updateAndCommunicateGroupData();
void updateNetworkPressures();
@@ -526,15 +536,6 @@ namespace Opm {
void calculateProductivityIndexValues(DeferredLogger& deferred_logger);
// it should be able to go to prepareTimeStep(), however, the updateWellControls() and initPrimaryVariablesEvaluation()
// makes it a little more difficult. unless we introduce if (iterationIdx != 0) to avoid doing the above functions
// twice at the beginning of the time step
/// Calculating the explict quantities used in the well calculation. By explicit, we mean they are cacluated
/// at the beginning of the time step and no derivatives are included in these quantities
void calculateExplicitQuantities(Opm::DeferredLogger& deferred_logger) const;
void initPrimaryVariablesEvaluation() const;
// The number of components in the model.
int numComponents() const;
@@ -554,10 +555,6 @@ namespace Opm {
GLiftProdWells &prod_wells, GLiftOptWells &glift_wells,
GLiftWellStateMap &map);
// some preparation work, mostly related to group control and RESV,
// at the beginning of each time step (Not report step)
void prepareTimeStep(Opm::DeferredLogger& deferred_logger);
void extractLegacyCellPvtRegionIndex_();
void extractLegacyDepth_();
@@ -573,8 +570,6 @@ namespace Opm {
/// upate the wellTestState related to economic limits
void updateWellTestState(const double& simulationTime, WellTestState& wellTestState) const;
void updatePerforationIntensiveQuantities();
void wellTesting(const int timeStepIdx, const double simulationTime, Opm::DeferredLogger& deferred_logger);
// convert well data from opm-common to well state from opm-core
@@ -603,8 +598,6 @@ namespace Opm {
void actionOnBrokenConstraints(const Group& group, const Group::InjectionCMode& newControl, const Phase& topUpPhase, Opm::DeferredLogger& deferred_logger);
WellInterfacePtr getWell(const std::string& well_name) const;
void updateWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, const WellStateFullyImplicitBlackoil& wellState);
void setWsolvent(const Group& group, const Schedule& schedule, const int reportStepIdx, double wsolvent);

318
tests/GLIFT1.DATA Normal file
View File

@@ -0,0 +1,318 @@
-- This reservoir simulation deck is made available under the Open Database
-- License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in
-- individual contents of the database are licensed under the Database Contents
-- License: http://opendatacommons.org/licenses/dbcl/1.0/
-- Copyright (C) 2020 Equinor
-- This model is based on TRAN-modified Base case model 5
-- This model tests well gas lift optimization with keywords
-- GCONINJE, LIFOPT and WLIFTOPT
------------------------------------------------------------------------------------------------
RUNSPEC
------------------------------------------------------------------------------------------------
DIMENS
20 30 10 /
OIL
WATER
GAS
DISGAS
--VAPOIL
METRIC
START
01 'JAN' 2020 /
--
GRIDOPTS
'YES' 0 /
EQLDIMS
1 100 25 /
REGDIMS
-- max. ntfip nmfipr max. nrfreg max. ntfreg
3 2 1* 2 /
--
TABDIMS
--ntsfun ntpvt max.nssfun max.nppvt max.ntfip max.nrpvt
1 1 150 60 3 60 /
--
WELLDIMS
--max.well max.con/well max.grup max.w/grup
10 15 9 10 /
--FLOW THP WCT GCT ALQ VFP
VFPPDIMS
22 13 10 13 13 50 /
UNIFIN
UNIFOUT
------------------------------------------------------------------------------------------------
GRID
------------------------------------------------------------------------------------------------
--
NEWTRAN
--
GRIDFILE
0 1 /
--
GRIDUNIT
METRES /
--
INIT
INCLUDE
'include/test1_20x30x10.grdecl' /
INCLUDE
'include/permx_model5.grdecl' /
PORO
6000*0.28 /
COPY
PERMX PERMY /
PERMX PERMZ /
/
MULTIPLY
PERMZ 0.1 /
/
RPTGRID
'ALLNNC' /
EQUALS
'MULTY' 0.01 1 20 14 14 1 10 /
/
------------------------------------------------------------------------------------------------
EDIT
------------------------------------------------------------------------------------------------
-- actual maximum value is 35719 in this case
-- a max max value of 32000 should affect 76 cells
-- there are in other words 108 cells
-- mean value without maxvalue tranz: 13351
-- mean value with maxvalue tranz: 13326
MAXVALUE
TRANZ 32000 /
/
------------------------------------------------------------------------------------------------
PROPS
------------------------------------------------------------------------------------------------
NOECHO
INCLUDE
'include/pvt_live_oil_dgas.ecl' /
INCLUDE
'include/rock.inc' /
INCLUDE
'include/relperm.inc' /
------------------------------------------------------------------------------------------------
REGIONS
------------------------------------------------------------------------------------------------
EQLNUM
6000*1 /
EQUALS
FIPNUM 1 1 20 1 14 1 10 /
FIPNUM 2 1 20 15 30 1 10 /
/
SATNUM
6000*1 /
-- custom region
FIPABC
2000*1 2000*2 2000*3 /
------------------------------------------------------------------------------------------------
SOLUTION
------------------------------------------------------------------------------------------------
RPTRST
'BASIC = 2' 'PBPD' /
EQUIL
-- Datum P woc Pc goc Pc Rsvd Rvvd
2000.00 195.0 2070 0.0 500.00 0.0 1 0 0 /
PBVD
2000.00 75.00
2150.00 75.00 /
------------------------------------------------------------------------------------------------
SUMMARY
------------------------------------------------------------------------------------------------
INCLUDE
'include/summary.inc' /
------------------------------------------------------------------------------------------------
SCHEDULE
------------------------------------------------------------------------------------------------
--
-- FIELD
-- |
-- PLAT-A
-- ---------------+---------------------
-- | |
-- M5S M5N
-- ---------+---------- -----+-------
-- | | | |
-- B1 G1 C1 F1
-- ----+------ ---+--- ---+--- ---+---
-- | | | | | | | | |
-- B-1H B-2H B-3H G-3H G-4H C-1H C-2H F-1H F-2H
--
TUNING
0.5 1 /
/
2* 50 1* 20 /
--NUPCOL
-- 4 /
GRUPTREE
'PROD' 'FIELD' /
'M5S' 'PLAT-A' /
'M5N' 'PLAT-A' /
'F1' 'M5N' /
'B1' 'M5S' /
'G1' 'M5S' /
/
RPTRST
'BASIC=2' /
INCLUDE
'include/well_vfp.ecl' /
INCLUDE
'include/flowl_b_vfp.ecl' /
INCLUDE
'include/flowl_c_vfp.ecl' /
WELSPECS
--WELL GROUP IHEEL JHEEL DREF PHASE DRAD INFEQ SIINS XFLOW PRTAB DENS
'B-1H' 'B1' 11 3 1* OIL 1* 1* SHUT 1* 1* 1* /
/
WELSPECS
'F-1H' 'F1' 19 4 1* WATER 1* 1* SHUT 1* 1* 1* /
'F-2H' 'F1' 19 12 1* WATER 1* 1* SHUT 1* 1* 1* /
'G-3H' 'G1' 19 21 1* WATER 1* 1* SHUT 1* 1* 1* /
'G-4H' 'G1' 19 25 1* WATER 1* 1* SHUT 1* 1* 1* /
/
COMPDAT
--WELL I J K1 K2 OP/SH SATN TRAN WBDIA KH SKIN DFACT DIR PEQVR
'B-1H' 11 3 1 5 OPEN 1* 1* 0.216 1* 0 1* Z 1* /
/
COMPDAT
'F-1H' 19 4 6 10 OPEN 1* 1* 0.216 1* 0 1* Z 1* /
'F-2H' 19 12 6 10 OPEN 1* 1* 0.216 1* 0 1* Z 1* /
'G-3H' 19 21 6 10 OPEN 1* 1* 0.216 1* 0 1* Z 1* /
'G-4H' 19 25 6 10 OPEN 1* 1* 0.216 1* 0 1* Z 1* /
/
WCONPROD
-- Well_name Status Ctrl Orate Wrate Grate Lrate RFV FBHP WHP VFP Glift
'B-1H' OPEN ORAT 1500.0 1* 1* 3000.0 1* 100.0 30 1 1* /
/
GCONINJE
'FIELD' 'WATER' 'VREP' 3* 1.020 'NO' 5* /
/
WCONINJE
-- Well_name Type Status Ctrl SRate1 Rrate BHP THP VFP
'F-1H' WATER OPEN GRUP 4000 1* 225.0 1* 1* /
'F-2H' WATER OPEN GRUP 4000 1* 225.0 1* 1* /
'G-3H' WATER OPEN GRUP 4000 1* 225.0 1* 1* /
'G-4H' WATER OPEN GRUP 4000 1* 225.0 1* 1* /
/
-- Turns on gas lift optimization
LIFTOPT
12500 5E-3 0.0 YES /
-- wells available for gas lift
-- minimum gas lift rate, enough to keep well flowing
WLIFTOPT
'B-1H' YES 150000 1.01 -1.0 /
/
TSTEP
0.5 /
DATES
1 FEB 2020 /
/
DATES
1 MAR 2020 /
/
DATES
1 APR 2020 /
1 MAY 2020 /
1 JUN 2020 /
1 JLY 2020 /
1 AUG 2020 /
/
END

12986
tests/include/flowl_b_vfp.ecl Normal file

File diff suppressed because it is too large Load Diff

12986
tests/include/flowl_c_vfp.ecl Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,246 @@
-- This reservoir simulation deck is made available under the Open Database
-- License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in
-- individual contents of the database are licensed under the Database Contents
-- License: http://opendatacommons.org/licenses/dbcl/1.0/
-- Copyright (C) 2020 Equinor
DENSITY
-- OilDens WaterDens GasDens
-- kg/m3 kg/m3 kg/m3
924.1 1026.0 1.03446 /
--
--Density of added gas at Std Conditions 0.000000 kg/m3
--
PVTW
-- RefPres Bw Cw Vw dVw
-- bara rm3/m3 1/bara cP 1/bara
79.0 1.02643 0.37876E-04 0.39831 0.74714E-04 /
PVTO
-- Table number: 1
3.9140 10.000 1.102358 2.8625
15.000 1.101766 2.9007
25.000 1.100611 2.9695
45.000 1.098386 3.0960
65.000 1.096264 3.2159
84.000 1.094340 3.3266
100.000 1.092790 3.4196
115.000 1.091386 3.5061
145.000 1.088703 3.6800
175.000 1.086197 3.8558
205.000 1.083836 4.0325
235.000 1.081610 4.2138
265.000 1.079499 4.3980
305.000 1.076868 4.6491
355.000 1.073821 4.9755
405.000 1.071023 5.3150
455.000 1.068434 5.6693
505.000 1.066021 6.0404
555.000 1.063785 6.4282
605.000 1.061694 6.8346 /
7.0500 15.000 1.112540 2.6589
25.000 1.111313 2.7221
45.000 1.108952 2.8374
65.000 1.106706 2.9472
84.000 1.104678 3.0504
100.000 1.103034 3.1350
115.000 1.101547 3.2150
145.000 1.098718 3.3740
175.000 1.096077 3.5349
205.000 1.093581 3.6977
235.000 1.091241 3.8632
265.000 1.089026 4.0316
305.000 1.086259 4.2622
355.000 1.083056 4.5607
405.000 1.080113 4.8723
455.000 1.077398 5.1968
505.000 1.074871 5.5354
555.000 1.072531 5.8906
605.000 1.070337 6.2617 /
12.4430 25.000 1.129045 2.4329
45.000 1.126476 2.5370
65.000 1.124032 2.6356
84.000 1.121827 2.7277
100.000 1.120049 2.8040
115.000 1.118437 2.8756
145.000 1.115379 3.0188
175.000 1.112519 3.1639
205.000 1.109836 3.3089
235.000 1.107298 3.4577
265.000 1.104917 3.6084
305.000 1.101942 3.8149
355.000 1.098510 4.0818
405.000 1.095349 4.3589
455.000 1.092437 4.6491
505.000 1.089733 4.9513
555.000 1.087226 5.2675
605.000 1.084886 5.5986 /
22.0220 45.000 1.156844 2.1297
65.000 1.154036 2.2143
84.000 1.151498 2.2934
100.000 1.149460 2.3594
115.000 1.147619 2.4208
145.000 1.144135 2.5445
175.000 1.140880 2.6682
205.000 1.137822 2.7928
235.000 1.134962 2.9183
265.000 1.132269 3.0467
305.000 1.128910 3.2215
355.000 1.125041 3.4466
405.000 1.121494 3.6800
455.000 1.118229 3.9227
505.000 1.115213 4.1766
555.000 1.112415 4.4408
605.000 1.109805 4.7170 /
30.9290 65.000 1.181544 1.8870
84.000 1.178674 1.9567
100.000 1.176375 2.0153
115.000 1.174306 2.0693
145.000 1.170374 2.1790
175.000 1.166724 2.2887
205.000 1.163313 2.3994
235.000 1.160120 2.5110
265.000 1.157114 2.6235
305.000 1.153381 2.7761
355.000 1.149086 2.9723
405.000 1.145154 3.1732
455.000 1.141546 3.3815
505.000 1.138218 3.5982
555.000 1.135129 3.8232
605.000 1.132258 4.0576 /
39.1850 84.000 1.203821 1.6703
100.000 1.201252 1.7224
115.000 1.198943 1.7707
145.000 1.194586 1.8674
175.000 1.190540 1.9651
205.000 1.186765 2.0637
235.000 1.183239 2.1623
265.000 1.179922 2.2618
305.000 1.175814 2.3966
355.000 1.171102 2.5668
405.000 1.166807 2.7416
455.000 1.162866 2.9211
505.000 1.159226 3.1062
555.000 1.155866 3.2969
605.000 1.152736 3.4949 /
48.3540 100.000 1.230434 1.4071
115.000 1.227834 1.4471
145.000 1.222946 1.5261
175.000 1.218422 1.6061
205.000 1.214221 1.6861
235.000 1.210290 1.7679
265.000 1.206618 1.8488
305.000 1.202063 1.9586
355.000 1.196863 2.0962
405.000 1.192121 2.2367
455.000 1.187784 2.3789
505.000 1.183790 2.5240
555.000 1.180098 2.6728
605.000 1.176677 2.8244 /
57.5250 115.000 1.257038 1.2109
145.000 1.251588 1.2769
175.000 1.246565 1.3420
205.000 1.241895 1.4080
235.000 1.237548 1.4750
265.000 1.233492 1.5410
305.000 1.228479 1.6312
355.000 1.222759 1.7438
405.000 1.217559 1.8563
455.000 1.212806 1.9697
505.000 1.208449 2.0851
555.000 1.204424 2.1995
605.000 1.200701 2.3166 /
77.6080 145.000 1.315288 0.9216
175.000 1.309038 0.9681
205.000 1.303276 1.0146
235.000 1.297941 1.0611
265.000 1.292980 1.1086
305.000 1.286875 1.1699
355.000 1.279949 1.2481
405.000 1.273688 1.3253
455.000 1.267989 1.4024
505.000 1.262778 1.4778
555.000 1.257984 1.5531
605.000 1.253554 1.6368 /
100.2200 175.000 1.380787 0.7152
205.000 1.373642 0.7496
235.000 1.367059 0.7840
265.000 1.360965 0.8184
305.000 1.353508 0.8640
355.000 1.345094 0.9216
405.000 1.337534 0.9774
455.000 1.330690 1.0342
505.000 1.324450 1.0900
555.000 1.318741 1.1458
605.000 1.313478 1.2006 /
125.6310 205.000 1.454242 0.5515
235.000 1.446089 0.5766
265.000 1.438580 0.6008
305.000 1.429449 0.6352
355.000 1.419215 0.6761
405.000 1.410063 0.7180
455.000 1.401826 0.7598
505.000 1.394359 0.8007
555.000 1.387537 0.8417
605.000 1.381286 0.8826 /
154.1310 235.000 1.536392 0.4659
265.000 1.527105 0.4845
305.000 1.515894 0.5106
355.000 1.503403 0.5441
405.000 1.492327 0.5766
455.000 1.482406 0.6110
505.000 1.473451 0.6445
555.000 1.465308 0.6780
605.000 1.457872 0.7115 /
186.0330 265.000 1.627974 0.3832
305.000 1.614163 0.4008
355.000 1.598906 0.4222
405.000 1.585470 0.4445
455.000 1.573510 0.4669
505.000 1.562766 0.4892
555.000 1.553053 0.5115
605.000 1.544202 0.5329 /
234.4690 305.000 1.766201 0.3097
355.000 1.746243 0.3255
405.000 1.728854 0.3413
455.000 1.713504 0.3571
505.000 1.699828 0.3720
555.000 1.687525 0.3869
605.000 1.676397 0.4018 /
/
PVDG
-- Table number: 1
10.0000 0.266161 0.0108
15.0000 0.127259 0.0116
25.0000 0.062022 0.0123
45.0000 0.030190 0.0131
65.0000 0.019752 0.0137
84.0000 0.014799 0.0144
100.0000 0.012136 0.0149
115.0000 0.010358 0.0155
145.0000 0.007993 0.0170
175.0000 0.006524 0.0191
205.0000 0.005556 0.0218
235.0000 0.004901 0.0254
265.0000 0.004461 0.0301
305.0000 0.004112 0.0388
355.0000 0.003966 0.0568
405.0000 0.003850 0.0884
455.0000 0.003763 0.1363
505.0000 0.003699 0.1746
/

96
tests/include/relperm.inc Normal file
View File

@@ -0,0 +1,96 @@
-- This reservoir simulation deck is made available under the Open Database
-- License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in
-- individual contents of the database are licensed under the Database Contents
-- License: http://opendatacommons.org/licenses/dbcl/1.0/
-- Copyright (C) 2020 Equinor
SWOF
-- SATNUM: 1
-- Sw Krw Krow Pcow
0.05000000 0.00000000 1.00000000 1.21172000
0.07375000 0.00000546 0.95901480 0.54995750
0.09750000 0.00004330 0.90776360 0.31181800
0.12125000 0.00014674 0.85177540 0.20020180
0.14500000 0.00035100 0.79308750 0.13917750
0.16875000 0.00069387 0.73313410 0.10225280
0.19250000 0.00121609 0.67307100 0.07824229
0.21625000 0.00196163 0.61386090 0.06176574
0.24000000 0.00297812 0.55630150 0.04997649
0.26375000 0.00431719 0.50103630 0.04125442
0.28750000 0.00603480 0.44856280 0.03462279
0.31125000 0.00819172 0.39924270 0.02946443
0.33500000 0.01085385 0.35331370 0.02537398
0.35875000 0.01409272 0.31090520 0.02207633
0.38250000 0.01798590 0.27205330 0.01937950
0.40625000 0.02261746 0.23671830 0.01714620
0.43000000 0.02807848 0.20480000 0.01527620
0.45375000 0.03446755 0.17615290 0.01369492
0.47750000 0.04189128 0.15059890 0.01234598
0.50125000 0.05046489 0.12793860 0.01118608
0.52500000 0.06031276 0.10796080 0.01018156
0.54875000 0.07156914 0.09044951 0.00930591
0.57250000 0.08437884 0.07519013 0.00853805
0.59625000 0.09889809 0.06197354 0.00786102
0.62000000 0.11529560 0.05059922 0.00726107
0.64375000 0.13375370 0.04087730 0.00672696
0.66750000 0.15447050 0.03262981 0.00624941
0.69125000 0.17766170 0.02569132 0.00582073
0.71500000 0.20356450 0.01990901 0.00543449
0.73875000 0.23244230 0.01514253 0.00508527
0.76250000 0.26459230 0.01126342 0.00476851
0.78625000 0.30035680 0.00815454 0.00448031
0.81000000 0.34014130 0.00570925 0.00421734
0.83375000 0.38444350 0.00383060 0.00397675
0.85750000 0.43390330 0.00243042 0.00375609
0.88125000 0.48939050 0.00142840 0.00355320
0.90070710 0.54020970 0.00085263 0.00339893
0.92016420 0.59696580 0.00045739 0.00325444
0.94820710 0.69285860 0.00013490 0.00306180
0.97625000 0.81657620 0.00001540 0.00288569
1.00000000 1.00000000 0.00000000 0.00274810
/
SGOF
-- SATNUM: 1
-- Sg Krg Krog Pcog
0.00000000 0.00000000 1.00000000 0
0.02500000 0.00102100 0.95689900 0
0.05000000 0.00353500 0.90699300 0
0.07500000 0.00741100 0.85241200 0
0.10000000 0.01265000 0.79417700 0
0.12500000 0.01929100 0.73327900 0
0.15000000 0.02739000 0.67076700 0
0.17500000 0.03701400 0.60772400 0
0.20000000 0.04823600 0.54523500 0
0.22500000 0.06113300 0.48432600 0
0.25000000 0.07578100 0.42591500 0
0.27500000 0.09225900 0.37077600 0
0.30000000 0.11063700 0.31950600 0
0.32500000 0.13098300 0.27252000 0
0.35000000 0.15335400 0.23005100 0
0.37500000 0.17779600 0.19216700 0
0.40000000 0.20434000 0.15880000 0
0.42500000 0.23299500 0.12976600 0
0.45000000 0.26375100 0.10480100 0
0.47500000 0.29656900 0.08358500 0
0.50000000 0.33138200 0.06576600 0
0.52500000 0.36808400 0.05098000 0
0.55000000 0.40653600 0.03886500 0
0.57500000 0.44655400 0.02907300 0
0.60000000 0.48791300 0.02127700 0
0.62500000 0.53034000 0.01517600 0
0.65000000 0.57351600 0.01049400 0
0.67500000 0.61707400 0.00698600 0
0.70000000 0.66059600 0.00443300 0
0.72500000 0.70361500 0.00264300 0
0.75000000 0.74560900 0.00144800 0
0.77500000 0.78598600 0.00070300 0
0.80000000 0.82406400 0.00028200 0
0.82500000 0.85899300 0.00008100 0
0.85000000 0.88953900 0.00001100 0
0.87500000 0.91290400 0.00000000 0
0.90000000 0.91540400 0.00000000 0
0.95000000 1.00000000 0.00000000 0
/

15
tests/include/rock.inc Normal file
View File

@@ -0,0 +1,15 @@
-- This reservoir simulation deck is made available under the Open Database
-- License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in
-- individual contents of the database are licensed under the Database Contents
-- License: http://opendatacommons.org/licenses/dbcl/1.0/
-- Copyright (C) 2020 Equinor
-- This file is one of the include files for model2
-- ROCK COMPRESSIBILITY
--
-- REF.PRES. COMPR.
ROCK
277.0 4.22425e-05 /

314
tests/include/summary.inc Normal file
View File

@@ -0,0 +1,314 @@
-- This reservoir simulation deck is made available under the Open Database
-- License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in
-- individual contents of the database are licensed under the Database Contents
-- License: http://opendatacommons.org/licenses/dbcl/1.0/
-- Copyright (C) 2020 Equinor
-- This file is one of the include files for model2
-- Summary file for the base case, specific version
-- Field Data
-----------------
-- Production rates
FPR
FOPR
FWPR
FGPR
FLPR
FOPRH
FWPRH
FGPRH
FWIR
FVPR
FVIR
-- Production cumulatives
FOPT
FWPT
FGPT
FLPT
FVPT
FVIT
-- Production ratios
FGOR
FGORH
FWCT
FWCTH
FMCTP
FMCTW
FMCTG
-- Injection rates
-- Injection cumulatives
-- Pressure and fluid
-- In-place volumes
-- Number of wells
FGLIR
-----------------
-- Region data
-----------------
RPR
1 2 /
ROIP
1 2 /
RRPV
1 2 /
RHPV
1 2 /
RWIP
1 2 /
ROE
1 2 /
ROEW
1 2 /
ROPT
1 2 /
RWPT
1 2 /
RWIT
1 2 /
-- custom region ABC
RPR__ABC
1 2 3 /
ROIP_ABC
1 2 3 /
RRPV_ABC
1 2 3 /
RHPV_ABC
1 2 3 /
RWIP_ABC
1 2 3 /
ROE__ABC
1 2 3 /
ROEW_ABC
1 2 3 /
ROPT_ABC
1 2 3 /
RWPT_ABC
1 2 3 /
RWIT_ABC
1 2 3 /
-----------------
-- Well Data
-----------------
-- Production rates
WOPR
'B-*' 'C-*' /
WGPR
'B-*' 'C-*' /
WWPR
'B-*' 'C-*' /
WLPR
'B-*' 'C-*' /
WOPRH
'B-*' /
WGPRH
'B-*' /
WWPRH
'B-*' /
WGLIR
'B-*' /
-- Production cumulatives
WOPT
'B-*' /
WGPT
'B-*' /
WWPT
'B-*' /
WLPT
'B-*' /
WOPTH
'B-*' /
WGPTH
'B-*' /
WWPTH
'B-*' /
-- Production ratios
WGOR
'B-*' /
WWCT
'B-*' /
WGORH
'B-*' /
WWCTH
'B-*' /
-- Injection Rates
WGIR
'F-*' 'G-*' /
WWIR
'F-*' 'G-*' /
WGIRH
'F-*' 'G-*' /
WWIRH
'F-*' 'G-*' /
-- Pressure
WBHP
/
WTHP
'B-*' /
-- potentials
WGIP
'F-*' 'G-*' /
WWIP
'F-*' 'G-*' /
WOPP
'B-*' /
WGPP
'B-*' /
WWPP
'B-*' /
-- Group data
GOPR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GWPR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GGPR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GLPR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GGOR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GMCTP
'B1' 'M5N' 'M5S' 'PLAT-A' /
GMCTW
'B1' 'M5N' 'M5S' 'PLAT-A' /
GMCTG
'B1' 'M5N' 'M5S' 'PLAT-A' /
GOPGR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GGPGR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GWPGR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GVPGR
'B1' 'M5N' 'M5S' 'PLAT-A' /
GOPT
'B1' 'M5N' 'M5S' 'PLAT-A' /
GWPT
'B1' 'M5N' 'M5S' 'PLAT-A' /
GGPT
'B1' 'M5N' 'M5S' 'PLAT-A' /
GLPT
'B1' 'M5N' 'M5S' 'PLAT-A' /
GWIR
'F1' 'G1' 'M5N' 'M5S' 'PLAT-A' /
GGIR
'F1' 'G1' 'M5N' 'M5S' 'PLAT-A' /
GWIT
'F1' 'G1' 'M5N' 'M5S' 'PLAT-A' /
GGIT
'F1' 'G1' 'M5N' 'M5S' 'PLAT-A' /
GOPP
'B1' 'M5N' 'M5S' 'PLAT-A' /
GGPP
'B1' 'M5N' 'M5S' 'PLAT-A' /
GWPP
'B1' 'M5N' 'M5S' 'PLAT-A' /
GWPI
'B1' 'M5N' 'M5S' 'PLAT-A' /
GGPI
'B1' 'M5N' 'M5S' 'PLAT-A' /
GGLIR
'B1' 'M5N' 'M5S' 'PLAT-A' /

File diff suppressed because it is too large Load Diff

14428
tests/include/well_vfp.ecl Normal file

File diff suppressed because it is too large Load Diff

174
tests/test_glift1.cpp Normal file
View File

@@ -0,0 +1,174 @@
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#include "config.h"
#define BOOST_TEST_MODULE Glift1
#include <opm/models/utils/propertysystem.hh>
#include <opm/models/utils/parametersystem.hh>
#include <ebos/equil/equilibrationhelpers.hh>
#include <ebos/eclproblem.hh>
#include <ebos/ebos.hh>
#include <opm/models/utils/start.hh>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
#include <opm/simulators/utils/DeferredLogger.hpp>
#include <opm/simulators/flow/BlackoilModelEbos.hpp>
#include <opm/simulators/wells/BlackoilWellModel.hpp>
#include <opm/simulators/wells/StandardWell.hpp>
#include <opm/simulators/wells/GasLiftSingleWell.hpp>
//#include <opm/simulators/flow/SimulatorFullyImplicitBlackoilEbos.hpp>
//#include <flow/flow_ebos_blackoil.hpp>
#include <opm/simulators/wells/WellStateFullyImplicitBlackoil.hpp>
/// #include <opm/simulators/flow/Main.hpp>
#if HAVE_DUNE_FEM
#include <dune/fem/misc/mpimanager.hh>
#else
#include <dune/common/parallel/mpihelper.hh>
#endif
#include <exception>
#include <iostream>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include <boost/test/unit_test.hpp>
#include <boost/version.hpp>
#if BOOST_VERSION / 100000 == 1 && BOOST_VERSION / 100 % 1000 < 71
#include <boost/test/floating_point_comparison.hpp>
#else
#include <boost/test/tools/floating_point_comparison.hpp>
#endif
namespace Opm::Properties {
namespace TTag {
struct TestGliftTypeTag {
using InheritsFrom = std::tuple<EbosTypeTag>;
};
}
}
template <class TypeTag>
std::unique_ptr<Opm::GetPropType<TypeTag, Opm::Properties::Simulator>>
initSimulator(const char *filename)
{
using Simulator = Opm::GetPropType<TypeTag, Opm::Properties::Simulator>;
std::string filename_arg = "--ecl-deck-file-name=";
filename_arg += filename;
const char* argv[] = {
"test_equil",
filename_arg.c_str()
};
Opm::setupParameters_<TypeTag>(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/true);
return std::unique_ptr<Simulator>(new Simulator);
}
namespace {
struct GliftFixture {
GliftFixture() {
int argc = boost::unit_test::framework::master_test_suite().argc;
char** argv = boost::unit_test::framework::master_test_suite().argv;
#if HAVE_DUNE_FEM
Dune::Fem::MPIManager::initialize(argc, argv);
#else
Dune::MPIHelper::instance(argc, argv);
#endif
using TypeTag = Opm::Properties::TTag::EclFlowProblem;
Opm::registerAllParameters_<TypeTag>();
}
};
}
BOOST_GLOBAL_FIXTURE(GliftFixture);
BOOST_AUTO_TEST_CASE(G1)
{
//using TypeTag = Opm::Properties::TTag::EclFlowProblem;
using TypeTag = Opm::Properties::TTag::TestGliftTypeTag;
//using EclProblem = Opm::EclProblem<TypeTag>;
//using EclWellModel = typename EclProblem::EclWellModel;
using WellModel = Opm::BlackoilWellModel<TypeTag>;
using WellState = Opm::WellStateFullyImplicitBlackoil;
using StdWell = Opm::StandardWell<TypeTag>;
using GasLiftSingleWell = Opm::GasLiftSingleWell<TypeTag>;
const std::string filename = "GLIFT1.DATA";
auto simulator = initSimulator<TypeTag>(filename.data());
simulator->model().applyInitialSolution();
simulator->setEpisodeIndex(-1);
simulator->setEpisodeLength(0.0);
simulator->startNextEpisode(/*episodeStartTime=*/0.0, /*episodeLength=*/1e30);
simulator->setTimeStepSize(43200); // 12 hours
simulator->model().newtonMethod().setIterationIndex(0);
WellModel& well_model = simulator->problem().wellModel();
int report_step_idx = 0;
well_model.beginReportStep(report_step_idx);
well_model.beginTimeStep();
well_model.updatePerforationIntensiveQuantities();
Opm::DeferredLogger deferred_logger;
well_model.calculateExplicitQuantities(deferred_logger);
well_model.prepareTimeStep(deferred_logger);
well_model.updateWellControls(deferred_logger, /* check group controls */ true);
well_model.initPrimaryVariablesEvaluation();
Opm::WellInterface<TypeTag> *well_ptr = well_model.getWell("B-1H").get();
StdWell *std_well = dynamic_cast<StdWell *>(well_ptr);
const auto& schedule = simulator->vanguard().schedule();
auto wells_ecl = schedule.getWells(report_step_idx);
std::optional<std::size_t> idx;
int num_producers = 0;
for(std::size_t i = 0; i < wells_ecl.size(); ++i) {
const auto &well = wells_ecl[i];
if (well.isProducer()) {
idx = i;
num_producers++;
}
}
BOOST_CHECK_EQUAL( num_producers, 1);
const auto &well = wells_ecl[*idx];
BOOST_CHECK_EQUAL( well.name(), "B-1H");
const auto& summary_state = simulator->vanguard().summaryState();
WellState &well_state = const_cast<WellState &>(well_model.wellState());
GasLiftSingleWell glift {*std_well, *(simulator.get()), summary_state,
deferred_logger, well_state};
auto state = glift.runOptimize();
BOOST_CHECK_CLOSE(state->oilRate(), 0.01736111111111111, 1e-8);
BOOST_CHECK_CLOSE(state->gasRate(), 1.6464646999768586, 1e-8);
BOOST_CHECK(state->oilIsLimited());
BOOST_CHECK(!state->gasIsLimited());
BOOST_CHECK(!state->alqIsLimited());
BOOST_CHECK_CLOSE(state->alq(), 0.0, 1e-8);
BOOST_CHECK(!state->increase().has_value());
}