コード例 #1
0
RockCompressibility::RockCompressibility(Opm::DeckConstPtr deck,
        Opm::EclipseStateConstPtr eclipseState)
    : pref_(0.0),
      rock_comp_(0.0)
{
    const auto tables = eclipseState->getTableManager();
    const auto& rocktabTables = tables->getRocktabTables();
    if (rocktabTables.size() > 0) {
        const auto& rocktabTable = rocktabTables.getTable<RocktabTable>(0);
        if (rocktabTables.size() != 1)
            OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB.");

        p_ = rocktabTable.getColumn("PO").vectorCopy( );
        poromult_ = rocktabTable.getColumn("PV_MULT").vectorCopy();
        if (rocktabTable.hasColumn("PV_MULT_TRAN")) {
            transmult_ =  rocktabTable.getColumn("PV_MULT_TRAN").vectorCopy();
        } else {
            transmult_ =  rocktabTable.getColumn("PV_MULT_TRANX").vectorCopy();
        }
    } else if (deck->hasKeyword("ROCK")) {
        Opm::DeckKeywordConstPtr rockKeyword = deck->getKeyword("ROCK");
        if (rockKeyword->size() != 1) {
            // here it would be better not to use std::cout directly but to add the
            // warning to some "warning list"...
            std::cout << "Can only handle a single region in ROCK ("<<rockKeyword->size()<<" regions specified)."
                      << " Ignoring all except for the first.\n";
        }

        pref_ = rockKeyword->getRecord(0)->getItem("PREF")->getSIDouble(0);
        rock_comp_ = rockKeyword->getRecord(0)->getItem("COMPRESSIBILITY")->getSIDouble(0);
    } else {
        std::cout << "**** warning: no rock compressibility data found in deck (ROCK or ROCKTAB)." << std::endl;
    }
}
コード例 #2
0
        /// set the tables which specify the temperature dependence of the water viscosity
        void initFromDeck(std::shared_ptr<const PvtInterface> isothermalPvt,
                          Opm::DeckConstPtr deck,
                          Opm::EclipseStateConstPtr eclipseState)
        {
            isothermalPvt_ = isothermalPvt;
            watvisctTables_ = 0;

            // stuff which we need to get from the PVTW keyword
            const auto& pvtwKeyword = deck->getKeyword("PVTW");
            int numRegions = pvtwKeyword.size();
            pvtwRefPress_.resize(numRegions);
            pvtwRefB_.resize(numRegions);
            pvtwCompressibility_.resize(numRegions);
            pvtwViscosity_.resize(numRegions);
            pvtwViscosibility_.resize(numRegions);
            for (int regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
                const auto& pvtwRecord = pvtwKeyword.getRecord(regionIdx);
                pvtwRefPress_[regionIdx] = pvtwRecord.getItem("P_REF").getSIDouble(0);
                pvtwRefB_[regionIdx] = pvtwRecord.getItem("WATER_VOL_FACTOR").getSIDouble(0);
                pvtwViscosity_[regionIdx] = pvtwRecord.getItem("WATER_VISCOSITY").getSIDouble(0);
                pvtwViscosibility_[regionIdx] = pvtwRecord.getItem("WATER_VISCOSIBILITY").getSIDouble(0);
            }

            // quantities required for the temperature dependence of the viscosity
            // (basically we expect well-behaved VISCREF and WATVISCT keywords.)
            if (deck->hasKeyword("VISCREF")) {
                auto tables = eclipseState->getTableManager();
                watvisctTables_ = &tables->getWatvisctTables();
                const auto& viscrefKeyword = deck->getKeyword("VISCREF");

                assert(int(watvisctTables_->size()) == numRegions);
                assert(int(viscrefKeyword.size()) == numRegions);

                viscrefPress_.resize(numRegions);
                for (int regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
                    const auto& viscrefRecord = viscrefKeyword.getRecord(regionIdx);

                    viscrefPress_[regionIdx] = viscrefRecord.getItem("REFERENCE_PRESSURE").getSIDouble(0);
                }
            }

            // quantities required for the temperature dependence of the density
            if (deck->hasKeyword("WATDENT")) {
                const auto& watdentKeyword = deck->getKeyword("WATDENT");

                assert(int(watdentKeyword.size()) == numRegions);

                watdentRefTemp_.resize(numRegions);
                watdentCT1_.resize(numRegions);
                watdentCT2_.resize(numRegions);
                for (int regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
                    const auto& watdentRecord = watdentKeyword.getRecord(regionIdx);

                    watdentRefTemp_[regionIdx] = watdentRecord.getItem("REFERENCE_TEMPERATURE").getSIDouble(0);
                    watdentCT1_[regionIdx] = watdentRecord.getItem("EXPANSION_COEFF_LINEAR").getSIDouble(0);
                    watdentCT2_[regionIdx] = watdentRecord.getItem("EXPANSION_COEFF_QUADRATIC").getSIDouble(0);
                }
            }
        }
