예제 #1
0
    SinglePvtLiveGas::SinglePvtLiveGas(const Opm::PvtgTable& pvtgTable)
    {
        // GAS, PVTG
        saturated_gas_table_.resize(4);
        saturated_gas_table_[0] = pvtgTable.getOuterTable()->getPressureColumn();
        saturated_gas_table_[1] = pvtgTable.getOuterTable()->getGasFormationFactorColumn();
        saturated_gas_table_[2] = pvtgTable.getOuterTable()->getGasViscosityColumn();
        saturated_gas_table_[3] = pvtgTable.getOuterTable()->getOilSolubilityColumn();

        int sz = pvtgTable.getOuterTable()->numRows();
        undersat_gas_tables_.resize(sz);
        for (int i=0; i<sz; ++i) {
            const auto &undersatTable = *pvtgTable.getInnerTable(i);

            undersat_gas_tables_[i].resize(3);
            undersat_gas_tables_[i][0] = undersatTable.getOilSolubilityColumn();
            undersat_gas_tables_[i][1] = undersatTable.getGasFormationFactorColumn();
            undersat_gas_tables_[i][2] = pvtgTable.getOuterTable()->getGasViscosityColumn();
        }
    }
예제 #2
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]);
    }
}