Skip to content

Bug in 3D-property initialization #1017

@andlaus

Description

@andlaus

edit: although there seems to be a bug related to the property initialization, the initial analysis is not correct. see below: #1017 (comment)

The Norne deck from opm-data features the "SWL" and "ISWL" double grid properties and the latter is supposed to be identical to the former because it is copied via the COPY statement on line 342 of the deck's main file. Unfortunately opm-parser currently thinks otherwise: Running the following program on the Norne deck

#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>

#include <iostream>
#include <tuple>
#include <vector>

int main(int argc, char** argv)
{
    if (argc != 2) {
        std::cout << "Usage: " << argv[0] << " FILNAME\n";
        return 1;
    }

    Opm::Parser parser;
    typedef std::pair<std::string, Opm::InputError::Action> ParseModePair;
    typedef std::vector<ParseModePair> ParseModePairs;
    ParseModePairs tmp;
    tmp.push_back(ParseModePair(Opm::ParseContext::PARSE_RANDOM_SLASH , Opm::InputError::IGNORE));
    Opm::ParseContext parseContext(tmp);

    const Opm::Deck deck = parser.parseFile(argv[1], parseContext);
    const Opm::EclipseState eclState(deck, parseContext);

    if (!eclState.get3DProperties().hasDeckDoubleGridProperty("SWL"))
        std::cout << "PARSER BUG: the Norne deck features the SWL property!\n";

    if (!eclState.get3DProperties().hasDeckDoubleGridProperty("ISWL"))
        std::cout << "PARSER BUG: the Norne deck features the ISWL property!\n";

    const std::vector<double> &swl =
        eclState.get3DProperties().getDoubleGridProperty("SWL").getData();

    const std::vector<double> &iswl =
        eclState.get3DProperties().getDoubleGridProperty("ISWL").getData();

    for (unsigned i = 0; i < swl.size(); ++i) {
        if (swl[i] != iswl[i]) {
            std::cout << "PARSER BUG: In the Norne deck the SWL and ISWL properties are identical!\n";
            std::cout << "(For cell " << i << " opm-parser says SWL is " << swl[i] << " and ISWL is " << iswl[i] << ".)\n";
            break;
        }
    }

    return 0;
}

yields

PARSER BUG: In the Norne deck the SWL and ISWL properties are identical!
(For cell 0 opm-parser says SWL is 0.04 and ISWL is 0.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions