Added some tests for the endpoint scaled relperm.

- satfuncStandard: Unscaled curves, using standard version of the
Gwseg model.
- satfuncEPSBase: Unscaled curves, but using the EPS version of
the Gwseg model.  There are some differences between this and the
standard version of Gwseg for derivatives at critical saturations.
The scheme for calculating the derivatives should be discussed.
(Will file a separate issue on this.)
- satfuncEPS_A: Scaled curves.  Scaling parameters specified via
SWL family.
- satfuncEPS_B: Scaled curves.  Scaling parameters identical to _A
but this time specified via the ENPTVD table.  Test currently
suspended due problems with eclipse-state.
- satfuncEPS_C: Scaled curves.  Scaling parameters identical to _A
but this time specified via Norne-like syntax (EQUALS, COPY etc.).
This commit is contained in:
osae 2014-10-30 17:40:48 +01:00
parent c7f4ea8abd
commit cc7d3dab93
6 changed files with 1498 additions and 0 deletions

168
tests/satfuncEPSBase.DATA Normal file
View File

@ -0,0 +1,168 @@
NOECHO
RUNSPEC ======
WATER
OIL
GAS
DISGAS
VAPOIL
TABDIMS
1 1 40 20 1 20 /
DIMENS
1 1 20
/
WELLDIMS
30 10 2 30 /
ENDSCALE
--DIR REV NTENDP NSENDP
'NODIR' 'REVERS' 1 20 /
/
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 /
/
SCALECRS
-- YES /
NO/
SWOF
0.1 0.0 1.0 0.9
0.2 0.0 0.8 0.8
0.3 0.1 0.6 0.7
0.4 0.2 0.4 0.6
0.7 0.5 0.1 0.3
0.8 0.6 0.0 0.2
0.9 0.7 0.0 0.1
/
SGOF
0.0 0.0 1.0 0.2
0.1 0.0 0.7 0.4
0.2 0.1 0.6 0.6
0.8 0.7 0.0 2.0
0.9 1.0 0.0 2.1
/
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

177
tests/satfuncEPS_A.DATA Normal file
View File

@ -0,0 +1,177 @@
NOECHO
RUNSPEC ======
WATER
OIL
GAS
DISGAS
VAPOIL
TABDIMS
1 1 40 20 1 20 /
DIMENS
1 1 10
/
WELLDIMS
30 10 2 30 /
ENDSCALE
--DIR REV NTENDP NSENDP
'NODIR' 'REVERS' 1 20 /
/
START
1 'JAN' 1990 /
NSTACK
25 /
EQLDIMS
-- NTEQUL
1 /
FMTOUT
FMTIN
GRID ======
DXV
1.0
/
DYV
1.0
/
DZV
10*5.0
/
PORO
10*0.2
/
PERMZ
10*1.0
/
PERMY
10*100.0
/
PERMX
10*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 /
/
SCALECRS
-- YES /
NO/
SWL
4*0.1 4*0.2 2*0.1/
SWCR
0.2 0.2 0.4 0.4 0.2 0.2 0.4 0.4 2*0.2 /
SWU
0.9 0.7 0.9 0.7 0.9 0.7 0.9 0.7 2*0.9 /
SWOF
0.1 0.0 1.0 0.9
0.2 0.0 0.8 0.8
0.3 0.1 0.6 0.7
0.4 0.2 0.4 0.6
0.7 0.5 0.1 0.3
0.8 0.6 0.0 0.2
0.9 0.7 0.0 0.1
/
SGOF
0.0 0.0 1.0 0.2
0.1 0.0 0.7 0.4
0.2 0.1 0.6 0.6
0.8 0.7 0.0 2.0
0.9 1.0 0.0 2.1
/
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

190
tests/satfuncEPS_B.DATA Normal file
View File

@ -0,0 +1,190 @@
NOECHO
RUNSPEC ======
WATER
OIL
GAS
DISGAS
VAPOIL
TABDIMS
1 1 40 20 1 20 /
DIMENS
1 1 10
/
WELLDIMS
30 10 2 30 /
ENDSCALE
--DIR REV NTENDP NSENDP
'NODIR' 'REVERS' 1 20 /
/
START
1 'JAN' 1990 /
NSTACK
25 /
EQLDIMS
-- NTEQUL
1 /
FMTOUT
FMTIN
GRID ======
DXV
1.0
/
DYV
1.0
/
DZV
10*5.0
/
PORO
10*0.2
/
PERMZ
10*1.0
/
PERMY
10*100.0
/
PERMX
10*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 /
/
SCALECRS
-- YES /
NO/
ENPTVD
-- Depth swl swcr swu sgl sgcr sgu sowcr sogcr
-- Sandstone
2.5 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2
7.5 .1 0.2 0.7 .0 0.1 0.9 0.2 0.2
12.5 .1 0.4 0.9 .0 0.1 0.9 0.2 0.2
17.5 .1 0.4 0.7 .0 0.1 0.9 0.2 0.2
22.5 .2 0.2 0.9 .0 0.1 0.9 0.2 0.2
27.5 .2 0.2 0.7 .0 0.1 0.9 0.2 0.2
32.5 .2 0.4 0.9 .0 0.1 0.9 0.2 0.2
37.5 .2 0.4 0.7 .0 0.1 0.9 0.2 0.2
42.5 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2
47.5 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2
50.0 .1 0.2 0.9 .0 0.1 0.9 0.2 0.2 /
/
SWOF
0.1 0.0 1.0 0.9
0.2 0.0 0.8 0.8
0.3 0.1 0.6 0.7
0.4 0.2 0.4 0.6
0.7 0.5 0.1 0.3
0.8 0.6 0.0 0.2
0.9 0.7 0.0 0.1
/
SGOF
0.0 0.0 1.0 0.2
0.1 0.0 0.7 0.4
0.2 0.1 0.6 0.6
0.8 0.7 0.0 2.0
0.9 1.0 0.0 2.1
/
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
/
REGIONS ======
ENDNUM
10*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

225
tests/satfuncEPS_C.DATA Normal file
View File

@ -0,0 +1,225 @@
NOECHO
RUNSPEC ======
WATER
OIL
GAS
DISGAS
VAPOIL
TABDIMS
1 1 40 20 1 20 /
DIMENS
1 1 10
/
WELLDIMS
30 10 2 30 /
ENDSCALE
--DIR REV NTENDP NSENDP
'NODIR' 'REVERS' 1 20 /
/
START
1 'JAN' 1990 /
NSTACK
25 /
EQLDIMS
-- NTEQUL
1 /
FMTOUT
FMTIN
GRID ======
DXV
1.0
/
DYV
1.0
/
DZV
10*5.0
/
PORO
10*0.2
/
PERMZ
10*1.0
/
PERMY
10*100.0
/
PERMX
10*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 /
/
SCALECRS
-- YES /
NO/
--SWL
--4*0.1 4*0.2 2*0.1/
EQUALS
SWL 0.1 1 1 1 1 1 1 /
SWL 0.1 1 1 1 1 2 2 /
SWL 0.1 1 1 1 1 3 3 /
SWL 0.1 1 1 1 1 4 4 /
SWL 0.2 1 1 1 1 5 5 /
SWL 0.2 1 1 1 1 6 6 /
SWL 0.2 1 1 1 1 7 7 /
SWL 0.2 1 1 1 1 8 8 /
SWL 0.1 1 1 1 1 9 9 /
SWL 0.1 1 1 1 1 10 10 /
/
--SWCR
--0.2 0.2 0.4 0.4 0.2 0.2 0.4 0.4 2*0.2 /
COPY
SWL SWCR /
SWL SWU /
/
ADD
SWCR 0.1 1 1 1 1 1 2 /
SWCR 0.3 1 1 1 1 3 4 /
SWCR 0.2 1 1 1 1 7 8 /
SWCR 0.1 1 1 1 1 9 10 /
/
--SWU
--0.9 0.7 0.9 0.7 0.9 0.7 0.9 0.7 2*0.9 /
MULTIPLY
SWU -1.0 1 1 1 1 1 10 /
/
ADD
SWU 1.0 1 1 1 1 1 10 /
/
ADD
SWU -0.2 1 1 1 1 2 2 /
SWU -0.2 1 1 1 1 4 4 /
SWU 0.1 1 1 1 1 5 5 /
SWU -0.1 1 1 1 1 6 6 /
SWU 0.1 1 1 1 1 7 7 /
SWU -0.1 1 1 1 1 8 8 /
/
SWOF
0.1 0.0 1.0 0.9
0.2 0.0 0.8 0.8
0.3 0.1 0.6 0.7
0.4 0.2 0.4 0.6
0.7 0.5 0.1 0.3
0.8 0.6 0.0 0.2
0.9 0.7 0.0 0.1
/
SGOF
0.0 0.0 1.0 0.2
0.1 0.0 0.7 0.4
0.2 0.1 0.6 0.6
0.8 0.7 0.0 2.0
0.9 1.0 0.0 2.1
/
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
/
REGIONS ======
ENDNUM
10*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

