/* Copyright 2014 SINTEF ICT, Applied Mathematics. */ #include "config.h" #define NVERBOSE // Suppress own messages when throw()ing #define BOOST_TEST_MODULE UnitsTest #include #include /* --- our own headers --- */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define CHECK(value, expected, reltol) \ { \ if (std::fabs((expected)) < 1.e-14) \ BOOST_CHECK_SMALL((value), (reltol)); \ else \ BOOST_CHECK_CLOSE((value), (expected), (reltol)); \ } 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::ParameterGroup param; Opm::GridManager gm(1, 1, 10, 1.0, 1.0, 5.0); const UnstructuredGrid& grid = *(gm.c_grid()); Opm::ParseContext parseContext; Opm::Parser parser; Opm::Deck deck = parser.parseFile("satfuncStandard.DATA", parseContext); Opm::EclipseState eclipseState(deck , parseContext); Opm::BlackoilPropertiesFromDeck props(deck, eclipseState, grid, param, false); const int np = 3; 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 == props.numPhases()); 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; iparseFile("satfuncEPS_B.DATA"); const Opm::EclipseState& 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