add glue code needed for thermal oil PVT

This commit is contained in:
Andreas Lauser 2015-03-17 12:40:27 +01:00
parent debb8a1a04
commit 924818f445

View File

@ -32,6 +32,7 @@
#include <opm/core/props/pvt/PvtLiveOil.hpp> #include <opm/core/props/pvt/PvtLiveOil.hpp>
#include <opm/core/props/pvt/PvtLiveGas.hpp> #include <opm/core/props/pvt/PvtLiveGas.hpp>
#include <opm/core/props/pvt/ThermalWaterPvtWrapper.hpp> #include <opm/core/props/pvt/ThermalWaterPvtWrapper.hpp>
#include <opm/core/props/pvt/ThermalOilPvtWrapper.hpp>
#include <opm/core/utility/ErrorMacros.hpp> #include <opm/core/utility/ErrorMacros.hpp>
#include <opm/core/utility/Units.hpp> #include <opm/core/utility/Units.hpp>
@ -169,45 +170,30 @@ BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck&
if (numSamples > 0) { if (numSamples > 0) {
auto splinePvdo = std::shared_ptr<PvtDeadSpline>(new PvtDeadSpline); auto splinePvdo = std::shared_ptr<PvtDeadSpline>(new PvtDeadSpline);
splinePvdo->initFromOil(pvdoTables, numSamples); splinePvdo->initFromOil(pvdoTables, numSamples);
if (!eclState->getOilvisctTables().empty()) {
splinePvdo->setOilvisctTables(eclState->getOilvisctTables(),
deck->getKeyword("VISCREF"));
}
props_[phase_usage_.phase_pos[Liquid]] = splinePvdo; props_[phase_usage_.phase_pos[Liquid]] = splinePvdo;
} else { } else {
auto pvdo = std::shared_ptr<PvtDead>(new PvtDead); auto pvdo = std::shared_ptr<PvtDead>(new PvtDead);
pvdo->initFromOil(pvdoTables); pvdo->initFromOil(pvdoTables);
if (!eclState->getOilvisctTables().empty()) {
pvdo->setOilvisctTables(eclState->getOilvisctTables(),
deck->getKeyword("VISCREF"));
}
props_[phase_usage_.phase_pos[Liquid]] = pvdo; props_[phase_usage_.phase_pos[Liquid]] = pvdo;
} }
} else if (!pvtoTables.empty()) { } else if (!pvtoTables.empty()) {
std::shared_ptr<PvtLiveOil> pvto(new PvtLiveOil(pvtoTables)); std::shared_ptr<PvtLiveOil> pvto(new PvtLiveOil(pvtoTables));
props_[phase_usage_.phase_pos[Liquid]] = pvto; props_[phase_usage_.phase_pos[Liquid]] = pvto;
if (!eclState->getOilvisctTables().empty()) {
pvto->setOilvisctTables(eclState->getOilvisctTables(),
deck->getKeyword("VISCREF"));
}
} else if (deck->hasKeyword("PVCDO")) { } else if (deck->hasKeyword("PVCDO")) {
std::shared_ptr<PvtConstCompr> pvcdo(new PvtConstCompr); std::shared_ptr<PvtConstCompr> pvcdo(new PvtConstCompr);
pvcdo->initFromOil(deck->getKeyword("PVCDO")); pvcdo->initFromOil(deck->getKeyword("PVCDO"));
if (!eclState->getOilvisctTables().empty()) {
pvcdo->setOilvisctTables(eclState->getOilvisctTables(),
deck->getKeyword("VISCREF"));
}
props_[phase_usage_.phase_pos[Liquid]] = pvcdo; props_[phase_usage_.phase_pos[Liquid]] = pvcdo;
} else { } else {
OPM_THROW(std::runtime_error, "Input is missing PVDO, PVCDO or PVTO\n"); OPM_THROW(std::runtime_error, "Input is missing PVDO, PVCDO or PVTO\n");
} }
// handle temperature dependence of the oil phase
if (!eclState->getOilvisctTables().empty() || deck->hasKeyword("THERMEX1")) {
std::shared_ptr<ThermalOilPvtWrapper> oilNiPvt(new ThermalOilPvtWrapper);
oilNiPvt->initFromDeck(props_[phase_usage_.phase_pos[Liquid]], deck, eclState);
props_[phase_usage_.phase_pos[Liquid]] = oilNiPvt;
}
} }
// Gas PVT // Gas PVT
if (phase_usage_.phase_used[Vapour]) { if (phase_usage_.phase_used[Vapour]) {