예제 #1
0
static void check_parser(ParserPtr parser) {
    DeckPtr deck =  parser->parseString(pvtoData, ParseMode());
    DeckKeywordConstPtr kw1 = deck->getKeyword("PVTO" , 0);
    BOOST_CHECK_EQUAL(5U , kw1->size());

    DeckRecordConstPtr record0 = kw1->getRecord(0);
    DeckRecordConstPtr record1 = kw1->getRecord(1);
    DeckRecordConstPtr record2 = kw1->getRecord(2);
    DeckRecordConstPtr record3 = kw1->getRecord(3);
    DeckRecordConstPtr record4 = kw1->getRecord(4);

    DeckItemConstPtr item0_0 = record0->getItem("RS");
    DeckItemConstPtr item0_1 = record0->getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item0_0->size());
    BOOST_CHECK_EQUAL(9U , item0_1->size());
    BOOST_CHECK_EQUAL(2U , record0->size());

    DeckItemConstPtr item1_0 = record1->getItem("RS");
    DeckItemConstPtr item1_1 = record1->getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item1_0->size());
    BOOST_CHECK_EQUAL(9U , item1_1->size());
    BOOST_CHECK_EQUAL(2U , record1->size());

    DeckItemConstPtr item2_0 = record2->getItem("RS");
    DeckItemConstPtr item2_1 = record2->getItem("DATA");
    BOOST_CHECK(item2_0->defaultApplied(0));
    BOOST_CHECK_EQUAL(0U , item2_1->size());
    BOOST_CHECK_EQUAL(2U , record2->size());

    DeckItemConstPtr item3_0 = record3->getItem("RS");
    DeckItemConstPtr item3_1 = record3->getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item3_0->size());
    BOOST_CHECK_EQUAL(9U , item3_1->size());
    BOOST_CHECK_EQUAL(2U , record3->size());

    DeckItemConstPtr item4_0 = record4->getItem("RS");
    DeckItemConstPtr item4_1 = record4->getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item4_0->size());
    BOOST_CHECK_EQUAL(9U , item4_1->size());
    BOOST_CHECK_EQUAL(2U , record4->size());

    Opm::PvtoTable pvtoTable;
    pvtoTable.initFORUNITTESTONLY(kw1, /*tableIdx=*/0);
    const auto &outerTable = *pvtoTable.getOuterTable();
    const auto &innerTable0 = *pvtoTable.getInnerTable(0);

    BOOST_CHECK_EQUAL(2, outerTable.numRows());
    BOOST_CHECK_EQUAL(4, outerTable.numColumns());
    BOOST_CHECK_EQUAL(3, innerTable0.numRows());
    BOOST_CHECK_EQUAL(3, innerTable0.numColumns());

    BOOST_CHECK_EQUAL(1e-3, outerTable.getGasSolubilityColumn()[0]);
    BOOST_CHECK_EQUAL(1.0e5, outerTable.getPressureColumn()[0]);
    BOOST_CHECK_EQUAL(outerTable.getPressureColumn()[0], innerTable0.getPressureColumn()[0]);
    BOOST_CHECK_EQUAL(1.01, outerTable.getOilFormationFactorColumn()[0]);
    BOOST_CHECK_EQUAL(outerTable.getOilFormationFactorColumn()[0], innerTable0.getOilFormationFactorColumn()[0]);
    BOOST_CHECK_EQUAL(1.02e-3, outerTable.getOilViscosityColumn()[0]);
    BOOST_CHECK_EQUAL(outerTable.getOilViscosityColumn()[0], innerTable0.getOilViscosityColumn()[0]);
}
예제 #2
0
static void check_parser(ParserPtr parser) {
    DeckPtr deck =  parser->parseString(pvtoData, ParseContext());
    const auto& kw1 = deck->getKeyword("PVTO" , 0);
    BOOST_CHECK_EQUAL(5U , kw1.size());

    const auto& record0 = kw1.getRecord(0);
    const auto& record1 = kw1.getRecord(1);
    const auto& record2 = kw1.getRecord(2);
    const auto& record3 = kw1.getRecord(3);
    const auto& record4 = kw1.getRecord(4);

    const auto& item0_0 = record0.getItem("RS");
    const auto& item0_1 = record0.getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item0_0.size());
    BOOST_CHECK_EQUAL(9U , item0_1.size());
    BOOST_CHECK_EQUAL(2U , record0.size());

    const auto& item1_0 = record1.getItem("RS");
    const auto& item1_1 = record1.getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item1_0.size());
    BOOST_CHECK_EQUAL(9U , item1_1.size());
    BOOST_CHECK_EQUAL(2U , record1.size());

    const auto& item2_0 = record2.getItem("RS");
    const auto& item2_1 = record2.getItem("DATA");
    BOOST_CHECK(item2_0.defaultApplied(0));
    BOOST_CHECK_EQUAL(0U , item2_1.size());
    BOOST_CHECK_EQUAL(2U , record2.size());

    const auto& item3_0 = record3.getItem("RS");
    const auto& item3_1 = record3.getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item3_0.size());
    BOOST_CHECK_EQUAL(9U , item3_1.size());
    BOOST_CHECK_EQUAL(2U , record3.size());

    const auto& item4_0 = record4.getItem("RS");
    const auto& item4_1 = record4.getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item4_0.size());
    BOOST_CHECK_EQUAL(9U , item4_1.size());
    BOOST_CHECK_EQUAL(2U , record4.size());


    Opm::PvtoTable pvtoTable(kw1 , 0);
    BOOST_CHECK_EQUAL(2, pvtoTable.size());

    const auto &table0 = pvtoTable.getUnderSaturatedTable(0);
    const auto& BO = table0.getColumn( "BO" );

    BOOST_CHECK_EQUAL( 3, table0.numRows());
    BOOST_CHECK_EQUAL( 3, table0.numColumns());
    BOOST_CHECK_EQUAL( BO.front( ) , 1.01 );
    BOOST_CHECK_EQUAL( BO.back( ) , 1.20 );

    BOOST_CHECK_CLOSE(1.15 , table0.evaluate( "BO" , 250*1e5 ) , 1e-6);

    BOOST_CHECK_CLOSE( 1.15 , pvtoTable.evaluate( "BO" , 1e-3 , 250*1e5 ) , 1e-6 );
    BOOST_CHECK_CLOSE( 1.15 , pvtoTable.evaluate( "BO" , 0.0 , 250*1e5 ) , 1e-6 );
}
예제 #3
0
void check_SgofTable(ParserPtr parser) {
    DeckPtr deck =  parser->parseString(parserData);
    Opm::SgofTable sgofTable(deck->getKeyword("SGOF"));

    BOOST_CHECK_EQUAL(10U, sgofTable.getSgColumn().size());
    BOOST_CHECK_EQUAL(0.1, sgofTable.getSgColumn()[0]);
    BOOST_CHECK_EQUAL(0.0, sgofTable.getKrgColumn()[0]);
    BOOST_CHECK_EQUAL(1.0, sgofTable.getKrogColumn()[0]);
    BOOST_CHECK_EQUAL(0.0, sgofTable.getPcogColumn()[0]);
}
예제 #4
0
void check_parser(ParserPtr parser) {
    DeckPtr deck =  parser->parseString(parserData);
    DeckKeywordConstPtr kw1 = deck->getKeyword("SGOF");
    BOOST_CHECK_EQUAL(1U , kw1->size());

    DeckRecordConstPtr record0 = kw1->getRecord(0);
    BOOST_CHECK_EQUAL(1U , record0->size());

    DeckItemConstPtr item0 = record0->getItem(0);
    BOOST_CHECK_EQUAL(10U * 4, item0->size());
}
예제 #5
0
static void check_parser(ParserPtr parser) {
    DeckPtr deck =  parser->parseString(pvtgData, ParseMode());
    DeckKeywordConstPtr kw1 = deck->getKeyword("PVTG" , 0);
    BOOST_CHECK_EQUAL(5U , kw1->size());

    DeckRecordConstPtr record0 = kw1->getRecord(0);
    DeckRecordConstPtr record1 = kw1->getRecord(1);
    DeckRecordConstPtr record2 = kw1->getRecord(2);
    DeckRecordConstPtr record3 = kw1->getRecord(3);
    DeckRecordConstPtr record4 = kw1->getRecord(4);

    DeckItemConstPtr item0_0 = record0->getItem("GAS_PRESSURE");
    DeckItemConstPtr item0_1 = record0->getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item0_0->size());
    BOOST_CHECK_EQUAL(9U , item0_1->size());
    BOOST_CHECK_EQUAL(2U , record0->size());

    DeckItemConstPtr item1_0 = record1->getItem("GAS_PRESSURE");
    DeckItemConstPtr item1_1 = record1->getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item1_0->size());
    BOOST_CHECK_EQUAL(9U , item1_1->size());
    BOOST_CHECK_EQUAL(2U , record1->size());

    DeckItemConstPtr item2_0 = record2->getItem("GAS_PRESSURE");
    DeckItemConstPtr item2_1 = record2->getItem("DATA");
    BOOST_CHECK( item2_0->defaultApplied(0));
    BOOST_CHECK_EQUAL(0U , item2_1->size());
    BOOST_CHECK_EQUAL(2U , record2->size());


    DeckItemConstPtr item3_0 = record3->getItem("GAS_PRESSURE");
    DeckItemConstPtr item3_1 = record3->getItem("DATA");
    BOOST_CHECK( !item3_1->defaultApplied(0));
    BOOST_CHECK( item3_1->defaultApplied(1));
    BOOST_CHECK( !item3_1->defaultApplied(2));
    BOOST_CHECK( !item3_1->defaultApplied(3));
    BOOST_CHECK( item3_1->defaultApplied(4));
    BOOST_CHECK( !item3_1->defaultApplied(5));
    BOOST_CHECK_EQUAL(1U , item3_0->size());
    BOOST_CHECK_EQUAL(9U , item3_1->size());
    BOOST_CHECK_EQUAL(2U , record3->size());


    DeckItemConstPtr item4_0 = record4->getItem("GAS_PRESSURE");
    DeckItemConstPtr item4_1 = record4->getItem("DATA");
    BOOST_CHECK_EQUAL(1U , item4_0->size());
    BOOST_CHECK_EQUAL(9U , item4_1->size());
    BOOST_CHECK_EQUAL(2U , record4->size());


    {
        Opm::PvtgTable pvtgTable;
        pvtgTable.initFORUNITTESTONLY(kw1, 0);

        const auto &outerTable = *pvtgTable.getOuterTable();
        const auto &innerTable0 = *pvtgTable.getInnerTable(0);

        BOOST_CHECK_EQUAL(2U, outerTable.numRows());
        BOOST_CHECK_EQUAL(4U, outerTable.numColumns());
        BOOST_CHECK_EQUAL(3U, innerTable0.numRows());
        BOOST_CHECK_EQUAL(3U, innerTable0.numColumns());

        BOOST_CHECK_EQUAL(20.0e5, outerTable.getPressureColumn()[0]);
        BOOST_CHECK_EQUAL(0.00002448, outerTable.getOilSolubilityColumn()[0]);
        BOOST_CHECK_EQUAL(outerTable.getOilSolubilityColumn()[0], innerTable0.getOilSolubilityColumn()[0]);
        BOOST_CHECK_EQUAL(0.061895, outerTable.getGasFormationFactorColumn()[0]);
        BOOST_CHECK_EQUAL(outerTable.getGasFormationFactorColumn()[0], innerTable0.getGasFormationFactorColumn()[0]);
        BOOST_CHECK_EQUAL(1.299e-5, outerTable.getGasViscosityColumn()[0]);
        BOOST_CHECK_EQUAL(outerTable.getGasViscosityColumn()[0], innerTable0.getGasViscosityColumn()[0]);
    }
}