Made hysteresis variant of gwseg consistent ...

... with the base gwseg behaviour.  Added test.
This commit is contained in:
osae 2014-11-05 17:00:11 +01:00
parent 31d1842ce4
commit 239a5e12e8
2 changed files with 269 additions and 3 deletions

181
tests/satfuncEPS_D.DATA Normal file
View File

@ -0,0 +1,181 @@
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 /
/
SATOPTS
HYSTER /
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 ======
-- Hysteresis input
EHYSTR
0.1 0 0.1 1* KR /
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
/
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

View File

@ -219,7 +219,7 @@ BOOST_AUTO_TEST_CASE (GwsegEPSBase)
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.
// Scaling parameters from keyword SWL etc.
//std::cout << "==================================== GwsegEPS_A ====================================" << std::endl;
@ -366,7 +366,7 @@ BOOST_AUTO_TEST_CASE (GwsegEPS_A)
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.
// Scaling parameters from ENPTVD table.
//std::cout << "==================================== GwsegEPS_B ====================================" << std::endl;
/*
@ -465,7 +465,7 @@ BOOST_AUTO_TEST_CASE (GwsegEPS_B)
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.
// Scaling parameters given the "norne-way", i.e EQUALS, COPY, ADD, MULTIPLY.
//std::cout << "==================================== GwsegEPS_C ====================================" << std::endl;
@ -560,4 +560,89 @@ BOOST_AUTO_TEST_CASE (GwsegEPS_C)
}
BOOST_AUTO_TEST_CASE (GwsegEPS_D)
{
// This is the eps and hysteris version of the Gwseg model.
// However, only default scaling parameters, i.e no scaling.
//std::cout << "==================================== GwsegEPS_D ====================================" << 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_D.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_SUITE_END()