168
tests/satfuncStandard.DATA Normal file
View File

@ -0,0 +1,168 @@
NOECHO
RUNSPEC ======
WATER
OIL
GAS
DISGAS
VAPOIL
TABDIMS
1 1 40 20 1 20 /
DIMENS
1 1 10
/
WELLDIMS
30 10 2 30 /
--ENDSCALE
--DIR REV NTENDP NSENDP
--'NODIR' 'REVERS' 1 20 /
--/
START
1 'JAN' 1990 /
NSTACK
25 /
EQLDIMS
-- NTEQUL
1 /
FMTOUT
FMTIN
GRID ======
DXV
1.0
/
DYV
1.0
/
DZV
10*5.0
/
PORO
10*0.2
/
PERMZ
10*1.0
/
PERMY
10*100.0
/
PERMX
10*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 /
/
--SCALECRS
-- YES /
-- NO/
SWOF
0.1 0.0 1.0 0.9
0.2 0.0 0.8 0.8
0.3 0.1 0.6 0.7
0.4 0.2 0.4 0.6
0.7 0.5 0.1 0.3
0.8 0.6 0.0 0.2
0.9 0.7 0.0 0.1
/
SGOF
0.0 0.0 1.0 0.2
0.1 0.0 0.7 0.4
0.2 0.1 0.6 0.6
0.8 0.7 0.0 2.0
0.9 1.0 0.0 2.1
/
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

570
tests/test_satfunc.cpp Normal file
View File

