From 924818f445b69ebadc3e08e9e532761ae2f3abc6 Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 17 Mar 2015 12:40:27 +0100 Subject: [PATCH] add glue code needed for thermal oil PVT --- opm/autodiff/BlackoilPropsAdFromDeck.cpp | 32 +++++++----------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/opm/autodiff/BlackoilPropsAdFromDeck.cpp b/opm/autodiff/BlackoilPropsAdFromDeck.cpp index 249767d1b..6cf986586 100644 --- a/opm/autodiff/BlackoilPropsAdFromDeck.cpp +++ b/opm/autodiff/BlackoilPropsAdFromDeck.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -169,45 +170,30 @@ BlackoilPropsAdFromDeck::BlackoilPropsAdFromDeck(const BlackoilPropsAdFromDeck& if (numSamples > 0) { auto splinePvdo = std::shared_ptr(new PvtDeadSpline); splinePvdo->initFromOil(pvdoTables, numSamples); - - if (!eclState->getOilvisctTables().empty()) { - splinePvdo->setOilvisctTables(eclState->getOilvisctTables(), - deck->getKeyword("VISCREF")); - } - props_[phase_usage_.phase_pos[Liquid]] = splinePvdo; } else { auto pvdo = std::shared_ptr(new PvtDead); pvdo->initFromOil(pvdoTables); - - if (!eclState->getOilvisctTables().empty()) { - pvdo->setOilvisctTables(eclState->getOilvisctTables(), - deck->getKeyword("VISCREF")); - } - props_[phase_usage_.phase_pos[Liquid]] = pvdo; } } else if (!pvtoTables.empty()) { std::shared_ptr pvto(new PvtLiveOil(pvtoTables)); props_[phase_usage_.phase_pos[Liquid]] = pvto; - - if (!eclState->getOilvisctTables().empty()) { - pvto->setOilvisctTables(eclState->getOilvisctTables(), - deck->getKeyword("VISCREF")); - } } else if (deck->hasKeyword("PVCDO")) { std::shared_ptr pvcdo(new PvtConstCompr); pvcdo->initFromOil(deck->getKeyword("PVCDO")); - - if (!eclState->getOilvisctTables().empty()) { - pvcdo->setOilvisctTables(eclState->getOilvisctTables(), - deck->getKeyword("VISCREF")); - } - props_[phase_usage_.phase_pos[Liquid]] = pvcdo; } else { 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 oilNiPvt(new ThermalOilPvtWrapper); + oilNiPvt->initFromDeck(props_[phase_usage_.phase_pos[Liquid]], deck, eclState); + + props_[phase_usage_.phase_pos[Liquid]] = oilNiPvt; + } } // Gas PVT if (phase_usage_.phase_used[Vapour]) {