Merge pull request #464 from joakim-hove/peaceman-formula

Peaceman formula
This commit is contained in:
Joakim Hove
2018-09-11 13:18:40 +02:00
committed by GitHub
19 changed files with 7822 additions and 315 deletions

435
tests/SPE1CASE1.DATA Normal file
View File

@@ -0,0 +1,435 @@
-- 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
---------------------------------------------------------------------------
------------------------ 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' 'WELSPECS' /
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

6758
tests/SPE9_CP_PACKED.DATA Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -27,7 +27,8 @@
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
@@ -36,6 +37,9 @@
#include <opm/parser/eclipse/EclipseState/Schedule/WellConnections.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Eclipse3DProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
namespace Opm {
@@ -54,22 +58,6 @@ inline std::ostream& operator<<( std::ostream& stream, const WellConnections& cs
BOOST_AUTO_TEST_CASE(testGetFunctions) {
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
Opm::Connection completion(10,11,12, 1, 0.0, Opm::WellCompletion::OPEN,Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",17.29), 0, dir);
BOOST_CHECK_EQUAL( 10 , completion.getI() );
BOOST_CHECK_EQUAL( 11 , completion.getJ() );
BOOST_CHECK_EQUAL( 12 , completion.getK() );
BOOST_CHECK_EQUAL( Opm::WellCompletion::OPEN , completion.state);
BOOST_CHECK_EQUAL( 99.88 , completion.getConnectionTransmissibilityFactor());
BOOST_CHECK_EQUAL( 22.33 , completion.getDiameter());
BOOST_CHECK_EQUAL( 33.22 , completion.getSkinFactor());
BOOST_CHECK_CLOSE( 17.29 , completion.getEffectiveKhAsValueObject().getValue() , 1.0e-10);
BOOST_CHECK_EQUAL( 0 , completion.sat_tableId);
}
BOOST_AUTO_TEST_CASE(CreateWellConnectionsOK) {
Opm::WellConnections completionSet;
@@ -81,9 +69,9 @@ BOOST_AUTO_TEST_CASE(CreateWellConnectionsOK) {
BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
Opm::WellConnections completionSet;
Opm::Connection completion1( 10,10,10, 1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",2.718), 0, dir);
Opm::Connection completion2( 11,10,10, 1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",3.141), 0, dir);
completionSet.add( completion1 );
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , 99.88, 355.113, 0.25, 0, dir);
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::WellCompletion::SHUT , 99.88, 355.113, 0.25, 0, dir);
completionSet.add( completion1 );
BOOST_CHECK_EQUAL( 1U , completionSet.size() );
completionSet.add( completion2 );
@@ -95,9 +83,9 @@ BOOST_AUTO_TEST_CASE(AddCompletionSizeCorrect) {
BOOST_AUTO_TEST_CASE(WellConnectionsGetOutOfRangeThrows) {
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , 99.88, 355.113, 0.25, 0, dir);
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::WellCompletion::SHUT , 99.88, 355.113, 0.25, 0, dir);
Opm::WellConnections completionSet;
Opm::Connection completion1( 10,10,10,1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",17.29), 0, dir);
Opm::Connection completion2( 11,10,10,1, 0.0,Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",355.113), 0, dir);
completionSet.add( completion1 );
BOOST_CHECK_EQUAL( 1U , completionSet.size() );
@@ -115,9 +103,9 @@ BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
Opm::WellConnections completionSet;
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",355.113), 0, dir);
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",355.113), 0, dir);
Opm::Connection completion3( 10,10,12, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",355.113), 0, dir);
Opm::Connection completion1( 10,10,10, 1, 0.0, Opm::WellCompletion::OPEN , 99.88, 355.113, 0.25, 0, dir);
Opm::Connection completion2( 10,10,11, 1, 0.0, Opm::WellCompletion::SHUT , 99.88, 355.113, 0.25, 0, dir);
Opm::Connection completion3( 10,10,12, 1, 0.0, Opm::WellCompletion::SHUT , 99.88, 355.113, 0.25, 0, dir);
completionSet.add( completion1 );
completionSet.add( completion2 );
@@ -134,12 +122,12 @@ BOOST_AUTO_TEST_CASE(AddCompletionCopy) {
BOOST_AUTO_TEST_CASE(ActiveCompletions) {
Opm::EclipseGrid grid(10,10,10);
Opm::EclipseGrid grid(10,20,20);
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
Opm::WellConnections completions;
Opm::Connection completion1( 0,0,0, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",355.113), 0, dir);
Opm::Connection completion2( 0,0,1, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",355.113), 0, dir);
Opm::Connection completion3( 0,0,2, 1, 0.0, Opm::WellCompletion::SHUT , Opm::Value<double>("ConnectionTransmissibilityFactor",99.88), Opm::Value<double>("D",22.33), Opm::Value<double>("SKIN",33.22), Opm::Value<double>("Kh",355.113), 0, dir);
Opm::Connection completion1( 0,0,0, 1, 0.0, Opm::WellCompletion::OPEN , 99.88, 355.113, 0.25, 0, dir);
Opm::Connection completion2( 0,0,1, 1, 0.0, Opm::WellCompletion::SHUT , 99.88, 355.113, 0.25, 0, dir);
Opm::Connection completion3( 0,0,2, 1, 0.0, Opm::WellCompletion::SHUT , 99.88, 355.113, 0.25, 0, dir);
completions.add( completion1 );
completions.add( completion2 );
@@ -154,3 +142,187 @@ BOOST_AUTO_TEST_CASE(ActiveCompletions) {
BOOST_CHECK_EQUAL( completion2, active_completions.get(0));
BOOST_CHECK_EQUAL( completion3, active_completions.get(1));
}
Opm::WellConnections loadCOMPDAT(const std::string& compdat_keyword) {
Opm::EclipseGrid grid(10,10,10);
Opm::TableManager tables;
Opm::Parser parser;
const auto deck = parser.parseString(compdat_keyword, Opm::ParseContext());
Opm::Eclipse3DProperties props(deck, tables, grid );
const auto& keyword = deck.getKeyword("COMPDAT", 0);
Opm::WellConnections connections;
for (const auto& rec : keyword)
connections.loadCOMPDAT(rec, grid, props);
return connections;
}
BOOST_AUTO_TEST_CASE(loadCOMPDATTEST) {
Opm::UnitSystem units(Opm::UnitSystem::UnitType::UNIT_TYPE_METRIC); // Unit system used in deck FIRST_SIM.DATA.
{
const std::string deck = R"(COMPDAT
-- CF Diam Kh Skin Df
'WELL' 1 1 1 1 'OPEN' 1* 1.168 0.311 107.872 1* 1* 'Z' 21.925 /
/)";
Opm::WellConnections connections = loadCOMPDAT(deck);
const auto& conn0 = connections[0];
BOOST_CHECK_EQUAL(conn0.CF(), units.to_si(Opm::UnitSystem::measure::transmissibility, 1.168));
BOOST_CHECK_EQUAL(conn0.Kh(), units.to_si(Opm::UnitSystem::measure::effective_Kh, 107.872));
}
{
const std::string deck = R"(GRID
PERMX
1000*0.10 /
COPY
'PERMX' 'PERMZ' /
'PERMX' 'PERMY' /
/
SCHEDULE
COMPDAT
-- CF Diam Kh Skin Df
'WELL' 1 1 1 1 'OPEN' 1* 1.168 0.311 0 1* 1* 'Z' 21.925 /
/)";
Opm::WellConnections connections = loadCOMPDAT(deck);
const auto& conn0 = connections[0];
BOOST_CHECK_EQUAL(conn0.CF(), units.to_si(Opm::UnitSystem::measure::transmissibility, 1.168));
BOOST_CHECK_EQUAL(conn0.Kh(), units.to_si(Opm::UnitSystem::measure::effective_Kh, 0.10 * 1.0));
}
}
BOOST_AUTO_TEST_CASE(loadCOMPDATTESTSPE1) {
Opm::ParseContext parseContext;
Opm::Parser parser;
const auto deck = parser.parseFile("SPE1CASE1.DATA", parseContext);
Opm::EclipseState state(deck, parseContext);
Opm::Schedule sched(deck, state, parseContext);
const auto& units = deck.getActiveUnitSystem();
const auto& prod = sched.getWell("PROD");
const auto& connections = prod->getConnections(0);
const auto& conn0 = connections[0];
/* Expected values come from Eclipse simulation. */
BOOST_CHECK_CLOSE(conn0.CF(), units.to_si(Opm::UnitSystem::measure::transmissibility, 10.609), 2e-2);
BOOST_CHECK_CLOSE(conn0.Kh(), units.to_si(Opm::UnitSystem::measure::effective_Kh, 10000), 1e-6);
}
struct exp_conn {
std::string well;
int ci;
double CF;
double Kh;
};
BOOST_AUTO_TEST_CASE(loadCOMPDATTESTSPE9) {
Opm::ParseContext parseContext;
Opm::Parser parser;
const auto deck = parser.parseFile("SPE9_CP_PACKED.DATA", parseContext);
Opm::EclipseState state(deck, parseContext);
Opm::Schedule sched(deck, state, parseContext);
const auto& units = deck.getActiveUnitSystem();
/*
The list of the expected values come from the PRT file in an ECLIPSE simulation.
*/
std::vector<exp_conn> expected = {
{"INJE1" ,1 , 0.166, 111.9},
{"INJE1" ,2 , 0.597, 402.6},
{"INJE1" ,3 , 1.866, 1259.2},
{"INJE1" ,4 , 12.442, 8394.2},
{"INJE1" ,5 , 6.974, 4705.3},
{"PRODU2" ,1 , 0.893, 602.8},
{"PRODU2" ,2 , 3.828, 2582.8},
{"PRODU2" ,3 , 0.563, 380.0},
{"PRODU3" ,1 , 1.322, 892.1},
{"PRODU3" ,2 , 3.416, 2304.4},
{"PRODU4" ,1 , 4.137, 2791.2},
{"PRODU4" ,2 , 66.455, 44834.7},
{"PRODU5" ,1 , 0.391, 264.0},
{"PRODU5" ,2 , 7.282, 4912.6},
{"PRODU5" ,3 , 1.374, 927.3},
{"PRODU6" ,1 , 1.463, 987.3},
{"PRODU6" ,2 , 1.891, 1275.8},
{"PRODU7" ,1 , 1.061, 716.1},
{"PRODU7" ,2 , 5.902, 3982.0},
{"PRODU7" ,3 , 0.593, 400.1},
{"PRODU8" ,1 , 0.993, 670.1},
{"PRODU8" ,2 , 17.759, 11981.5},
{"PRODU9" ,1 , 0.996, 671.9},
{"PRODU9" ,2 , 2.548, 1719.0},
{"PRODU10" ,1 , 11.641, 7853.9},
{"PRODU10" ,2 , 7.358, 4964.1},
{"PRODU10" ,3 , 0.390, 262.8},
{"PRODU11" ,2 , 3.536, 2385.6},
{"PRODU12" ,1 , 3.028, 2043.1},
{"PRODU12" ,2 , 0.301, 202.7},
{"PRODU12" ,3 , 0.279, 188.3},
{"PRODU13" ,2 , 5.837, 3938.1},
{"PRODU14" ,1 , 180.976, 122098.1},
{"PRODU14" ,2 , 25.134, 16957.0},
{"PRODU14" ,3 , 0.532, 358.7},
{"PRODU15" ,1 , 4.125, 2783.1},
{"PRODU15" ,2 , 6.431, 4338.7},
{"PRODU16" ,2 , 5.892, 3975.0},
{"PRODU17" ,1 , 80.655, 54414.9},
{"PRODU17" ,2 , 9.098, 6138.3},
{"PRODU18" ,1 , 1.267, 855.1},
{"PRODU18" ,2 , 18.556, 12518.9},
{"PRODU19" ,1 , 15.589, 10517.2},
{"PRODU19" ,3 , 1.273, 859.1},
{"PRODU20" ,1 , 3.410, 2300.5},
{"PRODU20" ,2 , 0.191, 128.8},
{"PRODU20" ,3 , 0.249, 168.1},
{"PRODU21" ,1 , 0.596, 402.0},
{"PRODU21" ,2 , 0.163, 109.9},
{"PRODU22" ,1 , 4.021, 2712.8},
{"PRODU22" ,2 , 0.663, 447.1},
{"PRODU23" ,1 , 1.542, 1040.2},
{"PRODU24" ,1 , 78.939, 53257.0},
{"PRODU24" ,3 , 17.517, 11817.8},
{"PRODU25" ,1 , 3.038, 2049.5},
{"PRODU25" ,2 , 0.926, 624.9},
{"PRODU25" ,3 , 0.891, 601.3},
{"PRODU26" ,1 , 0.770, 519.6},
{"PRODU26" ,3 , 0.176, 118.6}};
for (const auto& ec : expected) {
const auto& well = sched.getWell(ec.well);
const auto& connections = well->getConnections(0);
const auto& conn = connections[ec.ci - 1];
BOOST_CHECK_CLOSE( conn.CF(), units.to_si(Opm::UnitSystem::measure::transmissibility, ec.CF), 2e-1);
BOOST_CHECK_CLOSE( conn.Kh(), units.to_si(Opm::UnitSystem::measure::effective_Kh, ec.Kh), 1e-1);
}
}

View File

@@ -43,15 +43,15 @@
BOOST_AUTO_TEST_CASE(MultisegmentWellTest) {
Opm::WellCompletion::DirectionEnum dir = Opm::WellCompletion::DirectionEnum::Z;
Opm::WellConnections connection_set;
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.5), Opm::Value<double>("SKIN", 0.), Opm::Value<double>("Kh", 17.29), 0, dir) );
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.5), Opm::Value<double>("SKIN", 0.), Opm::Value<double>("Kh", 17.29), 0, dir) );
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), Opm::Value<double>("Kh", 17.29), 0, dir) );
Opm::WellConnections connection_set;
connection_set.add(Opm::Connection( 19, 0, 0, 1, 0.0, Opm::WellCompletion::OPEN , 200, 17.29, 0.25, 0, dir) );
connection_set.add(Opm::Connection( 19, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , 200, 17.29, 0.25, 0, dir) );
connection_set.add(Opm::Connection( 19, 0, 2, 1, 0.0, Opm::WellCompletion::OPEN , 200, 17.29, 0.25, 0, dir) );
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), Opm::Value<double>("Kh", 17.29), 0, Opm::WellCompletion::DirectionEnum::X) );
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), Opm::Value<double>("Kh", 17.29), 0, Opm::WellCompletion::DirectionEnum::X) );
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), Opm::Value<double>("Kh", 17.29), 0, Opm::WellCompletion::DirectionEnum::X) );
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , Opm::Value<double>("ConnectionTransmissibilityFactor", 200.), Opm::Value<double>("D", 0.4), Opm::Value<double>("SKIN", 0.), Opm::Value<double>("Kh", 17.29), 0, Opm::WellCompletion::DirectionEnum::X) );
connection_set.add(Opm::Connection( 18, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , 200, 17.29, 0.25, 0, Opm::WellCompletion::DirectionEnum::X) );
connection_set.add(Opm::Connection( 17, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , 200, 17.29, 0.25, 0, Opm::WellCompletion::DirectionEnum::X) );
connection_set.add(Opm::Connection( 16, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , 200, 17.29, 0.25, 0, Opm::WellCompletion::DirectionEnum::X) );
connection_set.add(Opm::Connection( 15, 0, 1, 1, 0.0, Opm::WellCompletion::OPEN , 200, 17.29, 0.25, 0, Opm::WellCompletion::DirectionEnum::X) );
BOOST_CHECK_EQUAL( 7U , connection_set.size() );
@@ -93,32 +93,32 @@ Opm::WellConnections connection_set;
BOOST_CHECK_EQUAL(7U, new_connection_set->size());
const Opm::Connection& connection1 = new_connection_set->get(0);
const int segment_number_connection1 = connection1.segment_number;
const double center_depth_connection1 = connection1.center_depth;
const int segment_number_connection1 = connection1.segment();
const double center_depth_connection1 = connection1.depth();
BOOST_CHECK_EQUAL(segment_number_connection1, 1);
BOOST_CHECK_EQUAL(center_depth_connection1, 2512.5);
const Opm::Connection& connection3 = new_connection_set->get(2);
const int segment_number_connection3 = connection3.segment_number;
const double center_depth_connection3 = connection3.center_depth;
const int segment_number_connection3 = connection3.segment();
const double center_depth_connection3 = connection3.depth();
BOOST_CHECK_EQUAL(segment_number_connection3, 3);
BOOST_CHECK_EQUAL(center_depth_connection3, 2562.5);
const Opm::Connection& connection5 = new_connection_set->get(4);
const int segment_number_connection5 = connection5.segment_number;
const double center_depth_connection5 = connection5.center_depth;
const int segment_number_connection5 = connection5.segment();
const double center_depth_connection5 = connection5.depth();
BOOST_CHECK_EQUAL(segment_number_connection5, 6);
BOOST_CHECK_CLOSE(center_depth_connection5, 2538.83, 0.001);
const Opm::Connection& connection6 = new_connection_set->get(5);
const int segment_number_connection6 = connection6.segment_number;
const double center_depth_connection6 = connection6.center_depth;
const int segment_number_connection6 = connection6.segment();
const double center_depth_connection6 = connection6.depth();
BOOST_CHECK_EQUAL(segment_number_connection6, 6);
BOOST_CHECK_CLOSE(center_depth_connection6, 2537.83, 0.001);
const Opm::Connection& connection7 = new_connection_set->get(6);
const int segment_number_connection7 = connection7.segment_number;
const double center_depth_connection7 = connection7.center_depth;
const int segment_number_connection7 = connection7.segment();
const double center_depth_connection7 = connection7.depth();
BOOST_CHECK_EQUAL(segment_number_connection7, 7);
BOOST_CHECK_EQUAL(center_depth_connection7, 2534.5);
}