@ -0,0 +1,570 @@
/*
Copyright 2014 SINTEF ICT, Applied Mathematics.
*/
#include "config.h"
/* --- Boost.Test boilerplate --- */
#if HAVE_DYNAMIC_BOOST_TEST
#define BOOST_TEST_DYN_LINK
#endif
#define NVERBOSE // Suppress own messages when throw()ing
#define BOOST_TEST_MODULE UnitsTest
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
/* --- our own headers --- */
#include <opm/core/simulator/initStateEquil.hpp>
#include <opm/core/grid.h>
#include <opm/core/grid/cart_grid.h>
#include <opm/core/grid/GridManager.hpp>
#include <opm/core/props/BlackoilPropertiesBasic.hpp>
#include <opm/core/props/BlackoilPropertiesFromDeck.hpp>
#include <opm/core/props/BlackoilPhases.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/core/pressure/msmfem/partition.h>
#include <opm/core/utility/parameters/ParameterGroup.hpp>
#include <opm/core/utility/Units.hpp>
#include <array>
#include <iostream>
#include <limits>
#include <memory>
#include <numeric>
#include <sstream>
#include <string>
#include <vector>
BOOST_AUTO_TEST_SUITE ()
BOOST_AUTO_TEST_CASE (GwsegStandard)
{
// This is the basic (no eps and hysteris) version of
// the Gwseg model.
//std::cout << "==================================== GwsegStandard ====================================" << std::endl;
Opm::parameter::ParameterGroup param;
Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0);
const UnstructuredGrid& grid = *(gm.c_grid());
Opm::ParserPtr parser(new Opm::Parser() );
Opm::DeckConstPtr deck = parser->parseFile("satfuncStandard.DATA");
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false);
const int np = props.numPhases();
const int wpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Aqua];
const int opos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Liquid];
const int gpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Vapour];
BOOST_REQUIRE(np == 3);
BOOST_REQUIRE(wpos == 0);
BOOST_REQUIRE(opos == 1);
BOOST_REQUIRE(gpos == 2);
const int n=11;
double s[n*np];
int cells[n];
double kr[n*np];
double dkrds[n*np*np];
for (int i=0; i<n; ++i) {
cells[i] = 0;
s[i*np+wpos] = i*0.1;
s[i*np+opos] = 1.0-s[i*np+wpos];
s[i*np+gpos] = 0.0;
}
props.relperm(n, s, cells, kr, dkrds);
double krw[11] = {0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7};
double kro[11] = {1.0, 1.0, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0.0, 0.0, 0.0};
double DkrwDsw[11] = {0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0};
double DkroDsw[11] = {-2.0, -2.0, -2.0, -2.0, -1.0, -1.0, -1.0, -1.0, 0.0, 0.0, 0.0};
double DkroDsg[11] = {-5.0, -5.0, -3.0, -2.0, -0.66666666666666741, -0.75, -0.8,
-0.83333333333333237, 0.14285714285714296, 0.0, 0.0};
const double reltol = 1.0e-6;
for (int i=0; i<n; ++i) {
BOOST_CHECK_CLOSE(kr[i*np+wpos], krw[i], reltol);
BOOST_CHECK_CLOSE(kr[i*np+opos], kro[i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+wpos], DkrwDsw[i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+opos], DkroDsw[i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+np*gpos+opos], DkroDsg[i], reltol);
}
/*
std::cout << std::setw(12) << "sw";
std::cout << std::setw(12) << "so";
std::cout << std::setw(12) << "sg";
std::cout << std::setw(12) << "krw";
std::cout << std::setw(12) << "kro";
std::cout << std::setw(12) << "krg";
std::cout << std::setw(12) << "DkrwDsw";
std::cout << std::setw(12) << "DkroDsw";
std::cout << std::setw(12) << "DkrgDsw";
std::cout << std::setw(12) << "DkrwDso";
std::cout << std::setw(12) << "DkroDso";
std::cout << std::setw(12) << "DkrgDso";
std::cout << std::setw(12) << "DkrwDsg";
std::cout << std::setw(12) << "DkroDsg";
std::cout << std::setw(12) << "DkrgDsg";
std::cout << std::endl;
for (int i=0; i<n; ++i) {
std::cout << std::setw(12) << s[i*np+wpos] << std::setw(12) << s[i*np+opos] << std::setw(12) << s[i*np+gpos]
<< std::setw(12) << kr[i*np+wpos] << std::setw(12) << kr[i*np+opos] << std::setw(12) << kr[i*np+gpos];
for (int j=0; j<np*np; ++j) {
std::cout << std::setw(12) << dkrds[i*np*np+j];
}
std::cout << std::endl;
}
*/
}
BOOST_AUTO_TEST_CASE (GwsegEPSBase)
{
// This is the eps (but no hysteris) version of the Gwseg model.
// However, only default scaling parameters, i.e no scaling.
//std::cout << "==================================== GwsegEPSBase ====================================" << std::endl;
Opm::parameter::ParameterGroup param;
Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0);
const UnstructuredGrid& grid = *(gm.c_grid());
Opm::ParserPtr parser(new Opm::Parser() );
Opm::DeckConstPtr deck = parser->parseFile("satfuncEPSBase.DATA");
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false);
const int np = props.numPhases();
const int wpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Aqua];
const int opos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Liquid];
const int gpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Vapour];
BOOST_REQUIRE(np == 3);
BOOST_REQUIRE(wpos == 0);
BOOST_REQUIRE(opos == 1);
BOOST_REQUIRE(gpos == 2);
const int n=11;
double s[n*np];
int cells[n];
double kr[n*np];
double dkrds[n*np*np];
for (int i=0; i<n; ++i) {
cells[i] = 0;
s[i*np+wpos] = i*0.1;
s[i*np+opos] = 1.0-s[i*np+wpos];
s[i*np+gpos] = 0.0;
}
props.relperm(n, s, cells, kr, dkrds);
double krw[11] = {0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7};
double kro[11] = {1.0, 1.0, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0.0, 0.0, 0.0};
double DkrwDsw[11] = {0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0};
double DkroDsw[11] = {0.0, 0.0, -2.0, -2.0, -1.0, -1.0, -1.0, -1.0, 0.0, 0.0, 0.0};
double DkroDsg[11] = {-2.3283064365386963e-10, -2.3283064365386963e-10, -3.0, -2.0,
-0.66666666666666741, -0.75, -0.8, -0.83333333333333237, 0.14285714285714296, 0.0, 0.0};
// Note that DkrwDsw[2], DkroDsw[0], DkroDsw[1], DkroDsg[0] and DkroDsg[0]
// differs from corresponding values for the previous test although the
// tables are identical. This issue should eventually be resolved, but first
// one should consider the principles for calculating these derivatives.
const double reltol = 1.0e-6;
for (int i=0; i<n; ++i) {
BOOST_CHECK_CLOSE(kr[i*np+wpos], krw[i], reltol);
BOOST_CHECK_CLOSE(kr[i*np+opos], kro[i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+wpos], DkrwDsw[i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+opos], DkroDsw[i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+np*gpos+opos], DkroDsg[i], reltol);
}
/*
std::cout << std::setw(12) << "sw";
std::cout << std::setw(12) << "so";
std::cout << std::setw(12) << "sg";
std::cout << std::setw(12) << "krw";
std::cout << std::setw(12) << "kro";
std::cout << std::setw(12) << "krg";
std::cout << std::setw(12) << "DkrwDsw";
std::cout << std::setw(12) << "DkroDsw";
std::cout << std::setw(12) << "DkrgDsw";
std::cout << std::setw(12) << "DkrwDso";
std::cout << std::setw(12) << "DkroDso";
std::cout << std::setw(12) << "DkrgDso";
std::cout << std::setw(12) << "DkrwDsg";
std::cout << std::setw(12) << "DkroDsg";
std::cout << std::setw(12) << "DkrgDsg";
std::cout << std::endl;
for (int i=0; i<n; ++i) {
std::cout << std::setw(12) << s[i*np+wpos] << std::setw(12) << s[i*np+opos] << std::setw(12) << s[i*np+gpos]
<< std::setw(12) << kr[i*np+wpos] << std::setw(12) << kr[i*np+opos] << std::setw(12) << kr[i*np+gpos];
for (int j=0; j<np*np; ++j) {
std::cout << std::setw(12) << dkrds[i*np*np+j];
}
std::cout << std::endl;
}
*/
}
BOOST_AUTO_TEST_CASE (GwsegEPS_A)
{
// This is the eps (but no hysteris) version of the Gwseg model.
// However, only default scaling parameters, i.e no scaling.
//std::cout << "==================================== GwsegEPS_A ====================================" << std::endl;
Opm::parameter::ParameterGroup param;
Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0);
const UnstructuredGrid& grid = *(gm.c_grid());
Opm::ParserPtr parser(new Opm::Parser() );
Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_A.DATA");
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false);
const int np = props.numPhases();
const int wpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Aqua];
const int opos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Liquid];
const int gpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Vapour];
BOOST_REQUIRE(np == 3);
BOOST_REQUIRE(wpos == 0);
BOOST_REQUIRE(opos == 1);
BOOST_REQUIRE(gpos == 2);
const int n=11;
double s[n*np];
int cells[n];
double kr[n*np];
double dkrds[n*np*np];
const int ncell = 8;
double krw[ncell][n] = {{0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7},
{0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.233333, 0.466667, 0.7, 0.7, 0.7, 0.7},
{0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7},
{0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.233333, 0.466667, 0.7, 0.7, 0.7, 0.7}};
double kro[ncell][n] = {{1.0, 1.0, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0.0, 0.0, 0.0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0}};
double DkrwDsw[ncell][n] = {{0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0},
{0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0},
{0, 0, 0, 0, 0, 2.33333, 2.33333, 0, 0, 0, 0},
{0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0},
{0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0},
{0, 0, 0, 0, 0, 2.33333, 2.33333, 0, 0, 0, 0}};
double DkroDsw[ncell][n] = {{0.0, 0.0, -2.0, -2.0, -1.0, -1.0, -1.0, -1.0, 0.0, 0.0, 0.0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0}};
double DkroDsg[ncell][n] = {{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0}};
for (int icell=0; icell<ncell; ++icell) {
for (int i=0; i<n; ++i) {
cells[i] = icell;
s[i*np+wpos] = i*0.1;
s[i*np+opos] = 1.0-s[i*np+wpos];
s[i*np+gpos] = 0.0;
}
props.relperm(n, s, cells, kr, dkrds);
const double reltol = 1.0e-3;
for (int i=0; i<n; ++i) {
BOOST_CHECK_CLOSE(kr[i*np+wpos], krw[icell][i], reltol);
BOOST_CHECK_CLOSE(kr[i*np+opos], kro[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+wpos], DkrwDsw[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+opos], DkroDsw[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+np*gpos+opos], DkroDsg[icell][i], reltol);
}
/*
std::cout << std::setw(12) << "sw: ";
for (int i=0; i<n; ++i) std::cout << s[i*np+wpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "so: ";
for (int i=0; i<n; ++i) std::cout << s[i*np+opos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "sg: ";
for (int i=0; i<n; ++i) std::cout << s[i*np+gpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "krw: ";
for (int i=0; i<n; ++i) std::cout << kr[i*np+wpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "kro: ";
for (int i=0; i<n; ++i) std::cout << kr[i*np+opos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "krg: ";
for (int i=0; i<n; ++i) std::cout << kr[i*np+gpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkrwDsw: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+wpos*np+wpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkroDsw: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+wpos*np+opos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkrgDsw: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+wpos*np+gpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkrwDso: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+opos*np+wpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkroDso: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+opos*np+opos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkrgDso: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+opos*np+gpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkrwDsg: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+gpos*np+wpos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkroDsg: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+gpos*np+opos] << ", ";
std::cout << std::endl;
std::cout << std::setw(12) << "DkrgDsg: ";
for (int i=0; i<n; ++i) std::cout << dkrds[i*np*np+gpos*np+gpos] << ", ";
std::cout << std::endl;
std::cout << std::endl;
*/
}
}
BOOST_AUTO_TEST_CASE (GwsegEPS_B)
{
// This is the eps (but no hysteris) version of the Gwseg model.
// However, only default scaling parameters, i.e no scaling.
//std::cout << "==================================== GwsegEPS_B ====================================" << std::endl;
/*
Opm::parameter::ParameterGroup param;
Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0);
const UnstructuredGrid& grid = *(gm.c_grid());
Opm::ParserPtr parser(new Opm::Parser() );
Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_B.DATA");
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false);
const int np = props.numPhases();
const int wpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Aqua];
const int opos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Liquid];
const int gpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Vapour];
BOOST_REQUIRE(np == 3);
BOOST_REQUIRE(wpos == 0);
BOOST_REQUIRE(opos == 1);
BOOST_REQUIRE(gpos == 2);
const int n=11;
double s[n*np];
int cells[n];
double kr[n*np];
double dkrds[n*np*np];
const int ncell = 8;
double krw[ncell][n] = {{0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7},
{0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.233333, 0.466667, 0.7, 0.7, 0.7, 0.7},
{0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7},
{0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.233333, 0.466667, 0.7, 0.7, 0.7, 0.7}};
double kro[ncell][n] = {{1.0, 1.0, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0.0, 0.0, 0.0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0}};
double DkrwDsw[ncell][n] = {{0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0},
{0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0},
{0, 0, 0, 0, 0, 2.33333, 2.33333, 0, 0, 0, 0},
{0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0},
{0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0},
{0, 0, 0, 0, 0, 2.33333, 2.33333, 0, 0, 0, 0}};
double DkroDsw[ncell][n] = {{0.0, 0.0, -2.0, -2.0, -1.0, -1.0, -1.0, -1.0, 0.0, 0.0, 0.0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0}};
double DkroDsg[ncell][n] = {{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0}};
for (int icell=0; icell<ncell; ++icell) {
for (int i=0; i<n; ++i) {
cells[i] = icell;
s[i*np+wpos] = i*0.1;
s[i*np+opos] = 1.0-s[i*np+wpos];
s[i*np+gpos] = 0.0;
}
props.relperm(n, s, cells, kr, dkrds);
const double reltol = 1.0e-3;
for (int i=0; i<n; ++i) {
BOOST_CHECK_CLOSE(kr[i*np+wpos], krw[icell][i], reltol);
BOOST_CHECK_CLOSE(kr[i*np+opos], kro[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+wpos], DkrwDsw[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+opos], DkroDsw[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+np*gpos+opos], DkroDsg[icell][i], reltol);
}
}
*/
}
BOOST_AUTO_TEST_CASE (GwsegEPS_C)
{
// This is the eps (but no hysteris) version of the Gwseg model.
// However, only default scaling parameters, i.e no scaling.
//std::cout << "==================================== GwsegEPS_C ====================================" << std::endl;
Opm::parameter::ParameterGroup param;
Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0);
const UnstructuredGrid& grid = *(gm.c_grid());
Opm::ParserPtr parser(new Opm::Parser() );
Opm::DeckConstPtr deck = parser->parseFile("satfuncEPS_C.DATA");
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false);
const int np = props.numPhases();
const int wpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Aqua];
const int opos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Liquid];
const int gpos = props.phaseUsage().phase_pos[Opm::BlackoilPhases::Vapour];
BOOST_REQUIRE(np == 3);
BOOST_REQUIRE(wpos == 0);
BOOST_REQUIRE(opos == 1);
BOOST_REQUIRE(gpos == 2);
const int n=11;
double s[n*np];
int cells[n];
double kr[n*np];
double dkrds[n*np*np];
const int ncell = 8;
double krw[ncell][n] = {{0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7},
{0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.233333, 0.466667, 0.7, 0.7, 0.7, 0.7},
{0.0, 0.0, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.7},
{0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.14, 0.28, 0.42, 0.56, 0.7, 0.7},
{0, 0, 0, 0, 0, 0.233333, 0.466667, 0.7, 0.7, 0.7, 0.7}};
double kro[ncell][n] = {{1.0, 1.0, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0.0, 0.0, 0.0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 0.8, 0.6, 0.4, 0.3, 0.2, 0.1, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0},
{1, 1, 1, 0.766667, 0.533333, 0.35, 0.233333, 0.116667, 0, 0, 0}};
double DkrwDsw[ncell][n] = {{0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0},
{0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0},
{0, 0, 0, 0, 0, 2.33333, 2.33333, 0, 0, 0, 0},
{0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.0, 0.0},
{0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 1.4, 1.4, 1.4, 1.4, 0, 0},
{0, 0, 0, 0, 0, 2.33333, 2.33333, 0, 0, 0, 0}};
double DkroDsw[ncell][n] = {{0.0, 0.0, -2.0, -2.0, -1.0, -1.0, -1.0, -1.0, 0.0, 0.0, 0.0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, -2, -2, -1, -1, -1, -1, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0},
{0, 0, 0, -2.33333, -2.33333, -1.16667, -1.16667, -1.16667, 0, 0, 0}};
double DkroDsg[ncell][n] = {{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -3, -2, -0.666667, -0.75, -0.8, -0.833333, 0.142857, 0, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0},
{-2.32831e-10, -2.32831e-10, -2.32831e-10, -3.14286, -2.14286, -0.809524, -0.892857, -0.942857, 0.190476, 3.17207e-16, 0}};
for (int icell=0; icell<ncell; ++icell) {
for (int i=0; i<n; ++i) {
cells[i] = icell;
s[i*np+wpos] = i*0.1;
s[i*np+opos] = 1.0-s[i*np+wpos];
s[i*np+gpos] = 0.0;
}
props.relperm(n, s, cells, kr, dkrds);
const double reltol = 1.0e-3;
for (int i=0; i<n; ++i) {
BOOST_CHECK_CLOSE(kr[i*np+wpos], krw[icell][i], reltol);
BOOST_CHECK_CLOSE(kr[i*np+opos], kro[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+wpos], DkrwDsw[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+opos], DkroDsw[icell][i], reltol);
BOOST_CHECK_CLOSE(dkrds[i*np*np+np*gpos+opos], DkroDsg[icell][i], reltol);
}
}
}
BOOST_AUTO_TEST_SUITE_END()