From a62de5db66ba0ea4ccb2e64ae3db0ec86530cc3d Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Thu, 21 Feb 2019 10:25:29 +0100 Subject: [PATCH] move ebos to opm-simulators ebos is well past the stage of a test for the numerical code but a full-blown simulator of its own. Let's graduate. --- tests/data/SPE1CASE1.DATA | 437 ------- .../SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA | 658 ---------- tests/data/equil_base.DATA | 115 -- tests/data/equil_capillary.DATA | 87 -- tests/data/equil_capillary_overlap.DATA | 128 -- tests/data/equil_capillary_swatinit.DATA | 102 -- tests/data/equil_deadfluids.DATA | 88 -- tests/data/equil_livegas.DATA | 131 -- tests/data/equil_liveoil.DATA | 140 -- tests/data/equil_pbvd_and_pdvd.DATA | 152 --- tests/data/equil_rsvd_and_rvvd.DATA | 151 --- tests/test_ecl_output.cc | 258 ---- tests/test_equil.cc | 1127 ----------------- 13 files changed, 3574 deletions(-) delete mode 100644 tests/data/SPE1CASE1.DATA delete mode 100644 tests/data/SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA delete mode 100644 tests/data/equil_base.DATA delete mode 100644 tests/data/equil_capillary.DATA delete mode 100644 tests/data/equil_capillary_overlap.DATA delete mode 100644 tests/data/equil_capillary_swatinit.DATA delete mode 100644 tests/data/equil_deadfluids.DATA delete mode 100644 tests/data/equil_livegas.DATA delete mode 100644 tests/data/equil_liveoil.DATA delete mode 100644 tests/data/equil_pbvd_and_pdvd.DATA delete mode 100644 tests/data/equil_rsvd_and_rvvd.DATA delete mode 100644 tests/test_ecl_output.cc delete mode 100644 tests/test_equil.cc diff --git a/tests/data/SPE1CASE1.DATA b/tests/data/SPE1CASE1.DATA deleted file mode 100644 index 276857f94..000000000 --- a/tests/data/SPE1CASE1.DATA +++ /dev/null @@ -1,437 +0,0 @@ --- 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) 2015 Statoil - --- This simulation is based on the data given in --- 'Comparison of Solutions to a Three-Dimensional --- Black-Oil Reservoir Simulation Problem' by Aziz S. Odeh, --- Journal of Petroleum Technology, January 1981 - --- NOTE: This deck is currently not supported by the OPM --- simulator flow due to lack of support for DRSDT. - ---------------------------------------------------------------------------- ------------------------- SPE1 - CASE 1 ------------------------------------ ---------------------------------------------------------------------------- - -RUNSPEC --- ------------------------------------------------------------------------- - -TITLE - SPE1 - CASE 1 - -DIMENS - 10 10 3 / - --- The number of equilibration regions is inferred from the EQLDIMS --- keyword. -EQLDIMS -/ - --- The number of PVTW tables is inferred from the TABDIMS keyword; --- when no data is included in the keyword the default values are used. -TABDIMS -/ - -OIL -GAS -WATER -DISGAS --- As seen from figure 4 in Odeh, GOR is increasing with time, --- which means that dissolved gas is present - -FIELD - -START - 1 'JAN' 2015 / - -WELLDIMS --- Item 1: maximum number of wells in the model --- - there are two wells in the problem; injector and producer --- Item 2: maximum number of grid blocks connected to any one well --- - must be one as the wells are located at specific grid blocks --- Item 3: maximum number of groups in the model --- - we are dealing with only one 'group' --- Item 4: maximum number of wells in any one group --- - there must be two wells in a group as there are two wells in total - 2 1 1 2 / - -UNIFOUT - -GRID - --- The INIT keyword is used to request an .INIT file. The .INIT file --- is written before the simulation actually starts, and contains grid --- properties and saturation tables as inferred from the input --- deck. There are no other keywords which can be used to configure --- exactly what is written to the .INIT file. -INIT - - --- ------------------------------------------------------------------------- -NOECHO - -DX --- There are in total 300 cells with length 1000ft in x-direction - 300*1000 / -DY --- There are in total 300 cells with length 1000ft in y-direction - 300*1000 / -DZ --- The layers are 20, 30 and 50 ft thick, in each layer there are 100 cells - 100*20 100*30 100*50 / - -TOPS --- The depth of the top of each grid block - 100*8325 / - -PORO --- Constant porosity of 0.3 throughout all 300 grid cells - 300*0.3 / - -PERMX --- The layers have perm. 500mD, 50mD and 200mD, respectively. - 100*500 100*50 100*200 / - -PERMY --- Equal to PERMX - 100*500 100*50 100*200 / - -PERMZ --- Cannot find perm. in z-direction in Odeh's paper --- For the time being, we will assume PERMZ equal to PERMX and PERMY: - 100*500 100*50 100*200 / -ECHO - -PROPS --- ------------------------------------------------------------------------- - -PVTW --- Item 1: pressure reference (psia) --- Item 2: water FVF (rb per bbl or rb per stb) --- Item 3: water compressibility (psi^{-1}) --- Item 4: water viscosity (cp) --- Item 5: water 'viscosibility' (psi^{-1}) - --- Using values from Norne: --- In METRIC units: --- 277.0 1.038 4.67E-5 0.318 0.0 / --- In FIELD units: - 4017.55 1.038 3.22E-6 0.318 0.0 / - -ROCK --- Item 1: reference pressure (psia) --- Item 2: rock compressibility (psi^{-1}) - --- Using values from table 1 in Odeh: - 14.7 3E-6 / - -SWOF --- Column 1: water saturation --- - this has been set to (almost) equally spaced values from 0.12 to 1 --- Column 2: water relative permeability --- - generated from the Corey-type approx. formula --- the coeffisient is set to 10e-5, S_{orw}=0 and S_{wi}=0.12 --- Column 3: oil relative permeability when only oil and water are present --- - we will use the same values as in column 3 in SGOF. --- This is not really correct, but since only the first --- two values are of importance, this does not really matter --- Column 4: water-oil capillary pressure (psi) - -0.12 0 1 0 -0.18 4.64876033057851E-008 1 0 -0.24 0.000000186 0.997 0 -0.3 4.18388429752066E-007 0.98 0 -0.36 7.43801652892562E-007 0.7 0 -0.42 1.16219008264463E-006 0.35 0 -0.48 1.67355371900826E-006 0.2 0 -0.54 2.27789256198347E-006 0.09 0 -0.6 2.97520661157025E-006 0.021 0 -0.66 3.7654958677686E-006 0.01 0 -0.72 4.64876033057851E-006 0.001 0 -0.78 0.000005625 0.0001 0 -0.84 6.69421487603306E-006 0 0 -0.91 8.05914256198347E-006 0 0 -1 0.00001 0 0 / - - -SGOF --- Column 1: gas saturation --- Column 2: gas relative permeability --- Column 3: oil relative permeability when oil, gas and connate water are present --- Column 4: oil-gas capillary pressure (psi) --- - stated to be zero in Odeh's paper - --- Values in column 1-3 are taken from table 3 in Odeh's paper: -0 0 1 0 -0.001 0 1 0 -0.02 0 0.997 0 -0.05 0.005 0.980 0 -0.12 0.025 0.700 0 -0.2 0.075 0.350 0 -0.25 0.125 0.200 0 -0.3 0.190 0.090 0 -0.4 0.410 0.021 0 -0.45 0.60 0.010 0 -0.5 0.72 0.001 0 -0.6 0.87 0.0001 0 -0.7 0.94 0.000 0 -0.85 0.98 0.000 0 -0.88 0.984 0.000 0 / ---1.00 1.0 0.000 0 / --- Warning from Eclipse: first sat. value in SWOF + last sat. value in SGOF --- must not be greater than 1, but Eclipse still runs --- Flow needs the sum to be excactly 1 so I added a row with gas sat. = 0.88 --- The corresponding krg value was estimated by assuming linear rel. between --- gas sat. and krw. between gas sat. 0.85 and 1.00 (the last two values given) - -DENSITY --- Density (lb per ft³) at surface cond. of --- oil, water and gas, respectively (in that order) - --- Using values from Norne: --- In METRIC units: --- 859.5 1033.0 0.854 / --- In FIELD units: - 53.66 64.49 0.0533 / - -PVDG --- Column 1: gas phase pressure (psia) --- Column 2: gas formation volume factor (rb per Mscf) --- - in Odeh's paper the units are said to be given in rb per bbl, --- but this is assumed to be a mistake: FVF-values in Odeh's paper --- are given in rb per scf, not rb per bbl. This will be in --- agreement with conventions --- Column 3: gas viscosity (cP) - --- Using values from lower right table in Odeh's table 2: -14.700 166.666 0.008000 -264.70 12.0930 0.009600 -514.70 6.27400 0.011200 -1014.7 3.19700 0.014000 -2014.7 1.61400 0.018900 -2514.7 1.29400 0.020800 -3014.7 1.08000 0.022800 -4014.7 0.81100 0.026800 -5014.7 0.64900 0.030900 -9014.7 0.38600 0.047000 / - -PVTO --- Column 1: dissolved gas-oil ratio (Mscf per stb) --- Column 2: bubble point pressure (psia) --- Column 3: oil FVF for saturated oil (rb per stb) --- Column 4: oil viscosity for saturated oil (cP) - --- Use values from top left table in Odeh's table 2: -0.0010 14.7 1.0620 1.0400 / -0.0905 264.7 1.1500 0.9750 / -0.1800 514.7 1.2070 0.9100 / -0.3710 1014.7 1.2950 0.8300 / -0.6360 2014.7 1.4350 0.6950 / -0.7750 2514.7 1.5000 0.6410 / -0.9300 3014.7 1.5650 0.5940 / -1.2700 4014.7 1.6950 0.5100 - 9014.7 1.5790 0.7400 / -1.6180 5014.7 1.8270 0.4490 - 9014.7 1.7370 0.6310 / --- It is required to enter data for undersaturated oil for the highest GOR --- (i.e. the last row) in the PVTO table. --- In order to fulfill this requirement, values for oil FVF and viscosity --- at 9014.7psia and GOR=1.618 for undersaturated oil have been approximated: --- It has been assumed that there is a linear relation between the GOR --- and the FVF when keeping the pressure constant at 9014.7psia. --- From Odeh we know that (at 9014.7psia) the FVF is 2.357 at GOR=2.984 --- for saturated oil and that the FVF is 1.579 at GOR=1.27 for undersaturated oil, --- so it is possible to use the assumption described above. --- An equivalent approximation for the viscosity has been used. -/ - -SOLUTION --- ------------------------------------------------------------------------- - -EQUIL --- Item 1: datum depth (ft) --- Item 2: pressure at datum depth (psia) --- - Odeh's table 1 says that initial reservoir pressure is --- 4800 psi at 8400ft, which explains choice of item 1 and 2 --- Item 3: depth of water-oil contact (ft) --- - chosen to be directly under the reservoir --- Item 4: oil-water capillary pressure at the water oil contact (psi) --- - given to be 0 in Odeh's paper --- Item 5: depth of gas-oil contact (ft) --- - chosen to be directly above the reservoir --- Item 6: gas-oil capillary pressure at gas-oil contact (psi) --- - given to be 0 in Odeh's paper --- Item 7: RSVD-table --- Item 8: RVVD-table --- Item 9: Set to 0 as this is the only value supported by OPM - --- Item #: 1 2 3 4 5 6 7 8 9 - 8400 4800 8450 0 8300 0 1 0 0 / - -RSVD --- Dissolved GOR is initially constant with depth through the reservoir. --- The reason is that the initial reservoir pressure given is higher ----than the bubble point presssure of 4014.7psia, meaning that there is no --- free gas initially present. -8300 1.270 -8450 1.270 / - -SUMMARY --- ------------------------------------------------------------------------- - --- 1a) Oil rate vs time -FOPR --- Field Oil Production Rate - --- 1b) GOR vs time -WGOR --- Well Gas-Oil Ratio - 'PROD' -/ --- Using FGOR instead of WGOR:PROD results in the same graph -FGOR - --- 2a) Pressures of the cell where the injector and producer are located -BPR -1 1 1 / -10 10 3 / -/ - --- 2b) Gas saturation at grid points given in Odeh's paper -BGSAT -1 1 1 / -1 1 2 / -1 1 3 / -10 1 1 / -10 1 2 / -10 1 3 / -10 10 1 / -10 10 2 / -10 10 3 / -/ - --- In order to compare Eclipse with Flow: -WBHP - 'INJ' - 'PROD' -/ -WGIR - 'INJ' - 'PROD' -/ -WGIT - 'INJ' - 'PROD' -/ -WGPR - 'INJ' - 'PROD' -/ -WGPT - 'INJ' - 'PROD' -/ -WOIR - 'INJ' - 'PROD' -/ -WOIT - 'INJ' - 'PROD' -/ -WOPR - 'INJ' - 'PROD' -/ -WOPT - 'INJ' - 'PROD' -/ -WWIR - 'INJ' - 'PROD' -/ -WWIT - 'INJ' - 'PROD' -/ -WWPR - 'INJ' - 'PROD' -/ -WWPT - 'INJ' - 'PROD' -/ -SCHEDULE --- ------------------------------------------------------------------------- -RPTSCHED - 'PRES' 'SGAS' 'RS' 'WELLS' / - -RPTRST - 'BASIC=1' / - - --- If no resolution (i.e. case 1), the two following lines must be added: -DRSDT - 0 / --- if DRSDT is set to 0, GOR cannot rise and free gas does not --- dissolve in undersaturated oil -> constant bubble point pressure - -WELSPECS --- Item #: 1 2 3 4 5 6 - 'PROD' 'G1' 10 10 8400 'OIL' / - 'INJ' 'G1' 1 1 8335 'GAS' / -/ --- Coordinates in item 3-4 are retrieved from Odeh's figure 1 and 2 --- Note that the depth at the midpoint of the well grid blocks --- has been used as reference depth for bottom hole pressure in item 5 - -COMPDAT --- Item #: 1 2 3 4 5 6 7 8 9 - 'PROD' 10 10 3 3 'OPEN' 1* 1* 0.5 / - 'INJ' 1 1 1 1 'OPEN' 1* 1* 0.5 / -/ --- Coordinates in item 2-5 are retreived from Odeh's figure 1 and 2 --- Item 9 is the well bore internal diameter, --- the radius is given to be 0.25ft in Odeh's paper - - -WCONPROD --- Item #:1 2 3 4 5 9 - 'PROD' 'OPEN' 'ORAT' 20000 4* 1000 / -/ --- It is stated in Odeh's paper that the maximum oil prod. rate --- is 20 000stb per day which explains the choice of value in item 4. --- The items > 4 are defaulted with the exception of item 9, --- the BHP lower limit, which is given to be 1000psia in Odeh's paper - -WCONINJE --- Item #:1 2 3 4 5 6 7 - 'INJ' 'GAS' 'OPEN' 'RATE' 100000 1* 9014 / -/ --- Stated in Odeh that gas inj. rate (item 5) is 100MMscf per day --- BHP upper limit (item 7) should not be exceeding the highest --- pressure in the PVT table=9014.7psia (default is 100 000psia) - -TSTEP ---Advance the simulater once a month for TEN years: -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 -31 28 31 30 31 30 31 31 30 31 30 31 / - ---Advance the simulator once a year for TEN years: ---10*365 / - -END diff --git a/tests/data/SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA b/tests/data/SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA deleted file mode 100644 index 6a52964ef..000000000 --- a/tests/data/SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA +++ /dev/null @@ -1,658 +0,0 @@ --- Synthetic test deck based on Norne. This data set is meant to be a simple, --- well-documented deck for the behaviour of SUMMARY specified output. Data --- is mostly entered to *traceable* and does not necessarily make sense from --- a simulation point of view. - -START -10 MAI 2007 / -RUNSPEC - -TITLE -SUMMARYTESTS - --- A simple 10x10x10 cube. Simple to reason about, large enough for all tests -DIMENS - 10 10 10 / - -REGDIMS - 3 / - -OIL -GAS -WATER -DISGAS - -METRIC - -GRID - -DX -1000*1 / -DY -1000*1 / -DZ -1000*1 / -TOPS -100*1 / - -ACTNUM - 1000*1/ - -PORO -500*0.1 500*0.2/ - -PERMX - 1000*500 / - -REGIONS - -FIPNUM - 400*1 - 200*2 - 400*3 / - -PROPS - -PVTW - 1 1000 0 0.318 0.0 / - -ROCK - 14.7 3E-6 / - -SWOF -0.12 0 1 0 -0.18 4.64876033057851E-008 1 0 -0.24 0.000000186 0.997 0 -0.3 4.18388429752066E-007 0.98 0 -0.36 7.43801652892562E-007 0.7 0 -0.42 1.16219008264463E-006 0.35 0 -0.48 1.67355371900826E-006 0.2 0 -0.54 2.27789256198347E-006 0.09 0 -0.6 2.97520661157025E-006 0.021 0 -0.66 3.7654958677686E-006 0.01 0 -0.72 4.64876033057851E-006 0.001 0 -0.78 0.000005625 0.0001 0 -0.84 6.69421487603306E-006 0 0 -0.91 8.05914256198347E-006 0 0 -1 0.00001 0 0 / - - -SGOF -0 0 1 0 -0.001 0 1 0 -0.02 0 0.997 0 -0.05 0.005 0.980 0 -0.12 0.025 0.700 0 -0.2 0.075 0.350 0 -0.25 0.125 0.200 0 -0.3 0.190 0.090 0 -0.4 0.410 0.021 0 -0.45 0.60 0.010 0 -0.5 0.72 0.001 0 -0.6 0.87 0.0001 0 -0.7 0.94 0.000 0 -0.85 0.98 0.000 0 -0.88 0.984 0.000 0 / - -DENSITY - 53.66 64.49 0.0533 / - -PVDG -1 100 1 -10 10 1 / - -PVTO -0 1 10 1 / -1 1 10.001 1 - 10 1 1 / -/ - -SUMMARY -DATE -PERFORMA --- --- Field Data --- Production Rates -FVPR -FWPR -FWPRH -FOPR -FOPRH -FGPR -FGPRH -FLPR -FLPRH -FGSR -FGCR -FNPR -- solvent ---FTPRSEA --- Injection Rates -FVIR -FWIR -FWIRH -FGIR -FNIR -- solvent -FGIRH --- Production Cummulatives -FVPT -FWPT -FOPT -FLPT -FLPTH -FGPT -FNPT -FOPTH -FGPTH -FWPTH -FGST -FGCT --- Injection Cummulatives -FVIT -FWIT -FWITH -FGIT -FNIT -FGITH --- In place -FWIP -FOIP -FGIP --- Ratios -FWCT -FWCTH -FGOR -FGORH - --- From model2 -FMWPR -FMWIN -FOE - --- Pressures -FPR -FPRP - -BPR - 1 1 1 / - 1 1 2 / - 1 1 3 / - 1 1 4 / - 1 1 5 / - 1 1 6 / - 1 1 7 / - 1 1 8 / - 1 1 9 / - 1 1 10 / - 2 1 10 / -- This cell is not ACTIVE -/ - -BSGAS - 1 1 1 / -/ - - -BSWAT - 1 1 1 / -/ - - --- Region data -RPR -/ -ROPT -/ -RGPT -/ -RWPT -/ -RGFT -/ -RWFT -/ -ROIP -/ -ROP -/ -ROPR -/ -RGPR -/ -RWPR -/ -RGIR -/ -RGIT -/ -RWIR -/ -RWIT -/ -RWPT -/ -ROIPL -/ -ROIPG -/ -RGIP -/ -RGIPL -/ -RGIPG -/ -RWIP -/ -RPPO -/ - --- Group data -- -GPR -/ -GLPR -/ -GOPT -/ -GGPT -/ -GWPT -/ -GNPT -/ -GOPR -/ -GGPR -/ -GWPR -/ -GWPRH -/ -GGIR -/ -GNPR -/ - -GNIR -/ -GGIRH -/ -GGIT -/ -GNIT -/ -GGITH -/ -GWCT -/ -GWCTH -/ -GGOR -/ -GGORH -/ -GWIR -/ -GWIT -/ -GWIRH -/ -GWITH -/ -GOPRH -/ -GGPRH -/ -GLPRH -/ -GWPTH -/ -GOPTH -/ -GGPTH -/ -GLPTH -/ -GPRG -/ -GPRW -/ -GOPTF -/ -GOPTS -/ -GOPTH -/ -GOPRF -/ -GOPRS -/ -GOPRH -/ -GGPTF -/ -GGPTS -/ -GGPTH -/ -GGPTF -/ -GGPTS -/ -GGPTH -/ -GGLR -/ -GGLIR -/ -GGLRH -/ -GVPR -/ -GVPT -/ -GMCTP -/ -GOPP -/ -GVIR -/ -GVIT -/ -GVPRT -/ -GMWPR -/ -GMWIN -/ --- Well Data --- Production Rates -WWPR -/ -WWPRH -/ -WOPR -/ -WOPRH -/ -WGPR -/ -WNPR -/ -WGPRH -/ -WLPR -/ -WLPRH -/ - -WLPT -/ - -WLPTH -/ - --- Injection Rates -WWIR - W_3 -/ -WWIT - W_3 -/ -WWIRH - W_3 -/ -WWITH - W_3 -/ - -WGIT - W_3 -/ -WGIR - W_3 -/ -WGIRH - W_3 -/ -WGITH - W_3 -/ -WNIR - W_3 -/ -WNIT - W_3 -/ - --- Production Cummulatives -WWPT -/ -WWPTH -/ -WOPT -/ -WOPTH -/ -WGPT -/ -WGPTH -/ -WNPT -/ - --- Tracers ---WTPRSEA ---/ ---WTPTSEA ---/ --- Injection Cummulatives -WWIT - W_3 -/ --- Ratios -WWCT -/ -WWCTH -/ -WGOR -/ -WGORH -/ -WGLR -/ -WGLRH -/ - - --- Performance -WBHP -/ -WBHPH -/ -WTHP -/ -WTHPH -/ -WPI -/ -WBP -/ -WBP4 -/ - --- from model2 -WOPTF -/ -WOPTS -/ -WOPTH -/ -WOPRS -/ -WOPRF -/ -WGPTF -/ -WGPTS -/ -WGPRF -/ -WTPRS -/ -WGLIR -/ -WVPR -/ -WVPT -/ -WOPP -/ -WVIR -/ -WVIT -/ -WMCTL -/ - --- Water injection per connection -CWIR - * / -/ - --- Gas injection on 3 1 1 (45) -CGIR -'W_3' 3 1 1 / -/ - -CWIT -'W_3' / -/ - -CGIT -* / -/ - --- Production per connection --- Using all the different ways of specifying connections here --- as an informal test that we still get the data we want -CWPR - 'W_1' 1 1 1 / -/ - -COPR - 'W_1' / - 'W_2' / - 'W_3' / -/ - -CGPR - '*' / -/ - -CNFR - '*' / -/ - -CNPT - '*' / -/ - -CNIT - '*' / -/ - -CWPT - 'W_1' 1 1 1 / -/ - -COPT - 'W_1' / -/ - -CGPT - 'W_1' / - 'W_2' / - 'W_3' / -/ - ----- Connection production rates -----CGFR -----'E-4AH' / -----/ -----CWFR -----'E-2H' / -----/ - -SOLUTION - -SWAT - 1000*0.2 / - -SGAS - 1000*0.0 / - -PRESSURE - 100*1.0 - 100*2.0 - 100*3.0 - 100*4.0 - 100*5.0 - 100*6.0 - 100*7.0 - 100*8.0 - 100*9.0 - 100*10.0/ - -RS - 1000*0 / - - -SCHEDULE - --- Three wells, two producers (so that we can form a group) and one injector -WELSPECS - 'W_1' 'G_1' 1 1 3.33 'OIL' 7* / - 'W_2' 'G_1' 2 1 3.33 'OIL' 7* / - 'W_3' 'G_2' 3 1 3.92 'WATER' 7* / -/ - --- Completion data. -COMPDAT --- 'Well' I J K1 K2 --- Passing 0 to I/J means they'll get the well head I/J - W_1 0 0 1 1 / -- Active index: 0 - W_2 0 0 1 1 / -- Active index: 1 - W_2 0 0 2 2 / -- Active index: 101 - W_3 0 0 1 1 / -- Active index: 2 -/ - -WCONHIST --- history rates are set so that W_1 produces 1, W_2 produces 2 etc. --- index.offset. --- organised as oil-water-gas - W_1 SHUT ORAT 10.1 10 10.2 / - W_2 SHUT ORAT 20.1 20 20.2 / -/ - -WCONINJH --- Injection historical rates (water only, as we only support pure injectors) - W_3 WATER STOP 30.0 / -/ - -TSTEP --- register time steps (in days). This allows us to write *two* report steps (1 --- and 2. Without this, totals/accumulations would fail (segfault) when looking --- up historical rates and volumes. These volumes however don't change, i.e. --- every time step has the same set of values -10 10 / - --- Register a fourth well with completions later. This ensure we handle when --- wells are registered or activated later in a simulation -WELSPECS - 'W_4' 'G_3' 1 1 3.33 'OIL' 7* / -/ - -COMPDAT - W_4 1 1 3 3 / -/ - -TSTEP -10 10 / diff --git a/tests/data/equil_base.DATA b/tests/data/equil_base.DATA deleted file mode 100644 index 740ae0850..000000000 --- a/tests/data/equil_base.DATA +++ /dev/null @@ -1,115 +0,0 @@ -RUNSPEC - -WATER -GAS -OIL - -METRIC - -DIMENS - 10 1 10 / - -GRID - -DX - 100*1 / -DY - 100*1 / -DZ - 100*1 / - -TOPS - 10*0. / - -PORO - 100*0.3 / - -PERMX - 100*500 / - -PROPS - -PVTW - 4017.55 1.038 3.22E-6 0.318 0.0 / - -ROCK - 14.7 3E-6 / - -SWOF -0.12 0 1 0 -0.18 4.64876033057851E-008 1 0 -0.24 0.000000186 0.997 0 -0.3 4.18388429752066E-007 0.98 0 -0.36 7.43801652892562E-007 0.7 0 -0.42 1.16219008264463E-006 0.35 0 -0.48 1.67355371900826E-006 0.2 0 -0.54 2.27789256198347E-006 0.09 0 -0.6 2.97520661157025E-006 0.021 0 -0.66 3.7654958677686E-006 0.01 0 -0.72 4.64876033057851E-006 0.001 0 -0.78 0.000005625 0.0001 0 -0.84 6.69421487603306E-006 0 0 -0.91 8.05914256198347E-006 0 0 -1 0.00001 0 0 / - - -SGOF -0 0 1 0 -0.001 0 1 0 -0.02 0 0.997 0 -0.05 0.005 0.980 0 -0.12 0.025 0.700 0 -0.2 0.075 0.350 0 -0.25 0.125 0.200 0 -0.3 0.190 0.090 0 -0.4 0.410 0.021 0 -0.45 0.60 0.010 0 -0.5 0.72 0.001 0 -0.6 0.87 0.0001 0 -0.7 0.94 0.000 0 -0.85 0.98 0.000 0 -0.88 0.984 0.000 0 / - -DENSITY - 53.66 64.49 0.0533 / - -PVDG -14.700 166.666 0.008000 -264.70 12.0930 0.009600 -514.70 6.27400 0.011200 -1014.7 3.19700 0.014000 -2014.7 1.61400 0.018900 -2514.7 1.29400 0.020800 -3014.7 1.08000 0.022800 -4014.7 0.81100 0.026800 -5014.7 0.64900 0.030900 -9014.7 0.38600 0.047000 / - -PVTO -0.0010 14.7 1.0620 1.0400 / -0.0905 264.7 1.1500 0.9750 / -0.1800 514.7 1.2070 0.9100 / -0.3710 1014.7 1.2950 0.8300 / -0.6360 2014.7 1.4350 0.6950 / -0.7750 2514.7 1.5000 0.6410 / -0.9300 3014.7 1.5650 0.5940 / -1.2700 4014.7 1.6950 0.5100 - 9014.7 1.5790 0.7400 / -1.6180 5014.7 1.8270 0.4490 - 9014.7 1.7370 0.6310 / -/ - -SOLUTION - -SWAT - 100*0.0 / - -SGAS - 100*0.0 / - -PRESSURE - 100*300.0 / - -SUMMARY - -SCHEDULE diff --git a/tests/data/equil_capillary.DATA b/tests/data/equil_capillary.DATA deleted file mode 100644 index 4289102e5..000000000 --- a/tests/data/equil_capillary.DATA +++ /dev/null @@ -1,87 +0,0 @@ --- Most of the following sections are not actually needed by the test, --- but it is required by the Eclipse reference manual that they are --- present. Also, the higher level opm-parser classes --- (i.e. Opm::EclipseState et al.) assume that they are present. - -------------------------------------- -RUNSPEC - -WATER -OIL -GAS - -DIMENS -1 1 20 / - -TABDIMS - 1 1 40 20 1 20 / - -EQLDIMS --- NTEQUL - 1 / - -------------------------------------- -GRID - --- Opm::EclipseState assumes that _some_ grid gets defined, so let's --- specify a fake one... - -DXV -1*1 / - -DYV -1*1 / - -DZV -20*5 / - -DEPTHZ -4*0.0 / - -PORO - 20*0.3 / - -PERMX - 20*500 / - -------------------------------------- -PROPS - -PVDO -100 1.0 1.0 -200 0.9 1.0 -/ - -PVDG -100 0.010 0.1 -200 0.005 0.2 -/ - -PVTW -1.0 1.0 4.0E-5 0.96 0.0 -/ - -SWOF -0.2 0 1 0.4 -1 1 0 0.1 -/ - -SGOF -0 0 1 0.2 -0.8 1 0 0.5 -/ - -DENSITY -700 1000 1 -/ - -------------------------------------- -SOLUTION - -EQUIL -50 150 50 0.25 20 0.35 1* 1* 0 -/ - -------------------------------------- -SCHEDULE --- empty section diff --git a/tests/data/equil_capillary_overlap.DATA b/tests/data/equil_capillary_overlap.DATA deleted file mode 100644 index b59e42202..000000000 --- a/tests/data/equil_capillary_overlap.DATA +++ /dev/null @@ -1,128 +0,0 @@ -NOECHO - -RUNSPEC ====== - -WATER -OIL -GAS - -TABDIMS - 1 1 40 20 1 20 / - -DIMENS -1 1 20 -/ - -WELLDIMS - 30 10 2 30 / - -START - 1 'JAN' 1990 / - -NSTACK - 25 / - -EQLDIMS --- NTEQUL - 1 / - - -FMTOUT -FMTIN - -GRID ====== - -DXV -1.0 -/ - -DYV -1.0 -/ - -DZV -20*5.0 -/ - - -PORO -20*0.2 -/ - - -PERMZ - 20*1.0 -/ - -PERMY -20*100.0 -/ - -PERMX -20*100.0 -/ - -BOX - 1 1 1 1 1 1 / - -TOPS -0.0 -/ - -PROPS ====== - - -PVDO -100 1.0 1.0 -200 0.9 1.0 -/ - -PVDG -100 0.010 0.1 -200 0.005 0.2 -/ - -SWOF -0.2 0 1 0.9 -1 1 0 0.1 -/ - -SGOF -0 0 1 0.2 -0.8 1 0 0.5 -/ - -PVTW ---RefPres Bw Comp Vw Cv - 1. 1.0 4.0E-5 0.96 0.0 / - - -ROCK ---RefPres Comp - 1. 5.0E-5 / - -DENSITY -700 1000 1 -/ - -SOLUTION ====== - -EQUIL -45 150 50 0.25 45 0.35 1* 1* 0 -/ - -RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RESTART=2' / - -SUMMARY ====== -RUNSUM - -SEPARATE - -SCHEDULE ====== - -RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RESTART=3' 'NEWTON=2' / - - -END diff --git a/tests/data/equil_capillary_swatinit.DATA b/tests/data/equil_capillary_swatinit.DATA deleted file mode 100644 index f4e693a58..000000000 --- a/tests/data/equil_capillary_swatinit.DATA +++ /dev/null @@ -1,102 +0,0 @@ --- Most of the following sections are not actually needed by the test, --- but it is required by the Eclipse reference manual that they are --- present. Also, the higher level opm-parser classes --- (i.e. Opm::EclipseState et al.) assume that they are present. - -------------------------------------- -RUNSPEC - -WATER -OIL -GAS - -DIMENS -1 1 20 / - -TABDIMS - 1 1 40 20 1 20 / - -EQLDIMS --- NTEQUL - 1 / - -START - 1 'JAN' 2015 / -------------------------------------- -GRID - --- Opm::EclipseState assumes that _some_ grid gets defined, so let's --- specify a fake one... - -DXV -1 / - -DYV -1 / - -DZ -20*5 / - -TOPS -0 / - -PORO -20*0.3 / - -PERMX -20*500 / - -PERMZ -20*500 / -------------------------------------- -PROPS - -ROCK - 14.7 3E-6 / - -PVDO -100 1.0 1.0 -200 0.9 1.0 -/ - -PVDG -100 0.010 0.1 -200 0.005 0.2 -/ - -PVTW -1.0 1.0 4.0E-5 0.96 0.0 -/ - -SWOF -0.2 0 1 0.4 -1 1 0 0.1 -/ - -SGOF -0 0 1 0.2 -0.8 1 0 0.5 -/ - -DENSITY -700 1000 1 -/ - -SWATINIT - 5*0 - 10*0.5 -5*1 / - -------------------------------------- -SOLUTION - -EQUIL -50 150 50 0.25 20 0.35 1* 1* 0 -/ - -RPTSOL - SWATINIT SWAT SGAS SOIL PCOG PCOW -/ -------------------------------------- -SCHEDULE --- empty section diff --git a/tests/data/equil_deadfluids.DATA b/tests/data/equil_deadfluids.DATA deleted file mode 100644 index e0d63cb37..000000000 --- a/tests/data/equil_deadfluids.DATA +++ /dev/null @@ -1,88 +0,0 @@ --- Most of the following sections are not actually needed by the test, --- but it is required by the Eclipse reference manual that they are --- present. Also, the higher level opm-parser classes --- (i.e. Opm::EclipseState et al.) assume that they are present. - -------------------------------------- -RUNSPEC - -WATER -GAS -OIL - -METRIC - -DIMENS -1 1 10 / - -TABDIMS - 1 1 40 20 1 20 / - -EQLDIMS --- NTEQUL - 1 / - -GRID - --- Opm::EclipseState assumes that _some_ grid gets defined, so let's --- specify a fake one... - -DXV -1*1 / - -DYV -1*1 / - -DZV -10*1 / - -TOPS -1*0.0 / - -PORO - 10*0.3 / - -PERMX - 10*500 / - -------------------------------------- -PROPS - -PVDO -100 1.0 1.0 -200 0.5 1.0 -/ - -PVDG -100 0.05 0.1 -200 0.02 0.2 -/ - -PVTW -1.0 1.0 4.0E-5 0.96 0.0 -/ - -SWOF -0 0 1 0 -1 1 0 0 -/ - -SGOF -0 0 1 0 -1 1 0 0 -/ - -DENSITY -700 1000 10 -/ - -------------------------------------- -SOLUTION - -EQUIL -5 150 5 0 2 0 1* 1* 0 -/ - -------------------------------------- -SCHEDULE --- empty section diff --git a/tests/data/equil_livegas.DATA b/tests/data/equil_livegas.DATA deleted file mode 100644 index a0676f52c..000000000 --- a/tests/data/equil_livegas.DATA +++ /dev/null @@ -1,131 +0,0 @@ -NOECHO - -RUNSPEC ====== - -WATER -OIL -GAS -VAPOIL - -TABDIMS - 1 1 40 20 1 20 / - -DIMENS -1 1 20 -/ - -WELLDIMS - 30 10 2 30 / - -START - 1 'JAN' 1990 / - -NSTACK - 25 / - -EQLDIMS --- NTEQUL - 1 / - - -FMTOUT -FMTIN - -GRID ====== - -DXV -1.0 -/ - -DYV -1.0 -/ - -DZV -20*5.0 -/ - - -PORO -20*0.2 -/ - - -PERMZ - 20*1.0 -/ - -PERMY -20*100.0 -/ - -PERMX -20*100.0 -/ - -BOX - 1 1 1 1 1 1 / - -TOPS -0.0 -/ - -PROPS ====== - -PVDO -100 1.0 1.0 -200 0.9 1.0 -/ - -PVTG --- Pg Rv Bg Vg - 100 0.0001 0.010 0.1 - 0.0 0.0104 0.1 / - 200 0.0004 0.005 0.2 - 0.0 0.0054 0.2 / -/ - -SWOF -0.2 0 1 0.9 -1 1 0 0.1 -/ - -SGOF -0 0 1 0.2 -0.8 1 0 0.5 -/ - -PVTW ---RefPres Bw Comp Vw Cv - 1. 1.0 4.0E-5 0.96 0.0 / - - -ROCK ---RefPres Comp - 1. 5.0E-5 / - -DENSITY -700 1000 1 -/ - -SOLUTION ====== - -EQUIL -45 150 50 0.25 45 0.35 1* 1* 0 -/ - -RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / - -SUMMARY ====== -RUNSUM - -SEPARATE - -SCHEDULE ====== - -RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / - - -END diff --git a/tests/data/equil_liveoil.DATA b/tests/data/equil_liveoil.DATA deleted file mode 100644 index e1b417c46..000000000 --- a/tests/data/equil_liveoil.DATA +++ /dev/null @@ -1,140 +0,0 @@ -NOECHO - -RUNSPEC ====== - -WATER -OIL -GAS -DISGAS - -TABDIMS - 1 1 40 20 1 20 / - -DIMENS -1 1 20 -/ - -WELLDIMS - 30 10 2 30 / - -START - 1 'JAN' 1990 / - -NSTACK - 25 / - -EQLDIMS --- NTEQUL - 1 / - - -FMTOUT -FMTIN - -GRID ====== - -DXV -1.0 -/ - -DYV -1.0 -/ - -DZV -20*5.0 -/ - - -PORO -20*0.2 -/ - - -PERMZ - 20*1.0 -/ - -PERMY -20*100.0 -/ - -PERMX -20*100.0 -/ - -BOX - 1 1 1 1 1 1 / - -TOPS -0.0 -/ - -PROPS ====== - - -PVTO --- Rs Pbub Bo Vo - 0 1. 1.0000 1.20 / - 20 40. 1.0120 1.17 / - 40 80. 1.0255 1.14 / - 60 120. 1.0380 1.11 / - 80 160. 1.0510 1.08 / - 100 200. 1.0630 1.06 / - 120 240. 1.0750 1.03 / - 140 280. 1.0870 1.00 / - 160 320. 1.0985 .98 / - 180 360. 1.1100 .95 / - 200 400. 1.1200 .94 - 500. 1.1189 .94 / - / - -PVDG -100 0.010 0.1 -200 0.005 0.2 -/ - -SWOF -0.2 0 1 0.9 -1 1 0 0.1 -/ - -SGOF -0 0 1 0.2 -0.8 1 0 0.5 -/ - -PVTW ---RefPres Bw Comp Vw Cv - 1. 1.0 4.0E-5 0.96 0.0 / - - -ROCK ---RefPres Comp - 1. 5.0E-5 / - -DENSITY -700 1000 1 -/ - -SOLUTION ====== - -EQUIL -45 150 50 0.25 45 0.35 1* 1* 0 -/ - -RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / - -SUMMARY ====== -RUNSUM - -SEPARATE - -SCHEDULE ====== - -RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / - - -END diff --git a/tests/data/equil_pbvd_and_pdvd.DATA b/tests/data/equil_pbvd_and_pdvd.DATA deleted file mode 100644 index 59da42d69..000000000 --- a/tests/data/equil_pbvd_and_pdvd.DATA +++ /dev/null @@ -1,152 +0,0 @@ -NOECHO - -RUNSPEC ====== - -WATER -OIL -GAS -DISGAS -VAPOIL - -TABDIMS - 1 1 40 20 1 20 / - -DIMENS -1 1 20 -/ - -WELLDIMS - 30 10 2 30 / - -START - 1 'JAN' 1990 / - -NSTACK - 25 / - -EQLDIMS --- NTEQUL - 1 / - - -FMTOUT -FMTIN - -GRID ====== - -DX -20*1.0 -/ - -DY -20*1.0 -/ - -DZ -20*5.0 -/ - - -TOPS -0.0 -/ - -PORO -20*0.2 / - - -PERMZ - 20*1.0 -/ - -PERMY -20*100.0 -/ - -PERMX -20*100.0 -/ - -BOX - 1 1 1 1 1 1 / - - - -PROPS ====== - -PVTO --- Rs Pbub Bo Vo - 0 1. 1.0000 1.20 / - 20 40. 1.0120 1.17 / - 40 80. 1.0255 1.14 / - 60 120. 1.0380 1.11 / - 80 160. 1.0510 1.08 / - 100 200. 1.0630 1.06 / - 120 240. 1.0750 1.03 / - 140 280. 1.0870 1.00 / - 160 320. 1.0985 .98 / - 180 360. 1.1100 .95 / - 200 400. 1.1200 .94 - 500. 1.1189 .94 / -/ - -PVTG --- Pg Rv Bg Vg - 100 0.0001 0.010 0.1 - 0.0 0.0104 0.1 / - 200 0.0004 0.005 0.2 - 0.0 0.0054 0.2 / -/ - -SWOF -0.2 0 1 0.9 -1 1 0 0.1 -/ - -SGOF -0 0 1 0.2 -0.8 1 0 0.5 -/ - -PVTW ---RefPres Bw Comp Vw Cv - 1. 1.0 4.0E-5 0.96 0.0 / - - -ROCK ---RefPres Comp - 1. 5.0E-5 / - -DENSITY -700 1000 1 -/ - -SOLUTION ====== - -EQUIL -45 150 50 0.25 45 0.35 1 1 0 -/ - -PBVD - 0 1.0 - 50 150. / - -PDVD - 50. 150. - 100. 100 / - -RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / - -SUMMARY ====== -RUNSUM - -SEPARATE - -SCHEDULE ====== - -RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / - - -END diff --git a/tests/data/equil_rsvd_and_rvvd.DATA b/tests/data/equil_rsvd_and_rvvd.DATA deleted file mode 100644 index 3076524e3..000000000 --- a/tests/data/equil_rsvd_and_rvvd.DATA +++ /dev/null @@ -1,151 +0,0 @@ -NOECHO - -RUNSPEC ====== - -WATER -OIL -GAS -DISGAS -VAPOIL - -TABDIMS - 1 1 40 20 1 20 / - -DIMENS -1 1 20 -/ - -WELLDIMS - 30 10 2 30 / - -START - 1 'JAN' 1990 / - -NSTACK - 25 / - -EQLDIMS --- NTEQUL - 1 / - - -FMTOUT -FMTIN - -GRID ====== - -DXV -1.0 -/ - -DYV -1.0 -/ - -DZV -20*5.0 -/ - - -PORO -20*0.2 -/ - - -PERMZ - 20*1.0 -/ - -PERMY -20*100.0 -/ - -PERMX -20*100.0 -/ - -BOX - 1 1 1 1 1 1 / - -TOPS -0.0 -/ - -PROPS ====== - -PVTO --- Rs Pbub Bo Vo - 0 1. 1.0000 1.20 / - 20 40. 1.0120 1.17 / - 40 80. 1.0255 1.14 / - 60 120. 1.0380 1.11 / - 80 160. 1.0510 1.08 / - 100 200. 1.0630 1.06 / - 120 240. 1.0750 1.03 / - 140 280. 1.0870 1.00 / - 160 320. 1.0985 .98 / - 180 360. 1.1100 .95 / - 200 400. 1.1200 .94 - 500. 1.1189 .94 / -/ - -PVTG --- Pg Rv Bg Vg - 100 0.0001 0.010 0.1 - 0.0 0.0104 0.1 / - 200 0.0004 0.005 0.2 - 0.0 0.0054 0.2 / -/ - -SWOF -0.2 0 1 0.9 -1 1 0 0.1 -/ - -SGOF -0 0 1 0.2 -0.8 1 0 0.5 -/ - -PVTW ---RefPres Bw Comp Vw Cv - 1. 1.0 4.0E-5 0.96 0.0 / - - -ROCK ---RefPres Comp - 1. 5.0E-5 / - -DENSITY -700 1000 1 -/ - -SOLUTION ====== - -EQUIL -45 150 50 0.25 45 0.35 1 1 0 -/ - -RSVD - 0 0.0 - 100 100. / - -RVVD - 0. 0. - 100. 0.0001 / - -RPTSOL -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=2' / - -SUMMARY ====== -RUNSUM - -SEPARATE - -SCHEDULE ====== - -RPTSCHED -'PRES' 'PGAS' 'PWAT' 'SOIL' 'SWAT' 'SGAS' 'RS' 'RESTART=3' 'NEWTON=2' / - - -END diff --git a/tests/test_ecl_output.cc b/tests/test_ecl_output.cc deleted file mode 100644 index 9a76a0fa3..000000000 --- a/tests/test_ecl_output.cc +++ /dev/null @@ -1,258 +0,0 @@ -// -*- 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 . - - 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" - -#include -#include -#include - -#include -#include - -#include - - -#include -#include -#include -#include - -#if HAVE_DUNE_FEM -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#define CHECK(value, expected) \ - { \ - if ((value) != (expected)) \ - std::abort(); \ - } - -#define CHECK_CLOSE(value, expected, reltol) \ - { \ - if (std::fabs((expected) - (value)) > 1e-14 && \ - std::fabs(((expected) - (value))/((expected) + (value))) > reltol) \ - { \ - std::cout << "Test failure: "; \ - std::cout << "expected value " << expected << " is not close to value " << value << std::endl; \ - std::abort(); \ - } \ - } \ - -#define REQUIRE(cond) \ - { \ - if (!(cond)) \ - std::abort(); \ - } - -BEGIN_PROPERTIES - -NEW_TYPE_TAG(TestEclOutputTypeTag, INHERITS_FROM(BlackOilModel, EclBaseProblem)); -SET_BOOL_PROP(TestEclOutputTypeTag, EnableGravity, false); -SET_BOOL_PROP(TestEclOutputTypeTag, EnableAsyncEclOutput, false); - -END_PROPERTIES - -static const int day = 24 * 60 * 60; - -template -std::unique_ptr -initSimulator(const char *filename) -{ - typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator; - - std::string filenameArg = "--ecl-deck-file-name="; - filenameArg += filename; - - const char* argv[] = { - "test_equil", - filenameArg.c_str() - }; - - Ewoms::setupParameters_(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/false); - - return std::unique_ptr(new Simulator); -} - -ERT::ert_unique_ptr readsum(const std::string& base); -ERT::ert_unique_ptr readsum(const std::string& base) -{ - return ERT::ert_unique_ptr( - ecl_sum_fread_alloc_case(base.c_str(), ":")); -} - -void test_summary(); -void test_summary() -{ - typedef typename TTAG(TestEclOutputTypeTag) TypeTag; - const std::string filename = "data/SUMMARY_DECK_NON_CONSTANT_POROSITY.DATA"; - const std::string casename = "SUMMARY_DECK_NON_CONSTANT_POROSITY"; - - auto simulator = initSimulator(filename.data()); - typedef typename GET_PROP_TYPE(TypeTag, Vanguard) Vanguard; - typedef Ewoms::CollectDataToIORank< Vanguard > CollectDataToIORankType; - CollectDataToIORankType collectToIORank(simulator->vanguard()); - Ewoms::EclOutputBlackOilModule eclOutputModule(*simulator, collectToIORank); - - typedef Ewoms::EclWriter EclWriterType; - // create the actual ECL writer - std::unique_ptr eclWriter = std::unique_ptr(new EclWriterType(*simulator)); - - simulator->model().applyInitialSolution(); - Opm::data::Wells dw; - bool substep = false; - simulator->setEpisodeIndex(0); - eclWriter->writeOutput(substep); - simulator->setEpisodeIndex(1); - eclWriter->writeOutput(substep); - simulator->setEpisodeIndex(2); - eclWriter->writeOutput(substep); - - auto res = readsum( casename ); - const auto* resp = res.get(); - - // fpr = sum_ (p * hcpv ) / hcpv, hcpv = pv * (1 - sw) - const double fpr = ( (3 * 0.1 + 8 * 0.2) * 500 * (1 - 0.2) ) / ( (500*0.1 + 500*0.2) * (1 - 0.2)); - CHECK_CLOSE( fpr, ecl_sum_get_field_var( resp, 1, "FPR" ) , 1e-5 ); - - // foip = sum_ (b * s * pv), rs == 0; - const double foip = ( (0.3 * 0.1 + 0.8 * 0.2) * 500 * (1 - 0.2) ); - CHECK_CLOSE(foip, ecl_sum_get_field_var( resp, 1, "FOIP" ), 1e-3 ); - - // fgip = sum_ (b * pv * s), sg == 0; - const double fgip = 0.0; - CHECK_CLOSE(fgip, ecl_sum_get_field_var( resp, 1, "FGIP" ), 1e-3 ); - - // fgip = sum_ (b * pv * s), - const double fwip = 1.0/1000 * ( 0.1 + 0.2) * 500 * 0.2; - CHECK_CLOSE(fwip, ecl_sum_get_field_var( resp, 1, "FWIP" ), 1e-3 ); - - // region 1 - // rpr = sum_ (p * hcpv ) / hcpv, hcpv = pv * (1 - sw) - const double rpr1 = ( 2.5 * 0.1 * 400 * (1 - 0.2) ) / (400*0.1 * (1 - 0.2)); - CHECK_CLOSE( rpr1, ecl_sum_get_general_var( resp, 1, "RPR:1" ) , 1e-5 ); - // roip = sum_ (b * s * pv) // rs == 0; - const double roip1 = ( 0.25 * 0.1 * 400 * (1 - 0.2) ); - CHECK_CLOSE(roip1, ecl_sum_get_general_var( resp, 1, "ROIP:1" ), 1e-3 ); - - - // region 2 - // rpr = sum_ (p * hcpv ) / hcpv, hcpv = pv * (1 - sw) - const double rpr2 = ( (5 * 0.1 * 100 + 6 * 0.2 * 100) * (1 - 0.2) ) / ( (100*0.1 + 100*0.2) * (1 - 0.2)); - CHECK_CLOSE( rpr2, ecl_sum_get_general_var( resp, 1, "RPR:2" ) , 1e-5 ); - // roip = sum_ (b * s * pv) // rs == 0; - const double roip2 = ( (0.5 * 0.1 * 100 + 0.6 * 0.2 * 100) * (1 - 0.2) ); - CHECK_CLOSE(roip2, ecl_sum_get_general_var( resp, 1, "ROIP:2" ), 1e-3 ); -} - -void test_readWriteWells(); -void test_readWriteWells() -{ - using opt = Opm::data::Rates::opt; - - Opm::data::Rates r1, r2, rc1, rc2, rc3; - r1.set( opt::wat, 5.67 ); - r1.set( opt::oil, 6.78 ); - r1.set( opt::gas, 7.89 ); - - r2.set( opt::wat, 8.90 ); - r2.set( opt::oil, 9.01 ); - r2.set( opt::gas, 10.12 ); - - rc1.set( opt::wat, 20.41 ); - rc1.set( opt::oil, 21.19 ); - rc1.set( opt::gas, 22.41 ); - - rc2.set( opt::wat, 23.19 ); - rc2.set( opt::oil, 24.41 ); - rc2.set( opt::gas, 25.19 ); - - rc3.set( opt::wat, 26.41 ); - rc3.set( opt::oil, 27.19 ); - rc3.set( opt::gas, 28.41 ); - - Opm::data::Well w1, w2; - w1.rates = r1; - w1.bhp = 1.23; - w1.temperature = 3.45; - w1.control = 1; - - /* - * the connection keys (active indices) and well names correspond to the - * input deck. All other entries in the well structures are arbitrary. - */ - w1.connections.push_back( { 88, rc1, 30.45, 123.45, 0.0, 0.0, 0.0 } ); - w1.connections.push_back( { 288, rc2, 33.19, 67.89, 0.0, 0.0, 0.0 } ); - - w2.rates = r2; - w2.bhp = 2.34; - w2.temperature = 4.56; - w2.control = 2; - w2.connections.push_back( { 188, rc3, 36.22, 19.28, 0.0, 0.0, 0.0 } ); - - Opm::data::Wells wellRates; - - wellRates["OP_1"] = w1; - wellRates["OP_2"] = w2; - - typedef Dune :: Point2PointCommunicator< Dune :: SimpleMessageBuffer > P2PCommunicatorType; - typedef typename P2PCommunicatorType :: MessageBufferType MessageBufferType; - MessageBufferType buffer; - - wellRates.write(buffer); - - Opm::data::Wells wellRatesCopy; - wellRatesCopy.read(buffer); - - CHECK( wellRatesCopy.get( "OP_1" , opt::wat) , wellRates.get( "OP_1" , opt::wat)); - CHECK( wellRatesCopy.get( "OP_2" , 188 , opt::wat) , wellRates.get( "OP_2" , 188 , opt::wat)); -} - - -int main(int argc, char** argv) -{ -#if HAVE_DUNE_FEM - Dune::Fem::MPIManager::initialize(argc, argv); -#else - Dune::MPIHelper::instance(argc, argv); -#endif - - typedef TTAG(TestEclOutputTypeTag) TypeTag; - Ewoms::registerAllParameters_(); - test_summary(); - test_readWriteWells(); - - return 0; -} - - diff --git a/tests/test_equil.cc b/tests/test_equil.cc deleted file mode 100644 index 0fca5991a..000000000 --- a/tests/test_equil.cc +++ /dev/null @@ -1,1127 +0,0 @@ -// -*- 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 . - - 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" - -#include -#include -#include - -#include -#include - -#include - -#if HAVE_DUNE_FEM -#include -#else -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define CHECK(value, expected) \ - { \ - if ((value) != (expected)) \ - std::abort(); \ - } - -#define CHECK_CLOSE(value, expected, reltol) \ - { \ - if (std::fabs((expected) - (value)) > 1e-14 && \ - std::fabs(((expected) - (value))/((expected) + (value))) > reltol) \ - std::abort(); \ - } - -#define REQUIRE(cond) \ - { \ - if (!(cond)) \ - std::abort(); \ - } - -BEGIN_PROPERTIES - -NEW_TYPE_TAG(TestEquilTypeTag, INHERITS_FROM(BlackOilModel, EclBaseProblem)); - -END_PROPERTIES - -template -std::unique_ptr -initSimulator(const char *filename) -{ - typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator; - - std::string filenameArg = "--ecl-deck-file-name="; - filenameArg += filename; - - const char* argv[] = { - "test_equil", - filenameArg.c_str() - }; - - Ewoms::setupParameters_(/*argc=*/sizeof(argv)/sizeof(argv[0]), argv, /*registerParams=*/false); - - return std::unique_ptr(new Simulator); -} - -template -static void initDefaultFluidSystem() -{ - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - - std::vector > Bo = { - { 101353, 1. }, - { 6.21542e+07, 1 } - }; - std::vector > muo = { - { 101353, 1. }, - { 6.21542e+07, 1 } - }; - - std::vector > Bg = { - { 101353, 1. }, - { 6.21542e+07, 1 } - }; - std::vector > mug = { - { 101353, 1. }, - { 6.21542e+07, 1 } - }; - - double rhoRefO = 700; // [kg/m3] - double rhoRefG = 1000; // [kg/m3] - double rhoRefW = 1000; // [kg/m3] - - FluidSystem::initBegin(/*numPvtRegions=*/1); - FluidSystem::setEnableDissolvedGas(false); - FluidSystem::setEnableVaporizedOil(false); - FluidSystem::setReferenceDensities(rhoRefO, rhoRefW, rhoRefG, /*regionIdx=*/0); - - auto gasPvt = std::make_shared>(); - gasPvt->setApproach(Opm::GasPvtMultiplexer::DryGasPvt); - auto& dryGasPvt = gasPvt->getRealPvt::DryGasPvt>(); - dryGasPvt.setNumRegions(/*numPvtRegion=*/1); - dryGasPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW); - dryGasPvt.setGasFormationVolumeFactor(/*regionIdx=*/0, Bg); - dryGasPvt.setGasViscosity(/*regionIdx=*/0, mug); - - auto oilPvt = std::make_shared>(); - oilPvt->setApproach(Opm::OilPvtMultiplexer::DeadOilPvt); - auto& deadOilPvt = oilPvt->getRealPvt::DeadOilPvt>(); - deadOilPvt.setNumRegions(/*numPvtRegion=*/1); - deadOilPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW); - deadOilPvt.setInverseOilFormationVolumeFactor(/*regionIdx=*/0, Bo); - deadOilPvt.setOilViscosity(/*regionIdx=*/0, muo); - - auto waterPvt = std::make_shared>(); - waterPvt->setApproach(Opm::WaterPvtMultiplexer::ConstantCompressibilityWaterPvt); - auto& ccWaterPvt = waterPvt->getRealPvt::ConstantCompressibilityWaterPvt>(); - ccWaterPvt.setNumRegions(/*numPvtRegions=*/1); - ccWaterPvt.setReferenceDensities(/*regionIdx=*/0, rhoRefO, rhoRefG, rhoRefW); - ccWaterPvt.setViscosity(/*regionIdx=*/0, 1); - ccWaterPvt.setCompressibility(/*regionIdx=*/0, 0); - - gasPvt->initEnd(); - oilPvt->initEnd(); - waterPvt->initEnd(); - - FluidSystem::setGasPvt(std::move(gasPvt)); - FluidSystem::setOilPvt(std::move(oilPvt)); - FluidSystem::setWaterPvt(std::move(waterPvt)); - FluidSystem::initEnd(); -} - -static Opm::EquilRecord mkEquilRecord( double datd, double datp, - double zwoc, double pcow_woc, - double zgoc, double pcgo_goc ) -{ - using namespace Opm; - - DeckItem dd( "datdep", double() ); - dd.push_back( datd ); - Opm::Dimension dd_dim( "dddim", 1 ); - dd.push_backDimension( dd_dim, dd_dim ); - - DeckItem dp( "datps", double() ); - dp.push_back( datp ); - Opm::Dimension dp_dim( "dpdim", 1 ); - dp.push_backDimension( dp_dim, dp_dim ); - - DeckItem zw( "zwoc", double() ); - zw.push_back( zwoc ); - Opm::Dimension zw_dim( "zwdim", 1 ); - zw.push_backDimension( zw_dim, zw_dim ); - - DeckItem pcow( "pcow", double() ); - pcow.push_back( pcow_woc ); - Opm::Dimension pcow_dim( "pcowdim", 1 ); - pcow.push_backDimension( pcow_dim, pcow_dim ); - - DeckItem zg( "zgoc", double() ); - zg.push_back( zgoc ); - Opm::Dimension zg_dim( "zgdim", 1 ); - zg.push_backDimension( zg_dim, zg_dim ); - - DeckItem pcgo( "pcgo", double() ); - pcgo.push_back( pcgo_goc ); - Opm::Dimension pcgo_dim( "pcgodim", 1 ); - pcgo.push_backDimension( pcgo_dim, pcgo_dim ); - - DeckItem i1( "i1", int() ); - DeckItem i2( "i2", int() ); - DeckItem i3( "i3", int() ); - i1.push_back( 0 ); - i2.push_back( 0 ); - i3.push_back( 0 ); - - DeckRecord rec; - rec.addItem( std::move( dd ) ); - rec.addItem( std::move( dp ) ); - rec.addItem( std::move( zw ) ); - rec.addItem( std::move( pcow ) ); - rec.addItem( std::move( zg ) ); - rec.addItem( std::move( pcgo ) ); - rec.addItem( std::move( i1 ) ); - rec.addItem( std::move( i2 ) ); - rec.addItem( std::move( i3 ) ); - - return EquilRecord( rec ); -} - -void test_PhasePressure(); -void test_PhasePressure() -{ - typedef std::vector PVal; - typedef std::vector PPress; - - auto record = mkEquilRecord( 0, 1e5, 5, 0, 0, 0 ); - - typedef TTAG(TestEquilTypeTag) TypeTag; - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - auto simulator = initSimulator("data/equil_base.DATA"); - initDefaultFluidSystem(); - - Ewoms::EQUIL::EquilReg - region(record, - std::make_shared(), - std::make_shared(), - 0); - - std::vector cells(simulator->vanguard().grid().size(0)); - std::iota(cells.begin(), cells.end(), 0); - - const double grav = 10; - const PPress ppress = Ewoms::EQUIL::phasePressures(simulator->vanguard().grid(), region, cells, grav); - - const int first = 0, last = simulator->vanguard().grid().size(0) - 1; - const double reltol = 1.0e-8; - CHECK_CLOSE(ppress[0][first] , 90e3 , reltol); - CHECK_CLOSE(ppress[0][last ] , 180e3 , reltol); - CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol); - CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol); -} - -void test_CellSubset(); -void test_CellSubset() -{ - typedef std::vector PVal; - typedef std::vector PPress; - - typedef TTAG(TestEquilTypeTag) TypeTag; - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - auto simulator = initSimulator("data/equil_base.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - initDefaultFluidSystem(); - - Opm::EquilRecord record[] = { mkEquilRecord( 0, 1e5, 2.5, -0.075e5, 0, 0 ), - mkEquilRecord( 5, 1.35e5, 7.5, -0.225e5, 5, 0 ) }; - - Ewoms::EQUIL::EquilReg region[] = - { - Ewoms::EQUIL::EquilReg(record[0], - std::make_shared(), - std::make_shared(), - 0) - , - Ewoms::EQUIL::EquilReg(record[0], - std::make_shared(), - std::make_shared(), - 0) - , - Ewoms::EQUIL::EquilReg(record[1], - std::make_shared(), - std::make_shared(), - 0) - , - Ewoms::EQUIL::EquilReg(record[1], - std::make_shared(), - std::make_shared(), - 0) - }; - - const int cdim[] = { 2, 1, 2 }; - int ncoarse = cdim[0]; - for (std::size_t d = 1; d < 3; ++d) { ncoarse *= cdim[d]; } - - std::vector< std::vector > cells(ncoarse); - for (int c = 0; c < simulator->vanguard().grid().size(0); ++c) { - int ci = c; - const int i = ci % grid.cartdims[0]; ci /= grid.cartdims[0]; - const int j = ci % grid.cartdims[1]; - const int k = ci / grid.cartdims[1]; - - const int ic = (i / (grid.cartdims[0] / cdim[0])); - const int jc = (j / (grid.cartdims[1] / cdim[1])); - const int kc = (k / (grid.cartdims[2] / cdim[2])); - const int ix = ic + cdim[0]*(jc + cdim[1]*kc); - - assert ((0 <= ix) && (ix < ncoarse)); - cells[ix].push_back(c); - } - - PPress ppress(2, PVal(simulator->vanguard().grid().size(0), 0)); - for (std::vector< std::vector >::const_iterator - r = cells.begin(), e = cells.end(); - r != e; ++r) - { - const int rno = int(r - cells.begin()); - const double grav = 10; - const PPress p = - Ewoms::EQUIL::phasePressures(simulator->vanguard().grid(), region[rno], *r, grav); - - PVal::size_type i = 0; - for (std::vector::const_iterator - c = r->begin(), ce = r->end(); - c != ce; ++c, ++i) - { - assert (i < p[0].size()); - - ppress[0][*c] = p[0][i]; - ppress[1][*c] = p[1][i]; - } - } - - const int first = 0, last = simulator->vanguard().grid().size(0) - 1; - const double reltol = 1.0e-8; - CHECK_CLOSE(ppress[0][first] , 105e3 , reltol); - CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol); - CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol); - CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol); -} - -void test_RegMapping(); -void test_RegMapping() -{ - typedef std::vector PVal; - typedef std::vector PPress; - - Opm::EquilRecord record[] = { mkEquilRecord( 0, 1e5, 2.5, -0.075e5, 0, 0 ), - mkEquilRecord( 5, 1.35e5, 7.5, -0.225e5, 5, 0 ) }; - - typedef TTAG(TestEquilTypeTag) TypeTag; - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - auto simulator = initSimulator("data/equil_base.DATA"); - initDefaultFluidSystem(); - - Ewoms::EQUIL::EquilReg region[] = - { - Ewoms::EQUIL::EquilReg(record[0], - std::make_shared(), - std::make_shared(), - 0) - , - Ewoms::EQUIL::EquilReg(record[0], - std::make_shared(), - std::make_shared(), - 0) - , - Ewoms::EQUIL::EquilReg(record[1], - std::make_shared(), - std::make_shared(), - 0) - , - Ewoms::EQUIL::EquilReg(record[1], - std::make_shared(), - std::make_shared(), - 0) - }; - - std::vector eqlnum(simulator->vanguard().grid().size(0)); - // [ 0 1; 2 3] - { - for (int i = 0; i < 5; ++i) { - for (int j = 0; j < 5; ++j) { - eqlnum[i*10 + j] = 0; - } - for (int j = 5; j < 10; ++j) { - eqlnum[i*10 + j] = 1; - } - } - for (int i = 5; i < 10; ++i) { - for (int j = 0; j < 5; ++j) { - eqlnum[i*10 + j] = 2; - } - for (int j = 5; j < 10; ++j) { - eqlnum[i*10 + j] = 3; - } - } - } - - Ewoms::RegionMapping<> eqlmap(eqlnum); - - PPress ppress(2, PVal(simulator->vanguard().grid().size(0), 0)); - for (const auto& r : eqlmap.activeRegions()) { - const auto& rng = eqlmap.cells(r); - - const int rno = r; - const double grav = 10; - const PPress p = - Ewoms::EQUIL::phasePressures(simulator->vanguard().grid(), region[rno], rng, grav); - - PVal::size_type i = 0; - for (const auto& c : rng) { - assert (i < p[0].size()); - - ppress[0][c] = p[0][i]; - ppress[1][c] = p[1][i]; - - ++i; - } - } - - const int first = 0, last = simulator->vanguard().grid().size(0) - 1; - const double reltol = 1.0e-8; - CHECK_CLOSE(ppress[0][first] , 105e3 , reltol); - CHECK_CLOSE(ppress[0][last ] , 195e3 , reltol); - CHECK_CLOSE(ppress[1][first] , 103.5e3 , reltol); - CHECK_CLOSE(ppress[1][last ] , 166.5e3 , reltol); -} - -void test_DeckAllDead(); -void test_DeckAllDead() -{ - typedef TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_deadfluids.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 10.0); - const auto& pressures = comp.press(); - REQUIRE(pressures.size() == 3); - REQUIRE(int(pressures[0].size()) == grid.number_of_cells); - - const int first = 0, last = grid.number_of_cells - 1; - // The relative tolerance is too loose to be very useful, - // but the answer we are checking is the result of an ODE - // solver, and it is unclear if we should check it against - // the true answer or something else. - const double reltol = 1.0e-3; - CHECK_CLOSE(pressures[0][first] , 1.496329839e7 , reltol); - CHECK_CLOSE(pressures[0][last ] , 1.504526940e7 , reltol); - CHECK_CLOSE(pressures[1][last] , 1.504526940e7 , reltol); -} - -void test_CapillaryInversion(); -void test_CapillaryInversion() -{ - // Test setup. - typedef typename TTAG(TestEquilTypeTag) TypeTag; - typedef typename GET_PROP_TYPE(TypeTag, FluidSystem) FluidSystem; - typedef typename GET_PROP_TYPE(TypeTag, MaterialLaw) MaterialLaw; - typedef typename GET_PROP(TypeTag, MaterialLaw)::EclMaterialLawManager MaterialLawManager; - auto simulator = initSimulator("data/equil_capillary.DATA"); - - // Test the capillary inversion for oil-water. - const int cell = 0; - const double reltol = 1.0e-7; - { - const int phase = 0; - const bool increasing = false; - const std::vector pc = { 10.0e5, 0.5e5, 0.4e5, 0.3e5, 0.2e5, 0.1e5, 0.099e5, 0.0e5, -10.0e5 }; - const std::vector s = { 0.2, 0.2, 0.2, 0.466666666666, 0.733333333333, 1.0, 1.0, 1.0, 1.0 }; - REQUIRE(pc.size() == s.size()); - for (size_t i = 0; i < pc.size(); ++i) { - const double s_computed = Ewoms::EQUIL::satFromPc(*simulator->problem().materialLawManager(), phase, cell, pc[i], increasing); - CHECK_CLOSE(s_computed, s[i], reltol); - } - } - - // Test the capillary inversion for gas-oil. - { - const int phase = 2; - const bool increasing = true; - const std::vector pc = { 10.0e5, 0.6e5, 0.5e5, 0.4e5, 0.3e5, 0.2e5, 0.1e5, 0.0e5, -10.0e5 }; - const std::vector s = { 0.8, 0.8, 0.8, 0.533333333333, 0.266666666666, 0.0, 0.0, 0.0, 0.0 }; - REQUIRE(pc.size() == s.size()); - for (size_t i = 0; i < pc.size(); ++i) { - const double s_computed = Ewoms::EQUIL::satFromPc(*simulator->problem().materialLawManager(), phase, cell, pc[i], increasing); - CHECK_CLOSE(s_computed, s[i], reltol); - } - } - - // Test the capillary inversion for gas-water. - { - const int water = 0; - const int gas = 2; - const std::vector pc = { 0.9e5, 0.8e5, 0.6e5, 0.4e5, 0.3e5 }; - const std::vector s = { 0.2, 0.333333333333, 0.6, 0.866666666666, 1.0 }; - REQUIRE(pc.size() == s.size()); - for (size_t i = 0; i < pc.size(); ++i) { - const double s_computed = Ewoms::EQUIL::satFromSumOfPcs(*simulator->problem().materialLawManager(), water, gas, cell, pc[i]); - CHECK_CLOSE(s_computed, s[i], reltol); - } - } -} - -void test_DeckWithCapillary(); -void test_DeckWithCapillary() -{ - typedef typename TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_capillary.DATA"); - auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 10.0); - - const auto& pressures = comp.press(); - REQUIRE(pressures.size() == 3); - REQUIRE(int(pressures[0].size()) == grid.number_of_cells); - - const int first = 0, last = grid.number_of_cells - 1; - // The relative tolerance is too loose to be very useful, - // but the answer we are checking is the result of an ODE - // solver, and it is unclear if we should check it against - // the true answer or something else. - const double reltol = 1.0e-6; - CHECK_CLOSE(pressures[0][first] , 1.469769063e7 , reltol); - CHECK_CLOSE(pressures[0][last ] , 15452880.328284413 , reltol); - CHECK_CLOSE(pressures[1][last] , 15462880.328284413 , reltol); - - const auto& sats = comp.saturation(); - const std::vector s[3]{ - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.42190294373815257, 0.77800802072306474, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0.0073481611123183965, 0.79272270823081337, 0.8, 0.8, 0.8, 0.8, 0.57809705626184749, 0.22199197927693526, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.79265183888768165, 0.0072772917691866562, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - for (int phase = 0; phase < 3; ++phase) { - REQUIRE(sats[phase].size() == s[phase].size()); - for (size_t i = 0; i < s[phase].size(); ++i) { - CHECK_CLOSE(sats[phase][i], s[phase][i], reltol); - } - } -} - -void test_DeckWithCapillaryOverlap(); -void test_DeckWithCapillaryOverlap() -{ - typedef typename TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_capillary_overlap.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); - const auto& pressures = comp.press(); - REQUIRE(pressures.size() == 3); - REQUIRE(int(pressures[0].size()) == grid.number_of_cells); - - const int first = 0, last = grid.number_of_cells - 1; - // The relative tolerance is too loose to be very useful, - // but the answer we are checking is the result of an ODE - // solver, and it is unclear if we should check it against - // the true answer or something else. - const double reltol = 1.0e-6; - const double reltol_ecl = 1.0; - CHECK_CLOSE(pressures[0][first], 1.48324e+07, reltol_ecl); // eclipse - CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][first], 1.49224e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl); - - CHECK_CLOSE(pressures[0][first] , 14832467.14, reltol); // opm - CHECK_CLOSE(pressures[0][last ] , 15479883.47, reltol); - CHECK_CLOSE(pressures[1][last ] , 15489883.47, reltol); - - const auto& sats = comp.saturation(); - // std::cout << "Saturations:\n"; - // for (const auto& sat : sats) { - // for (const double s : sat) { - // std::cout << s << ' '; - // } - // std::cout << std::endl; - // } - - const std::vector s_ecl[3]{// eclipse - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.22874042, 0.53397995, 0.78454906, 0.91542006, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.20039, 0.08458, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77125955, 0.46602005, 0.015063271, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - - const std::vector s_opm[3]{ // opm - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.22892931226886132, 0.53406457830052489, 0.78457075254244724, 0.91539712466977541, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.20023624994125844, 0.084602875330224592, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77107068773113863, 0.46593542169947511, 0.015192997516294321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - for (int phase = 0; phase < 3; ++phase) { - REQUIRE(sats[phase].size() == s_opm[phase].size()); - for (size_t i = 0; i < s_opm[phase].size(); ++i) { - //std::cout << std::setprecision(10) << sats[phase][i] << '\n'; - CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl); - CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol); - } - } -} - -void test_DeckWithLiveOil(); -void test_DeckWithLiveOil() -{ - typedef typename TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_liveoil.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - // Initialize the fluid system - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); - const auto& pressures = comp.press(); - REQUIRE(pressures.size() == 3); - REQUIRE(int(pressures[0].size()) == grid.number_of_cells); - - const int first = 0, last = grid.number_of_cells - 1; - // The relative tolerance is too loose to be very useful, - // but the answer we are checking is the result of an ODE - // solver, and it is unclear if we should check it against - // the true answer or something else. - const double reltol = 1.0e-6; - const double reltol_ecl = 1.0; - CHECK_CLOSE(pressures[0][first], 1.48324e+07, reltol_ecl); // eclipse - CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][first], 1.49224e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl); - - CHECK_CLOSE(pressures[0][first], 1.483246714e7, reltol); // opm - CHECK_CLOSE(pressures[0][last], 1.547991652e7, reltol); - CHECK_CLOSE(pressures[1][first], 1.492246714e7, reltol); - CHECK_CLOSE(pressures[1][last], 1.548991652e7, reltol); - - const auto& sats = comp.saturation(); - // std::cout << "Saturations:\n"; - // for (const auto& sat : sats) { - // for (const double s : sat) { - // std::cout << s << ' '; - // } - // std::cout << std::endl; - // } - const std::vector s_ecl[3]{ // eclipse - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.22898, 0.53422, 0.78470, 0.91531, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.20073, 0.08469, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77102, 0.46578, 0.01458, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - const std::vector s_opm[3]{ // opm - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.22916963446461344, 0.53430490523774521, 0.78471886612242092, 0.91528324362210933, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.20057438297017782, 0.084716756377890667, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77083036553538653, 0.46569509476225479, 0.014706750907401245, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - for (int phase = 0; phase < 3; ++phase) { - REQUIRE(sats[phase].size() == s_opm[phase].size()); - for (size_t i = 0; i < s_opm[phase].size(); ++i) { - //std::cout << std::setprecision(10) << sats[phase][i] << '\n'; - CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol); - CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl); - } - std::cout << std::endl; - } - - const auto& rs = comp.rs(); - const std::vector rs_opm {74.61233568, 74.64905212, 74.68578656, 74.72253902, // opm - 74.75930951, 74.79609803, 74.83290459, 74.87519876, - 74.96925416, 75.09067512, 75.0, 75.0, - 75.0, 75.0, 75.0, 75.0, - 75.0, 75.0, 75.0, 75.0}; - const std::vector rs_ecl {74.612228, 74.648956, 74.685707, 74.722473, // eclipse - 74.759254, 74.796051, 74.832870, 74.875145, - 74.969231, 75.090706, 75.000000, 75.000000, - 75.000000, 75.000000, 75.000000, 75.000000, - 75.000000, 75.000000, 75.000000, 75.000000}; - for (size_t i = 0; i < rs_opm.size(); ++i) { - //std::cout << std::setprecision(10) << rs[i] << '\n'; - CHECK_CLOSE(rs[i], rs_opm[i], reltol); - CHECK_CLOSE(rs[i], rs_ecl[i], reltol_ecl); - } -} - -void test_DeckWithLiveGas(); -void test_DeckWithLiveGas() -{ - typedef typename TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_livegas.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); - const auto& pressures = comp.press(); - REQUIRE(pressures.size() == 3); - REQUIRE(int(pressures[0].size()) == grid.number_of_cells); - - const int first = 0, last = grid.number_of_cells - 1; - // The relative tolerance is too loose to be very useful, - // but the answer we are checking is the result of an ODE - // solver, and it is unclear if we should check it against - // the true answer or something else. - const double reltol = 1.0e-3; - const double reltol_ecl = 1.0; - CHECK_CLOSE(pressures[0][first], 1.48215e+07, reltol_ecl); // eclipse - CHECK_CLOSE(pressures[0][last], 1.54801e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][first], 1.49115e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][last], 1.54901e+07, reltol_ecl); - - CHECK_CLOSE(pressures[0][first], 1.482150311e7, reltol); // opm - CHECK_CLOSE(pressures[0][last], 1.547988347e7, reltol); - CHECK_CLOSE(pressures[1][first], 1.491150311e7, reltol); - CHECK_CLOSE(pressures[1][last], 1.548988347e7, reltol); - - const auto& sats = comp.saturation(); - // std::cout << "Saturations:\n"; - // for (const auto& sat : sats) { - // for (const double s : sat) { - // std::cout << s << ' '; - // } - // std::cout << std::endl; - // } - const std::vector s_ecl[3]{ // eclipse - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.24285614, 0.53869015, 0.78454906, 0.91542006, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.18311, 0.08458, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.75714386, 0.46130988, 0.032345835, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - - const std::vector s_opm[3]{ // opm - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.24310545, 0.5388, 0.78458, 0.91540, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.18288667, 0.0846, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.75689455, 0.4612, 0.03253333, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - for (int phase = 0; phase < 3; ++phase) { - REQUIRE(sats[phase].size() == s_opm[phase].size()); - for (size_t i = 0; i < s_opm[phase].size(); ++i) { - //std::cout << std::setprecision(10) << sats[phase][i] << '\n'; - CHECK_CLOSE(sats[phase][i], s_opm[phase][i], 100.*reltol); - CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl); - } - std::cout << std::endl; - } - - const auto& rv = comp.rv(); - const std::vector rv_opm { // opm - 2.4884509e-4, 2.4910378e-4, 2.4936267e-4, 2.4962174e-4, - 2.4988100e-4, 2.5014044e-4, 2.5040008e-4, 2.5065990e-4, - 2.5091992e-4, 2.5118012e-4, 2.5223082e-4, 2.5105e-4, - 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4, - 2.5105e-4, 2.5105e-4, 2.5105e-4, 2.5105e-4}; - - const std::vector rv_ecl { // eclipse - 0.24884584E-03, 0.24910446E-03, 0.24936325E-03, 0.24962222E-03, - 0.24988138E-03, 0.25014076E-03, 0.25040031E-03, 0.25066003E-03, - 0.25091995E-03, 0.25118008E-03, 0.25223137E-03, 0.25104999E-03, - 0.25104999E-03, 0.25104999E-03, 0.25104999E-03, 0.25104999E-03, - 0.25104999E-03, 0.25104999E-03, 0.25104999E-03, 0.25104999E-03}; - - for (size_t i = 0; i < rv_opm.size(); ++i) { - CHECK_CLOSE(rv[i], rv_opm[i], reltol); - CHECK_CLOSE(rv[i], rv_ecl[i], reltol_ecl); - } -} - -void test_DeckWithRSVDAndRVVD(); -void test_DeckWithRSVDAndRVVD() -{ - typedef typename TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_rsvd_and_rvvd.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); - const auto& pressures = comp.press(); - REQUIRE(pressures.size() == 3); - REQUIRE(int(pressures[0].size()) == grid.number_of_cells); - - const int first = 0, last = grid.number_of_cells - 1; - // The relative tolerance is too loose to be very useful, - // but the answer we are checking is the result of an ODE - // solver, and it is unclear if we should check it against - // the true answer or something else. - const double reltol = 1.0e-6; - const double reltol_ecl = 1.0; - CHECK_CLOSE(pressures[0][first], 1.48350e+07, reltol_ecl); // eclipse - CHECK_CLOSE(pressures[0][last], 1.54794e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][first], 1.49250e+07, reltol_ecl); - CHECK_CLOSE(pressures[1][last], 1.54894e+07, reltol_ecl); - - CHECK_CLOSE(pressures[0][first], 1.483499660e7, reltol); // opm - CHECK_CLOSE(pressures[0][last], 1.547924516e7, reltol); - CHECK_CLOSE(pressures[1][first], 1.492499660e7, reltol); - CHECK_CLOSE(pressures[1][last], 1.548924516e7, reltol); - - const auto& sats = comp.saturation(); - // std::cout << "Saturations:\n"; - // for (const auto& sat : sats) { - // for (const double s : sat) { - // std::cout << s << ' '; - // } - // std::cout << std::endl; - // } - const std::vector s_ecl[3]{ // eclipse - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.22206347, 0.52871972, 0.78150368, 0.91819441, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.19656529, 0.081805572, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77793652, 0.47128031, 0.021931054, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - - const std::vector s_opm[3]{ // opm - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.22231423543119974, 0.52882640735211706, 0.78152142505479982, 0.91816512259416283, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.19636279642563928, 0.08183487740583717, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.77768576456880023, 0.47117359264788294, 0.022115778519560897, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - - for (int phase = 0; phase < 3; ++phase) { - REQUIRE(sats[phase].size() == s_opm[phase].size()); - for (size_t i = 0; i < s_opm[phase].size(); ++i) { - //std::cout << std::setprecision(10) << sats[phase][i] << '\n'; - CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol); - CHECK_CLOSE(sats[phase][i], s_ecl[phase][i], reltol_ecl); - } - std::cout << std::endl; - } - - const auto& rs = comp.rs(); - const std::vector rs_opm { // opm - 74.62498302, 74.65959041, 74.69438035, 74.72935336, - 74.76450995, 74.79985061, 74.83537588, 74.87527065, - 74.96863769, 75.08891765, 52.5, 57.5, - 62.5, 67.5, 72.5, 76.45954841, - 76.70621045, 76.95287736, 77.19954913, 77.44622578}; - - const std::vector rs_ecl { // eclipse - 74.625114, 74.659706, 74.694481, 74.729439, - 74.764580, 74.799904, 74.835419, 74.875252, - 74.968628, 75.088951, 52.500000, 57.500000, - 62.500000, 67.500000, 72.500000, 76.168388, - 76.349953, 76.531532, 76.713142, 76.894775,}; - - const auto& rv = comp.rv(); - const std::vector rv_opm { // opm - 2.50e-6, 7.50e-6, 1.25e-5, 1.75e-5, - 2.25e-5, 2.75e-5, 3.25e-5, 3.75e-5, - 4.25e-5, 2.51158386e-4, 2.52203372e-4, 5.75e-5, - 6.25e-5, 6.75e-5, 7.25e-5, 7.75e-5, - 8.25e-5, 8.75e-5, 9.25e-5, 9.75e-5}; - - const std::vector rv_ecl { // eclipse - 0.24999999E-05, 0.74999998E-05, 0.12500000E-04, 0.17500000E-04, - 0.22500000E-04, 0.27500000E-04, 0.32500000E-04, 0.37500002E-04, - 0.42500000E-04, 0.25115837E-03, 0.25220393E-03, 0.57500001E-04, - 0.62500003E-04, 0.67499997E-04, 0.72499999E-04, 0.77500001E-04, - 0.82500002E-04, 0.87499997E-04, 0.92499999E-04, 0.97500000E-04}; - - for (size_t i = 0; i < rv_opm.size(); ++i) { - //std::cout << std::setprecision(10) << rs[i] << '\n'; - CHECK_CLOSE(rs[i], rs_opm[i], reltol); - CHECK_CLOSE(rs[i], rs_ecl[i], reltol_ecl); - CHECK_CLOSE(rv[i], rv_opm[i], reltol); - CHECK_CLOSE(rv[i], rv_ecl[i], reltol_ecl); - } -} - - -void test_DeckWithPBVDAndPDVD(); -void test_DeckWithPBVDAndPDVD() -{ - typedef typename TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_pbvd_and_pdvd.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - Ewoms::EQUIL::DeckDependent::InitialStateComputer comp(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.80665); - const auto& pressures = comp.press(); - REQUIRE(pressures.size() == 3); - REQUIRE(int(pressures[0].size()) == grid.number_of_cells); - - const int first = 0, last = grid.number_of_cells - 1; - // The relative tolerance is too loose to be very useful, - // but the answer we are checking is the result of an ODE - // solver, and it is unclear if we should check it against - // the true answer or something else. - const double reltol = 1.0e-6; - CHECK_CLOSE(pressures[0][first], 14821552, reltol); - CHECK_CLOSE(pressures[0][last], 15479828, reltol); - CHECK_CLOSE(pressures[1][first], 14911552, reltol); - CHECK_CLOSE(pressures[1][last], 15489828, reltol); - - const auto& sats = comp.saturation(); - // std::cout << "Saturations:\n"; - // for (const auto& sat : sats) { - // for (const double s : sat) { - // std::cout << s << ' '; - // } - // std::cout << std::endl; - // } - - const std::vector s_opm[3]{ // opm - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2426402656423233, 0.5383705390740118, 0.7844998821510003, 0.9152832369551807, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.1817779931230221, 0.08471676304481934, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.7573597343576767, 0.4616294609259882, 0.03372212472597758, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - - for (int phase = 0; phase < 3; ++phase) { - REQUIRE(sats[phase].size() == s_opm[phase].size()); - for (size_t i = 0; i < s_opm[phase].size(); ++i) { - //std::cout << std::setprecision(10) << sats[phase][i] << '\n'; - CHECK_CLOSE(sats[phase][i], s_opm[phase][i], reltol); - } - } - - const auto& rs = comp.rs(); - const std::vector rs_opm { // opm - 74.55776480956456, - 74.6008507125663, - 74.6439680789467, - 74.68711693934459, - 74.73029732443825, - 74.77350926494491, - 74.81675279162118, - 74.86802321984302, - 74.96677993174352, - 75.09034523640406, - 75, 75, 75,75,75, 75, 75, 75, 75, 75 }; - - const auto& rv = comp.rv(); - const std::vector rv_opm { - 0.0002488465888573874, - 0.0002491051042753978, - 0.0002493638084736803, - 0.0002496227016360676, - 0.0002498817839466295, - 0.00025, - 0.00025, - 0.00025, - 0.00025, - 0.000251180039180951, - 0.0002522295187440788, - 0.0002275000000000001, - 0.0002125, - 0.0001975, - 0.0001825, - 0.0001675, - 0.0001525, - 0.0001375, - 0.0001225, - 0.0001075}; - - for (size_t i = 0; i < rv_opm.size(); ++i) { - CHECK_CLOSE(rs[i], rs_opm[i], reltol); - CHECK_CLOSE(rv[i], rv_opm[i], reltol); - } -} - -void test_DeckWithSwatinit(); -void test_DeckWithSwatinit() -{ -#if 0 - typedef typename TTAG(TestEquilTypeTag) TypeTag; - auto simulator = initSimulator("data/equil_capillary_swatinit.DATA"); - const auto& eclipseState = simulator->vanguard().eclState(); - Opm::GridManager gm(eclipseState.getInputGrid()); - const UnstructuredGrid& grid = *(gm.c_grid()); - - // Create material law manager. - std::vector compressedToCartesianIdx - = Opm::compressedToCartesian(grid.number_of_cells, grid.global_cell); - MaterialLawManager materialLawManager = MaterialLawManager(); - materialLawManager.initFromDeck(deck, eclipseState, compressedToCartesianIdx); - - MaterialLawManager materialLawManagerScaled = MaterialLawManager(); - materialLawManagerScaled.initFromDeck(deck, eclipseState, compressedToCartesianIdx); - - // reference saturations - const std::vector s[3]{ - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.42528761746004229, 0.77462669821009045, 1, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0.014813991154779993, 0.78525420807446045, 0.8, 0.8, 0.8, 0.8, 0.57471238253995771, 0.22537330178990955, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.78518600884522005, 0.014745791925539575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - // sw in cell 1-5 is forced to be 0.2 since swl=0.2 - // sw in cell 13 and 14 is forced to be swu=1 since P_oil - P_wat < 0. - const std::vector swatinit[3]{ - { 0.2, 0.2, 0.2, 0.2, 0.2, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 1, 1, 1, 1, 1, 1, 1, 1 }, - { 0, 0, 0, 0.014813991154779993, 0.78525420807446045, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 0.8, 0.8, 0.8, 0.78518600884522005, 0.014745791925539575, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } - }; - - // Adjust oil pressure according to gas saturation and cap pressure - typedef Opm::SimpleModularFluidState SatOnlyFluidState; - - SatOnlyFluidState fluidState; - typedef MaterialLawManager::MaterialLaw MaterialLaw; - - // Initialize the fluid system - FluidSystem::initFromDeck(deck, eclipseState); - - // reference pcs - const int numCells = Opm::UgGridHelpers::numCells(grid); - std::vector pc_original(numCells * FluidSystem::numPhases); - for (int c = 0; c < numCells; ++c) { - std::vector pc = {0,0,0}; - double sw = s[0][c]; - double so = s[1][c]; - double sg = s[2][c]; - fluidState.setSaturation(FluidSystem::waterPhaseIdx, sw); - fluidState.setSaturation(FluidSystem::oilPhaseIdx, so); - fluidState.setSaturation(FluidSystem::gasPhaseIdx, sg); - const auto& matParams = materialLawManager.materialLawParams(c); - MaterialLaw::capillaryPressures(pc, matParams, fluidState); - pc_original[3*c + 0] = pc[FluidSystem::oilPhaseIdx] - pc[FluidSystem::waterPhaseIdx]; - pc_original[3*c + 1] = 0.0; - pc_original[3*c + 2] = pc[FluidSystem::oilPhaseIdx] + pc[FluidSystem::gasPhaseIdx]; - } - - std::vector pc_scaled_truth = pc_original; - - // modify pcow for cell 1 - 12 (where sw is changed due to swatinit) - // for the reference scaled pc. - pc_scaled_truth[3*0 + 0] = 150031.3; - pc_scaled_truth[3*1 + 0] = 136815.6; - pc_scaled_truth[3*2 + 0] = 123612.7; - pc_scaled_truth[3*3 + 0] = 110422.7; - pc_scaled_truth[3*4 + 0] = 97245.4; - pc_scaled_truth[3*5 + 0] = 84081; - pc_scaled_truth[3*6 + 0] = 70929; - pc_scaled_truth[3*7 + 0] = 57791; - pc_scaled_truth[3*8 + 0] = 44665; - pc_scaled_truth[3*9 + 0] = 31552; - pc_scaled_truth[3*10 + 0] = 18451.5; - pc_scaled_truth[3*11 + 0] = 5364.1; - - // compute the initial state - // apply swatinit - Ewoms::EQUIL::DeckDependent::InitialStateComputer compScaled(materialLawManagerScaled, eclipseState, simulator->vanguard().grid(), 9.81, true); - // don't apply swatinit - Ewoms::EQUIL::DeckDependent::InitialStateComputer compUnscaled(*simulator->problem().materialLawManager(), eclipseState, simulator->vanguard().grid(), 9.81, false); - - // compute pc - std::vector pc_scaled(numCells * FluidSystem::numPhases); - for (int c = 0; c < numCells; ++c) { - std::vector pc = {0,0,0}; - double sw = compScaled.saturation().data()[0][c]; - double so = compScaled.saturation().data()[1][c]; - double sg = compScaled.saturation().data()[2][c]; - - fluidState.setSaturation(FluidSystem::waterPhaseIdx, sw); - fluidState.setSaturation(FluidSystem::oilPhaseIdx, so); - fluidState.setSaturation(FluidSystem::gasPhaseIdx, sg); - const auto& matParams = materialLawManagerScaled.materialLawParams(c); - MaterialLaw::capillaryPressures(pc, matParams, fluidState); - pc_scaled[3*c + 0] = pc[FluidSystem::oilPhaseIdx] - pc[FluidSystem::waterPhaseIdx]; - pc_scaled[3*c + 1] = 0.0; - pc_scaled[3*c + 2] = pc[FluidSystem::oilPhaseIdx] + pc[FluidSystem::gasPhaseIdx]; - } - std::vector pc_unscaled(numCells * FluidSystem::numPhases); - for (int c = 0; c < numCells; ++c) { - std::vector pc = {0,0,0}; - double sw = compUnscaled.saturation().data()[0][c]; - double so = compUnscaled.saturation().data()[1][c]; - double sg = compUnscaled.saturation().data()[2][c]; - - fluidState.setSaturation(FluidSystem::waterPhaseIdx, sw); - fluidState.setSaturation(FluidSystem::oilPhaseIdx, so); - fluidState.setSaturation(FluidSystem::gasPhaseIdx, sg); - - const auto& matParams = materialLawManager.materialLawParams(c); - MaterialLaw::capillaryPressures(pc, matParams, fluidState); - pc_unscaled[3*c + 0] = pc[FluidSystem::oilPhaseIdx] - pc[FluidSystem::waterPhaseIdx]; - pc_unscaled[3*c + 1] = 0.0; - pc_unscaled[3*c + 2] = pc[FluidSystem::oilPhaseIdx] + pc[FluidSystem::gasPhaseIdx]; - } - - // test - const double reltol = 1.0e-3; - for (int phase = 0; phase < 3; ++phase) { - for (size_t i = 0; i < 20; ++i) { - CHECK_CLOSE( pc_original[3*i + phase ], pc_unscaled[3*i + phase ], reltol); - CHECK_CLOSE( pc_scaled_truth[3*i + phase], pc_scaled[3*i + phase ], reltol); - } - } - - for (int phase = 0; phase < 3; ++phase) { - for (size_t i = 0; i < 20; ++i) { - CHECK_CLOSE(compUnscaled.saturation()[phase][i], s[phase][i], reltol); - CHECK_CLOSE(compScaled.saturation()[phase][i], swatinit[phase][i], reltol); - } - } -#endif -} - -int main(int argc, char** argv) -{ -#if HAVE_DUNE_FEM - Dune::Fem::MPIManager::initialize(argc, argv); -#else - Dune::MPIHelper::instance(argc, argv); -#endif - - typedef TTAG(TestEquilTypeTag) TypeTag; - Ewoms::registerAllParameters_(); - - test_PhasePressure(); - test_CellSubset(); - test_RegMapping(); - test_DeckAllDead(); - test_CapillaryInversion(); - test_DeckWithCapillary(); - test_DeckWithCapillaryOverlap(); - test_DeckWithLiveOil(); - test_DeckWithLiveGas(); - test_DeckWithRSVDAndRVVD(); - test_DeckWithPBVDAndPDVD(); - //test_DeckWithSwatinit(); - - return 0; -}