View File

@@ -654,25 +654,25 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsAndConnectionDataWithWELOPEN) {
constexpr auto open = WellCompletion::StateEnum::OPEN;
BOOST_CHECK_EQUAL( 7U, cs.size() );
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 6, 2 ).state);
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 6, 3 ).state);
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 6, 4 ).state);
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 7, 2 ).state);
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 6, 2 ).state());
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 6, 3 ).state());
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 6, 4 ).state());
BOOST_CHECK_EQUAL(open, cs.getFromIJK( 7, 7, 2 ).state());
const auto& cs2 = well->getConnections( 4 );
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 6, 2 ).state);
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 6, 3 ).state);
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 6, 4 ).state);
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 7, 2 ).state);
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 6, 2 ).state());
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 6, 3 ).state());
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 6, 4 ).state());
BOOST_CHECK_EQUAL(open, cs2.getFromIJK( 7, 7, 2 ).state());
well = schedule.getWell("OP_3");
const auto& cs3 = well->getConnections( 3 );
BOOST_CHECK_EQUAL(shut, cs3.get( 0 ).state);
BOOST_CHECK_EQUAL(shut, cs3.get( 0 ).state());
const auto& cs4 = well->getConnections( 4 );
BOOST_CHECK_EQUAL(open, cs4.get( 0 ).state);
BOOST_CHECK_EQUAL(open, cs4.get( 0 ).state());
well = schedule.getWell("OP_1");
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::SHUT, well->getStatus( 3 ));
@@ -1072,17 +1072,17 @@ BOOST_AUTO_TEST_CASE(createDeckWithWPIMULT) {
const auto& cs2 = well->getConnections( 2 );
for(size_t i = 0; i < cs2.size(); i++) {
BOOST_CHECK_EQUAL(cs2.get( i ).wellPi, 1.3);
BOOST_CHECK_EQUAL(cs2.get( i ).wellPi(), 1.3);
}
const auto& cs3 = well->getConnections( 3 );
for(size_t i = 0; i < cs3.size(); i++ ) {
BOOST_CHECK_EQUAL(cs3.get( i ).wellPi, (1.3*1.3));
BOOST_CHECK_EQUAL(cs3.get( i ).wellPi(), (1.3*1.3));
}
const auto& cs4 = well->getConnections( 4 );
for(size_t i = 0; i < cs4.size(); i++ ) {
BOOST_CHECK_EQUAL(cs4.get( i ).wellPi, 1.0);
BOOST_CHECK_EQUAL(cs4.get( i ).wellPi(), 1.0);
}
}
@@ -1673,16 +1673,16 @@ BOOST_AUTO_TEST_CASE( COMPDAT_sets_automatic_complnum ) {
Schedule schedule( deck, grid, eclipseProperties, Phases( true, true, true ) ,ctx);
const auto& cs1 = schedule.getWell( "W1" )->getConnections( 1 );
BOOST_CHECK_EQUAL( -1, cs1.get( 0 ).complnum );
BOOST_CHECK_EQUAL( -2, cs1.get( 1 ).complnum );
BOOST_CHECK_EQUAL( -3, cs1.get( 2 ).complnum );
BOOST_CHECK_EQUAL( -4, cs1.get( 3 ).complnum );
BOOST_CHECK_EQUAL( -1, cs1.get( 0 ).complnum() );
BOOST_CHECK_EQUAL( -2, cs1.get( 1 ).complnum() );
BOOST_CHECK_EQUAL( -3, cs1.get( 2 ).complnum() );
BOOST_CHECK_EQUAL( -4, cs1.get( 3 ).complnum() );
const auto& cs2 = schedule.getWell( "W1" )->getConnections( 2 );
BOOST_CHECK_EQUAL( -1, cs2.get( 0 ).complnum );
BOOST_CHECK_EQUAL( -2, cs2.get( 1 ).complnum );
BOOST_CHECK_EQUAL( -3, cs2.get( 2 ).complnum );
BOOST_CHECK_EQUAL( -4, cs2.get( 3 ).complnum );
BOOST_CHECK_EQUAL( -1, cs2.get( 0 ).complnum() );
BOOST_CHECK_EQUAL( -2, cs2.get( 1 ).complnum() );
BOOST_CHECK_EQUAL( -3, cs2.get( 2 ).complnum() );
BOOST_CHECK_EQUAL( -4, cs2.get( 3 ).complnum() );
}
BOOST_AUTO_TEST_CASE( COMPDAT_multiple_wells ) {
@@ -1717,20 +1717,20 @@ BOOST_AUTO_TEST_CASE( COMPDAT_multiple_wells ) {
Schedule schedule( deck, grid, eclipseProperties, Phases( true, true, true ) ,ctx);
const auto& w1cs = schedule.getWell( "W1" )->getConnections();
BOOST_CHECK_EQUAL( -1, w1cs.get( 0 ).complnum );
BOOST_CHECK_EQUAL( -2, w1cs.get( 1 ).complnum );
BOOST_CHECK_EQUAL( -3, w1cs.get( 2 ).complnum );
BOOST_CHECK_EQUAL( -4, w1cs.get( 3 ).complnum );
BOOST_CHECK_EQUAL( -5, w1cs.get( 4 ).complnum );
BOOST_CHECK_EQUAL( -1, w1cs.get( 0 ).complnum() );
BOOST_CHECK_EQUAL( -2, w1cs.get( 1 ).complnum() );
BOOST_CHECK_EQUAL( -3, w1cs.get( 2 ).complnum() );
BOOST_CHECK_EQUAL( -4, w1cs.get( 3 ).complnum() );
BOOST_CHECK_EQUAL( -5, w1cs.get( 4 ).complnum() );
const auto& w2cs = schedule.getWell( "W2" )->getConnections();
BOOST_CHECK_EQUAL( -1, w2cs.getFromIJK( 4, 4, 2 ).complnum );
BOOST_CHECK_EQUAL( -2, w2cs.getFromIJK( 4, 4, 0 ).complnum );
BOOST_CHECK_EQUAL( -3, w2cs.getFromIJK( 4, 4, 1 ).complnum );
BOOST_CHECK_EQUAL( -4, w2cs.getFromIJK( 4, 4, 3 ).complnum );
BOOST_CHECK_EQUAL( -5, w2cs.getFromIJK( 4, 4, 4 ).complnum );
BOOST_CHECK_EQUAL( -1, w2cs.getFromIJK( 4, 4, 2 ).complnum() );
BOOST_CHECK_EQUAL( -2, w2cs.getFromIJK( 4, 4, 0 ).complnum() );
BOOST_CHECK_EQUAL( -3, w2cs.getFromIJK( 4, 4, 1 ).complnum() );
BOOST_CHECK_EQUAL( -4, w2cs.getFromIJK( 4, 4, 3 ).complnum() );
BOOST_CHECK_EQUAL( -5, w2cs.getFromIJK( 4, 4, 4 ).complnum() );
BOOST_CHECK_THROW( w2cs.get( 5 ).complnum, std::out_of_range );
BOOST_CHECK_THROW( w2cs.get( 5 ).complnum(), std::out_of_range );
}
BOOST_AUTO_TEST_CASE( COMPDAT_multiple_records_same_completion ) {
@@ -1762,9 +1762,9 @@ BOOST_AUTO_TEST_CASE( COMPDAT_multiple_records_same_completion ) {
const auto& cs = schedule.getWell( "W1" )->getConnections();
BOOST_CHECK_EQUAL( 3U, cs.size() );
BOOST_CHECK_EQUAL( -1, cs.get( 0 ).complnum );
BOOST_CHECK_EQUAL( -2, cs.get( 1 ).complnum );
BOOST_CHECK_EQUAL( -3, cs.get( 2 ).complnum );
BOOST_CHECK_EQUAL( -1, cs.get( 0 ).complnum() );
BOOST_CHECK_EQUAL( -2, cs.get( 1 ).complnum() );
BOOST_CHECK_EQUAL( -3, cs.get( 2 ).complnum() );
}
BOOST_AUTO_TEST_CASE( complump_less_than_1 ) {
@@ -1843,20 +1843,20 @@ BOOST_AUTO_TEST_CASE( complump ) {
const auto& sc0 = well.getConnections( 0 );
/* complnum should be modified by COMPLNUM */
BOOST_CHECK_EQUAL( 1, sc0.getFromIJK( 2, 2, 0 ).complnum );
BOOST_CHECK_EQUAL( 1, sc0.getFromIJK( 2, 2, 1 ).complnum );
BOOST_CHECK_EQUAL( 1, sc0.getFromIJK( 2, 2, 2 ).complnum );
BOOST_CHECK( sc0.getFromIJK( 2, 2, 3 ).complnum < 0);
BOOST_CHECK_EQUAL( 1, sc0.getFromIJK( 2, 2, 0 ).complnum() );
BOOST_CHECK_EQUAL( 1, sc0.getFromIJK( 2, 2, 1 ).complnum() );
BOOST_CHECK_EQUAL( 1, sc0.getFromIJK( 2, 2, 2 ).complnum() );
BOOST_CHECK( sc0.getFromIJK( 2, 2, 3 ).complnum() < 0);
BOOST_CHECK_EQUAL( shut, sc0.getFromIJK( 2, 2, 0 ).state );
BOOST_CHECK_EQUAL( shut, sc0.getFromIJK( 2, 2, 1 ).state );
BOOST_CHECK_EQUAL( shut, sc0.getFromIJK( 2, 2, 2 ).state );
BOOST_CHECK_EQUAL( shut, sc0.getFromIJK( 2, 2, 0 ).state() );
BOOST_CHECK_EQUAL( shut, sc0.getFromIJK( 2, 2, 1 ).state() );
BOOST_CHECK_EQUAL( shut, sc0.getFromIJK( 2, 2, 2 ).state() );
const auto& sc1 = well.getConnections( 1 );
BOOST_CHECK_EQUAL( open, sc1.getFromIJK( 2, 2, 0 ).state );
BOOST_CHECK_EQUAL( open, sc1.getFromIJK( 2, 2, 1 ).state );
BOOST_CHECK_EQUAL( open, sc1.getFromIJK( 2, 2, 2 ).state );
BOOST_CHECK_EQUAL( shut, sc1.getFromIJK( 2, 2, 3 ).state );
BOOST_CHECK_EQUAL( open, sc1.getFromIJK( 2, 2, 0 ).state() );
BOOST_CHECK_EQUAL( open, sc1.getFromIJK( 2, 2, 1 ).state() );
BOOST_CHECK_EQUAL( open, sc1.getFromIJK( 2, 2, 2 ).state() );
BOOST_CHECK_EQUAL( shut, sc1.getFromIJK( 2, 2, 3 ).state() );
const auto completions = well.getCompletions(1);
BOOST_CHECK_EQUAL(completions.size(), 4);
@@ -1930,23 +1930,23 @@ BOOST_AUTO_TEST_CASE( COMPLUMP_specific_coordinates ) {
const auto& cs2 = well.getConnections( 2 );
BOOST_CHECK_EQUAL( 9U, cs1.size() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 0, 0, 1 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 2, 2, 0 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 2, 2, 1 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 2, 2, 2 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 0 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 3 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 4 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 5 ).state );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 0, 0, 1 ).state() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 2, 2, 0 ).state() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 2, 2, 1 ).state() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 2, 2, 2 ).state() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 0 ).state() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 3 ).state() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 4 ).state() );
BOOST_CHECK_EQUAL( shut, cs1.getFromIJK( 1, 1, 5 ).state() );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 0, 0, 1 ).state );
BOOST_CHECK_EQUAL( shut, cs2.getFromIJK( 2, 2, 0 ).state );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 2, 2, 1 ).state );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 2, 2, 2 ).state );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 1, 1, 0 ).state );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 1, 1, 3 ).state );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 1, 1, 4 ).state );
BOOST_CHECK_EQUAL( shut, cs2.getFromIJK( 1, 1, 5 ).state );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 0, 0, 1 ).state() );
BOOST_CHECK_EQUAL( shut, cs2.getFromIJK( 2, 2, 0 ).state() );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 2, 2, 1 ).state() );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 2, 2, 2 ).state() );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 1, 1, 0 ).state() );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 1, 1, 3 ).state() );
BOOST_CHECK_EQUAL( open, cs2.getFromIJK( 1, 1, 4 ).state() );
BOOST_CHECK_EQUAL( shut, cs2.getFromIJK( 1, 1, 5 ).state() );
}
BOOST_AUTO_TEST_CASE(TestCompletionStateEnum2String) {

View File

@@ -340,15 +340,14 @@ BOOST_AUTO_TEST_CASE(NewWellZeroCompletions) {
// Helper function for CompletionOrder test.
inline Opm::Connection connection( int i, int j, int k, int complnum = 1 ) {
return Opm::Connection { i, j, k,
complnum,
k*1.0,
Opm::WellCompletion::AUTO,
Opm::Value<double>("ConnectionTransmissibilityFactor",99.88),
Opm::Value<double>("D",22.33),
Opm::Value<double>("SKIN",33.22),
Opm::Value<double>("Kh",17.29),
0,
Opm::WellCompletion::DirectionEnum::Z };
complnum,
k*1.0,
Opm::WellCompletion::AUTO,
99.88,
17.29,
0.25,
0,
Opm::WellCompletion::DirectionEnum::Z };
}

View File

@@ -577,26 +577,26 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
BOOST_CHECK_EQUAL(7U, connections.size());
const Connection& connection5 = connections.get(4);
const int seg_number_connection5 = connection5.segment_number;
const double connection5_depth = connection5.center_depth;
const int seg_number_connection5 = connection5.segment();
const double connection5_depth = connection5.depth();
BOOST_CHECK_EQUAL(seg_number_connection5, 6);
BOOST_CHECK_CLOSE(connection5_depth, 2538.83, 0.001);
const Connection& connection6 = connections.get(5);
const int seg_number_connection6 = connection6.segment_number;
const double connection6_depth = connection6.center_depth;
const int seg_number_connection6 = connection6.segment();
const double connection6_depth = connection6.depth();
BOOST_CHECK_EQUAL(seg_number_connection6, 6);
BOOST_CHECK_CLOSE(connection6_depth, 2537.83, 0.001);
const Connection& connection1 = connections.get(0);
const int seg_number_connection1 = connection1.segment_number;
const double connection1_depth = connection1.center_depth;
const int seg_number_connection1 = connection1.segment();
const double connection1_depth = connection1.depth();
BOOST_CHECK_EQUAL(seg_number_connection1, 1);
BOOST_CHECK_EQUAL(connection1_depth, 2512.5);
const Connection& connection3 = connections.get(2);
const int seg_number_connection3 = connection3.segment_number;
const double connection3_depth = connection3.center_depth;
const int seg_number_connection3 = connection3.segment();
const double connection3_depth = connection3.depth();
BOOST_CHECK_EQUAL(seg_number_connection3, 3);
BOOST_CHECK_EQUAL(connection3_depth, 2562.5);
}