コード例 #3
0
    void BlackoilPvtProperties::init(Opm::DeckConstPtr deck,
                                     Opm::EclipseStateConstPtr eclipseState,
                                     int numSamples)
    {
        phase_usage_ = phaseUsageFromDeck(deck);

        // Surface densities. Accounting for different orders in eclipse and our code.
        Opm::DeckKeywordConstPtr densityKeyword = deck->getKeyword("DENSITY");
        int numRegions = densityKeyword->size();

        densities_.resize(numRegions);
        for (int regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
            if (phase_usage_.phase_used[Liquid]) {
                densities_[regionIdx][phase_usage_.phase_pos[Liquid]]
                    = densityKeyword->getRecord(regionIdx)->getItem("OIL")->getSIDouble(0);
            }
            if (phase_usage_.phase_used[Aqua]) {
                densities_[regionIdx][phase_usage_.phase_pos[Aqua]]
                    = densityKeyword->getRecord(regionIdx)->getItem("WATER")->getSIDouble(0);
            }
            if (phase_usage_.phase_used[Vapour]) {
                densities_[regionIdx][phase_usage_.phase_pos[Vapour]]
                    = densityKeyword->getRecord(regionIdx)->getItem("GAS")->getSIDouble(0);
            }
        }

        // Resize the property objects container
        props_.resize(phase_usage_.num_phases);

        // Water PVT
        if (phase_usage_.phase_used[Aqua]) {
            // if water is used, we require the presence of the "PVTW"
            // keyword for now...
            std::shared_ptr<PvtConstCompr> pvtw(new PvtConstCompr);
            pvtw->initFromWater(deck->getKeyword("PVTW"));

            props_[phase_usage_.phase_pos[Aqua]] = pvtw;
        }

        {
            auto tables = eclipseState->getTableManager();
            // Oil PVT
            if (phase_usage_.phase_used[Liquid]) {
                // for oil, we support the "PVDO", "PVTO" and "PVCDO"
                // keywords...
                const auto &pvdoTables = tables->getPvdoTables();
                const auto &pvtoTables = tables->getPvtoTables();
                if (pvdoTables.size() > 0) {
                    if (numSamples > 0) {
                        auto splinePvt = std::shared_ptr<PvtDeadSpline>(new PvtDeadSpline);
                        splinePvt->initFromOil(pvdoTables, numSamples);
                        props_[phase_usage_.phase_pos[Liquid]] = splinePvt;
                    } else {
                        auto deadPvt = std::shared_ptr<PvtDead>(new PvtDead);
                        deadPvt->initFromOil(pvdoTables);
                        props_[phase_usage_.phase_pos[Liquid]] = deadPvt;
                    }
                } else if (pvtoTables.size() > 0) {
                    props_[phase_usage_.phase_pos[Liquid]].reset(new PvtLiveOil(pvtoTables));
                } else if (deck->hasKeyword("PVCDO")) {
                    std::shared_ptr<PvtConstCompr> pvcdo(new PvtConstCompr);
                    pvcdo->initFromOil(deck->getKeyword("PVCDO"));

                    props_[phase_usage_.phase_pos[Liquid]] = pvcdo;
                } else {
                    OPM_THROW(std::runtime_error, "Input is missing PVDO, PVCDO or PVTO\n");
                }
            }
            // Gas PVT
            if (phase_usage_.phase_used[Vapour]) {
                // gas can be specified using the "PVDG" or "PVTG" keywords...
                const auto &pvdgTables = tables->getPvdgTables();
                const auto &pvtgTables = tables->getPvtgTables();
                if (pvdgTables.size() > 0) {
                    if (numSamples > 0) {
                        std::shared_ptr<PvtDeadSpline> splinePvt(new PvtDeadSpline);
                        splinePvt->initFromGas(pvdgTables, numSamples);

                        props_[phase_usage_.phase_pos[Vapour]] = splinePvt;
                    } else {
                        std::shared_ptr<PvtDead> deadPvt(new PvtDead);
                        deadPvt->initFromGas(pvdgTables);

                        props_[phase_usage_.phase_pos[Vapour]] = deadPvt;
                    }
                } else if (pvtgTables.size() > 0) {
                    props_[phase_usage_.phase_pos[Vapour]].reset(new PvtLiveGas(pvtgTables));
                } else {
                    OPM_THROW(std::runtime_error, "Input is missing PVDG or PVTG\n");
                }
            }
        }
    }