changed: void more deck usage setting up pvt classes

This commit is contained in:
Arne Morten Kvarving 2020-02-24 10:50:41 +01:00
parent 2f838a4268
commit 723c619b5e
3 changed files with 23 additions and 28 deletions

View File

@ -111,8 +111,8 @@ public:
const auto& tables = eclState.getTableManager();
enableThermalDensity_ = deck.hasKeyword("GASDENT");
enableThermalViscosity_ = deck.hasKeyword("GASVISCT");
enableInternalEnergy_ = deck.hasKeyword("SPECHEAT");
enableThermalViscosity_ = tables.hasTables("GASVISCT");
enableInternalEnergy_ = tables.hasTables("SPECHEAT");
unsigned numRegions = isothermalPvt_->numRegions();
setNumRegions(numRegions);
@ -144,7 +144,7 @@ public:
}
}
if (deck.hasKeyword("SPECHEAT")) {
if (enableInternalEnergy_) {
// the specific internal energy of gas. be aware that ecl only specifies the heat capacity
// (via the SPECHEAT keyword) and we need to integrate it ourselfs to get the
// internal energy

View File

@ -117,31 +117,30 @@ public:
const auto& tables = eclState.getTableManager();
enableThermalDensity_ = deck.hasKeyword("OILDENT");
enableThermalViscosity_ = deck.hasKeyword("OILVISCT");
enableInternalEnergy_ = deck.hasKeyword("SPECHEAT");
enableThermalViscosity_ = tables.hasTables("OILVISCT");
enableInternalEnergy_ = tables.hasTables("SPECHEAT");
unsigned numRegions = isothermalPvt_->numRegions();
setNumRegions(numRegions);
// viscosity
if (deck.hasKeyword("OILVISCT")) {
if (!deck.hasKeyword("VISCREF"))
if (enableThermalViscosity_) {
if (tables.getViscrefTable().empty())
throw std::runtime_error("VISCREF is required when OILVISCT is present");
const auto& oilvisctTables = tables.getOilvisctTables();
const auto& viscrefKeyword = deck.getKeyword("VISCREF");
const auto& viscrefTable = tables.getViscrefTable();
assert(oilvisctTables.size() == numRegions);
assert(viscrefKeyword.size() == numRegions);
assert(viscrefTable.size() == numRegions);
for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
const auto& TCol = oilvisctTables[regionIdx].getColumn("Temperature").vectorCopy();
const auto& muCol = oilvisctTables[regionIdx].getColumn("Viscosity").vectorCopy();
oilvisctCurves_[regionIdx].setXYContainers(TCol, muCol);
const auto& viscrefRecord = viscrefKeyword.getRecord(regionIdx);
viscrefPress_[regionIdx] = viscrefRecord.getItem("REFERENCE_PRESSURE").getSIDouble(0);
viscrefRs_[regionIdx] = viscrefRecord.getItem("REFERENCE_RS").getSIDouble(0);
viscrefPress_[regionIdx] = viscrefTable[regionIdx].reference_pressure;
viscrefRs_[regionIdx] = viscrefTable[regionIdx].reference_rs;
// temperature used to calculate the reference viscosity [K]. the
// value does not really matter if the underlying PVT object really
@ -171,7 +170,7 @@ public:
}
}
if (deck.hasKeyword("SPECHEAT")) {
if (enableInternalEnergy_) {
// the specific internal energy of liquid oil. be aware that ecl only specifies the
// heat capacity (via the SPECHEAT keyword) and we need to integrate it
// ourselfs to get the internal energy

View File

@ -123,8 +123,8 @@ public:
const auto& tables = eclState.getTableManager();
enableThermalDensity_ = deck.hasKeyword("WATDENT");
enableThermalViscosity_ = deck.hasKeyword("WATVISCT");
enableInternalEnergy_ = deck.hasKeyword("SPECHEAT");
enableThermalViscosity_ = tables.hasTables("WATVISCT");
enableInternalEnergy_ = tables.hasTables("SPECHEAT");
unsigned numRegions = isothermalPvt_->numRegions();
setNumRegions(numRegions);
@ -144,37 +144,33 @@ public:
if (enableThermalViscosity_) {
if (!deck.hasKeyword("VISCREF"))
if (tables.getViscrefTable().empty())
throw std::runtime_error("VISCREF is required when WATVISCT is present");
const auto& viscrefKeyword = deck.getKeyword("VISCREF");
const auto& watvisctTables = tables.getWatvisctTables();
const auto& viscrefTables = tables.getViscrefTable();
const auto& pvtwKeyword = deck.getKeyword("PVTW");
const auto& pvtwTables = tables.getPvtwTable();
assert(pvtwKeyword.size() == numRegions);
assert(pvtwTables.size() == numRegions);
assert(watvisctTables.size() == numRegions);
assert(viscrefKeyword.size() == numRegions);
assert(viscrefTables.size() == numRegions);
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
const auto& T = watvisctTables[regionIdx].getColumn("Temperature").vectorCopy();
const auto& mu = watvisctTables[regionIdx].getColumn("Viscosity").vectorCopy();
watvisctCurves_[regionIdx].setXYContainers(T, mu);
const auto& viscrefRecord = viscrefKeyword.getRecord(regionIdx);
viscrefPress_[regionIdx] = viscrefRecord.getItem("REFERENCE_PRESSURE").getSIDouble(0);
viscrefPress_[regionIdx] = viscrefTables[regionIdx].reference_pressure;
}
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
auto pvtwRecord = pvtwKeyword.getRecord(regionIdx);
pvtwViscosity_[regionIdx] =
pvtwRecord.getItem("WATER_VISCOSITY").getSIDouble(0);
pvtwViscosibility_[regionIdx] =
pvtwRecord.getItem("WATER_VISCOSIBILITY").getSIDouble(0);
pvtwViscosity_[regionIdx] = pvtwTables[regionIdx].viscosity;
pvtwViscosibility_[regionIdx] = pvtwTables[regionIdx].viscosibility;
}
}
if (deck.hasKeyword("SPECHEAT")) {
if (enableInternalEnergy_) {
// the specific internal energy of liquid water. be aware that ecl only specifies the heat capacity
// (via the SPECHEAT keyword) and we need to integrate it ourselfs to get the
// internal energy