View File

@@ -349,13 +349,11 @@ BOOST_AUTO_TEST_CASE(WellTestCOMPDAT) {
const auto& connections = well1->getConnections(3);
BOOST_CHECK_EQUAL(4U, connections.size());
BOOST_CHECK_EQUAL(WellCompletion::OPEN, connections.get(3).state);
BOOST_CHECK_EQUAL(2.2836805555555556e-12 , connections.get(3).getConnectionTransmissibilityFactor());
BOOST_CHECK_EQUAL(0.311/Metric::Length, connections.get(3).getDiameter());
BOOST_CHECK_EQUAL(3.3, connections.get(3).getSkinFactor());
BOOST_CHECK_EQUAL(WellCompletion::OPEN, connections.get(3).state());
BOOST_CHECK_EQUAL(2.2836805555555556e-12 , connections.get(3).CF());
BOOST_CHECK_EQUAL(4U, well1->getConnections( 7 ).size() );
BOOST_CHECK_EQUAL(WellCompletion::SHUT, well1->getConnections( 7 ).get( 3 ).state );
BOOST_CHECK_EQUAL(WellCompletion::SHUT, well1->getConnections( 7 ).get( 3 ).state() );
}
}

View File

@@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE( serialize_icon_test )
const size_t offset = w_offset + c_offset;
BOOST_CHECK_EQUAL(icondata[offset + ICON_IC_INDEX],
c.complnum);
c.complnum());
BOOST_CHECK_EQUAL(icondata[offset + ICON_I_INDEX],
c.getI() + 1);
BOOST_CHECK_EQUAL(icondata[offset + ICON_J_INDEX],
@@ -64,9 +64,9 @@ BOOST_AUTO_TEST_CASE( serialize_icon_test )
BOOST_CHECK_EQUAL(icondata[offset + ICON_K_INDEX],
c.getK() + 1);
BOOST_CHECK_EQUAL(icondata[offset + ICON_DIRECTION_INDEX],
c.dir);
c.dir());
if (c.state == Opm::WellCompletion::StateEnum::OPEN)
if (c.state() == Opm::WellCompletion::StateEnum::OPEN)
BOOST_CHECK_EQUAL(icondata[offset + ICON_STATUS_INDEX],
1);
else
@@ -75,7 +75,7 @@ BOOST_AUTO_TEST_CASE( serialize_icon_test )
if (c.attachedToSegment())
BOOST_CHECK_EQUAL(icondata[offset + ICON_SEGMENT_INDEX],
c.segment_number);
c.segment());
else
BOOST_CHECK_EQUAL(icondata[offset + ICON_SEGMENT_INDEX],
0);

View File

@@ -56,15 +56,12 @@ BOOST_AUTO_TEST_CASE( serialize_scon_test )
for (const auto c : w->getConnections(tstep)) {
const size_t offset = w_offset + c_offset;
const auto ctf = c.getConnectionTransmissibilityFactorAsValueObject();
const double expected =
ctf.hasValue()
? units.from_si(Opm::UnitSystem::measure::transmissibility, ctf.getValue())
: Opm::RestartIO::Helpers::UNIMPLEMENTED_VALUE;
const double expected_cf = units.from_si(Opm::UnitSystem::measure::transmissibility, c.CF());
const double expected_kh = units.from_si(Opm::UnitSystem::measure::effective_Kh, c.Kh());
BOOST_CHECK_EQUAL(scondata[offset + SCON_CF_INDEX],
expected);
expected_cf);
BOOST_CHECK_EQUAL(scondata[offset + SCON_KH_INDEX],
Opm::RestartIO::Helpers::UNIMPLEMENTED_VALUE);
expected_kh);
c_offset += SCONZ;
}