Merge pull request #1915 from goncalvesmachadoc/addSpyderwebGrid
add Spiderweb grid
This commit is contained in:
@@ -80,6 +80,7 @@ namespace Opm {
|
||||
|
||||
static bool hasGDFILE(const Deck& deck);
|
||||
static bool hasCylindricalKeywords(const Deck& deck);
|
||||
static bool hasSpiderwebKeywords(const Deck& deck);
|
||||
static bool hasCornerPointKeywords(const Deck&);
|
||||
static bool hasCartesianKeywords(const Deck&);
|
||||
size_t getNumActive( ) const;
|
||||
@@ -229,6 +230,7 @@ namespace Opm {
|
||||
bool keywInputBeforeGdfile(const Deck& deck, const std::string keyword) const;
|
||||
|
||||
void initCylindricalGrid(const Deck&);
|
||||
void initSpiderwebGrid(const Deck&);
|
||||
void initCartesianGrid(const Deck&);
|
||||
void initDTOPSGrid(const Deck&);
|
||||
void initDVDEPTHZGrid(const Deck&);
|
||||
|
||||
@@ -280,6 +280,8 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum)
|
||||
|
||||
if (deck.hasKeyword<ParserKeywords::RADIAL>()) {
|
||||
initCylindricalGrid(deck );
|
||||
} else if (deck.hasKeyword<ParserKeywords::SPIDER>()) {
|
||||
initSpiderwebGrid(deck );
|
||||
} else {
|
||||
if (hasCornerPointKeywords(deck)) {
|
||||
initCornerPointGrid(deck);
|
||||
@@ -919,19 +921,24 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum)
|
||||
return zcorn;
|
||||
}
|
||||
|
||||
void EclipseGrid::initCylindricalGrid(const Deck& deck)
|
||||
{
|
||||
throw std::invalid_argument("Cylindrical grid not implemented yet, use SPIDER web grid keyword instead for radial flow modeling");
|
||||
}
|
||||
|
||||
/*
|
||||
Limited implementaton - requires keywords: DRV, DTHETAV, DZV and TOPS.
|
||||
*/
|
||||
|
||||
void EclipseGrid::initCylindricalGrid(const Deck& deck)
|
||||
void EclipseGrid::initSpiderwebGrid(const Deck& deck)
|
||||
{
|
||||
// The hasCyindricalKeywords( ) checks according to the
|
||||
// eclipse specification. We currently do not support all
|
||||
// The hasSpiderKeywords( ) checks according to the
|
||||
// eclipse specification for RADIAL grid. We currently do not support all
|
||||
// aspects of cylindrical grids, we therefor have an
|
||||
// additional test here, which checks if we have the keywords
|
||||
// required by the current implementation.
|
||||
if (!hasCylindricalKeywords(deck))
|
||||
throw std::invalid_argument("Not all keywords required for cylindrical grids present");
|
||||
throw std::invalid_argument("Not all keywords required for spiderweb grids present");
|
||||
|
||||
if (!deck.hasKeyword<ParserKeywords::DTHETAV>())
|
||||
throw std::logic_error("The current implementation *must* have theta values specified using the DTHETAV keyword");
|
||||
@@ -975,7 +982,7 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum)
|
||||
|
||||
/*
|
||||
Now the data has been validated, now we continue to create
|
||||
ZCORN and COORD vectors, and we are done.
|
||||
ZCORN and COORD vectors, and we are almost done.
|
||||
*/
|
||||
{
|
||||
ZcornMapper zm( this->getNX(), this->getNY(), this->getNZ());
|
||||
@@ -1041,6 +1048,7 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void EclipseGrid::initCornerPointGrid(const std::vector<double>& coord ,
|
||||
const std::vector<double>& zcorn ,
|
||||
const int * actnum,
|
||||
|
||||
6
src/opm/parser/eclipse/share/keywords/900_OPM/S/SPIDER
Normal file
6
src/opm/parser/eclipse/share/keywords/900_OPM/S/SPIDER
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "SPIDER",
|
||||
"sections": [
|
||||
"RUNSPEC"
|
||||
]
|
||||
}
|
||||
@@ -1110,6 +1110,7 @@ set( keywords
|
||||
900_OPM/S/SALTSOL
|
||||
900_OPM/S/SKPRPOLY
|
||||
900_OPM/S/SKPRWAT
|
||||
900_OPM/S/SPIDER
|
||||
900_OPM/S/SPOLYMW
|
||||
900_OPM/T/TLPMIXPA
|
||||
900_OPM/V/VAPWAT
|
||||
|
||||
@@ -1242,13 +1242,13 @@ BOOST_AUTO_TEST_CASE(RadialTest) {
|
||||
BOOST_CHECK_THROW( Opm::EclipseGrid{ deck }, std::invalid_argument);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RadialKeywordsOK) {
|
||||
BOOST_AUTO_TEST_CASE(RadialKeywordsOK, *boost::unit_test::disabled()) {
|
||||
Opm::Deck deck = radial_keywords_OK();
|
||||
Opm::EclipseGrid grid( deck );
|
||||
BOOST_CHECK(!grid.circle());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RadialKeywordsOK_CIRCLE) {
|
||||
BOOST_AUTO_TEST_CASE(RadialKeywordsOK_CIRCLE, *boost::unit_test::disabled()) {
|
||||
Opm::Deck deck = radial_keywords_OK_CIRCLE();
|
||||
Opm::EclipseGrid grid( deck );
|
||||
BOOST_CHECK(grid.circle());
|
||||
@@ -1397,13 +1397,14 @@ BOOST_AUTO_TEST_CASE(RadialKeywords_SIZE_ERROR) {
|
||||
BOOST_CHECK_THROW( Opm::EclipseGrid{ radial_keywords_ANGLE_OVERFLOW() } , std::invalid_argument);
|
||||
}
|
||||
|
||||
static Opm::Deck radial_details() {
|
||||
|
||||
static Opm::Deck spider_details() {
|
||||
const char* deckData =
|
||||
"RUNSPEC\n"
|
||||
"\n"
|
||||
"DIMENS\n"
|
||||
"1 5 2 /\n"
|
||||
"RADIAL\n"
|
||||
"SPIDER\n"
|
||||
"GRID\n"
|
||||
"INRAD\n"
|
||||
"1 /\n"
|
||||
@@ -1423,8 +1424,8 @@ static Opm::Deck radial_details() {
|
||||
return parser.parseString( deckData);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(RadialDetails) {
|
||||
Opm::Deck deck = radial_details();
|
||||
BOOST_AUTO_TEST_CASE(SpiderDetails) {
|
||||
Opm::Deck deck = spider_details();
|
||||
Opm::EclipseGrid grid( deck );
|
||||
|
||||
BOOST_CHECK_CLOSE( grid.getCellVolume( 0 , 0 , 0 ) , 0.5*(2*2 - 1)*1, 0.0001);
|
||||
|
||||
Reference in New Issue
Block a user