2012-01-31 02:41:53 -06:00
|
|
|
/*
|
|
|
|
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2013-04-10 05:56:14 -05:00
|
|
|
#include "config.h"
|
2013-03-14 04:29:42 -05:00
|
|
|
#include <opm/core/props/pvt/PvtPropertiesIncompFromDeck.hpp>
|
|
|
|
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
2016-10-10 10:23:03 -05:00
|
|
|
#include <opm/parser/eclipse/Units/Units.hpp>
|
2015-10-08 04:42:15 -05:00
|
|
|
#include <opm/common/ErrorMacros.hpp>
|
2013-03-14 04:29:42 -05:00
|
|
|
#include <opm/core/props/BlackoilPhases.hpp>
|
2016-01-24 16:09:47 -06:00
|
|
|
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
|
|
|
|
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
2016-01-20 07:12:04 -06:00
|
|
|
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
2012-01-31 02:41:53 -06:00
|
|
|
|
|
|
|
|
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
|
|
|
|
PvtPropertiesIncompFromDeck::PvtPropertiesIncompFromDeck()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2016-10-13 09:03:35 -05:00
|
|
|
void PvtPropertiesIncompFromDeck::init(const Opm::Deck& deck)
|
2014-04-17 04:50:23 -05:00
|
|
|
{
|
2014-05-13 05:59:11 -05:00
|
|
|
// So far, this class only supports a single PVT region. TODO?
|
2014-04-17 04:50:23 -05:00
|
|
|
int region_number = 0;
|
|
|
|
|
2014-04-26 05:03:07 -05:00
|
|
|
PhaseUsage phase_usage = phaseUsageFromDeck(deck);
|
2014-04-17 04:50:23 -05:00
|
|
|
if (phase_usage.phase_used[PhaseUsage::Vapour] ||
|
|
|
|
!phase_usage.phase_used[PhaseUsage::Aqua] ||
|
|
|
|
!phase_usage.phase_used[PhaseUsage::Liquid]) {
|
|
|
|
OPM_THROW(std::runtime_error, "PvtPropertiesIncompFromDeck::init() -- must have gas and oil phases (only) in deck input.\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Surface densities. Accounting for different orders in eclipse and our code.
|
2016-10-13 09:03:35 -05:00
|
|
|
if (deck.hasKeyword("DENSITY")) {
|
|
|
|
const auto& densityRecord = deck.getKeyword("DENSITY").getRecord(region_number);
|
2016-02-09 07:36:12 -06:00
|
|
|
surface_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] = densityRecord.getItem("OIL").getSIDouble(0);
|
|
|
|
surface_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] = densityRecord.getItem("WATER").getSIDouble(0);
|
2014-04-17 04:50:23 -05:00
|
|
|
} else {
|
|
|
|
OPM_THROW(std::runtime_error, "Input is missing DENSITY\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Make reservoir densities the same as surface densities initially.
|
|
|
|
// We will modify them with formation volume factors if found.
|
|
|
|
reservoir_density_ = surface_density_;
|
|
|
|
|
|
|
|
// Water viscosity.
|
2016-10-13 09:03:35 -05:00
|
|
|
if (deck.hasKeyword("PVTW")) {
|
|
|
|
const auto& pvtwRecord = deck.getKeyword("PVTW").getRecord(region_number);
|
2016-02-09 07:36:12 -06:00
|
|
|
if (pvtwRecord.getItem("WATER_COMPRESSIBILITY").getSIDouble(0) != 0.0 ||
|
|
|
|
pvtwRecord.getItem("WATER_VISCOSIBILITY").getSIDouble(0) != 0.0) {
|
2014-04-17 04:50:23 -05:00
|
|
|
OPM_MESSAGE("Compressibility effects in PVTW are ignored.");
|
|
|
|
}
|
2016-02-09 07:36:12 -06:00
|
|
|
reservoir_density_[phase_usage.phase_pos[PhaseUsage::Aqua]] /= pvtwRecord.getItem("WATER_VOL_FACTOR").getSIDouble(0);
|
|
|
|
viscosity_[phase_usage.phase_pos[PhaseUsage::Aqua]] = pvtwRecord.getItem("WATER_VISCOSITY").getSIDouble(0);
|
2014-04-17 04:50:23 -05:00
|
|
|
} else {
|
|
|
|
// Eclipse 100 default.
|
|
|
|
// viscosity_[phase_usage.phase_pos[PhaseUsage::Aqua]] = 0.5*Opm::prefix::centi*Opm::unit::Poise;
|
|
|
|
OPM_THROW(std::runtime_error, "Input is missing PVTW\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
// Oil viscosity.
|
2016-10-13 09:03:35 -05:00
|
|
|
if (deck.hasKeyword("PVCDO")) {
|
|
|
|
const auto& pvcdoRecord = deck.getKeyword("PVCDO").getRecord(region_number);
|
2014-04-17 04:50:23 -05:00
|
|
|
|
2016-02-09 07:36:12 -06:00
|
|
|
if (pvcdoRecord.getItem("OIL_COMPRESSIBILITY").getSIDouble(0) != 0.0 ||
|
|
|
|
pvcdoRecord.getItem("OIL_VISCOSIBILITY").getSIDouble(0) != 0.0) {
|
2014-04-17 04:50:23 -05:00
|
|
|
OPM_MESSAGE("Compressibility effects in PVCDO are ignored.");
|
|
|
|
}
|
2016-02-09 07:36:12 -06:00
|
|
|
reservoir_density_[phase_usage.phase_pos[PhaseUsage::Liquid]] /= pvcdoRecord.getItem("OIL_VOL_FACTOR").getSIDouble(0);
|
|
|
|
viscosity_[phase_usage.phase_pos[PhaseUsage::Liquid]] = pvcdoRecord.getItem("OIL_VISCOSITY").getSIDouble(0);
|
2014-04-17 04:50:23 -05:00
|
|
|
} else {
|
|
|
|
OPM_THROW(std::runtime_error, "Input is missing PVCDO\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-01-31 02:41:53 -06:00
|
|
|
const double* PvtPropertiesIncompFromDeck::surfaceDensities() const
|
|
|
|
{
|
2012-04-20 07:00:38 -05:00
|
|
|
return surface_density_.data();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const double* PvtPropertiesIncompFromDeck::reservoirDensities() const
|
|
|
|
{
|
|
|
|
return reservoir_density_.data();
|
2012-01-31 02:41:53 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const double* PvtPropertiesIncompFromDeck::viscosity() const
|
|
|
|
{
|
|
|
|
return viscosity_.data();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int PvtPropertiesIncompFromDeck::numPhases() const
|
|
|
|
{
|
|
|
|
return 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Opm
|