Merge pull request #403 from akva2/avoid_deck_usage
changed: void more deck usage setting up pvt classes
This commit is contained in:
commit
d4ee80c358
@ -111,8 +111,8 @@ public:
|
|||||||
const auto& tables = eclState.getTableManager();
|
const auto& tables = eclState.getTableManager();
|
||||||
|
|
||||||
enableThermalDensity_ = deck.hasKeyword("GASDENT");
|
enableThermalDensity_ = deck.hasKeyword("GASDENT");
|
||||||
enableThermalViscosity_ = deck.hasKeyword("GASVISCT");
|
enableThermalViscosity_ = tables.hasTables("GASVISCT");
|
||||||
enableInternalEnergy_ = deck.hasKeyword("SPECHEAT");
|
enableInternalEnergy_ = tables.hasTables("SPECHEAT");
|
||||||
|
|
||||||
unsigned numRegions = isothermalPvt_->numRegions();
|
unsigned numRegions = isothermalPvt_->numRegions();
|
||||||
setNumRegions(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
|
// 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
|
// (via the SPECHEAT keyword) and we need to integrate it ourselfs to get the
|
||||||
// internal energy
|
// internal energy
|
||||||
|
@ -117,31 +117,30 @@ public:
|
|||||||
const auto& tables = eclState.getTableManager();
|
const auto& tables = eclState.getTableManager();
|
||||||
|
|
||||||
enableThermalDensity_ = deck.hasKeyword("OILDENT");
|
enableThermalDensity_ = deck.hasKeyword("OILDENT");
|
||||||
enableThermalViscosity_ = deck.hasKeyword("OILVISCT");
|
enableThermalViscosity_ = tables.hasTables("OILVISCT");
|
||||||
enableInternalEnergy_ = deck.hasKeyword("SPECHEAT");
|
enableInternalEnergy_ = tables.hasTables("SPECHEAT");
|
||||||
|
|
||||||
unsigned numRegions = isothermalPvt_->numRegions();
|
unsigned numRegions = isothermalPvt_->numRegions();
|
||||||
setNumRegions(numRegions);
|
setNumRegions(numRegions);
|
||||||
|
|
||||||
// viscosity
|
// viscosity
|
||||||
if (deck.hasKeyword("OILVISCT")) {
|
if (enableThermalViscosity_) {
|
||||||
if (!deck.hasKeyword("VISCREF"))
|
if (tables.getViscrefTable().empty())
|
||||||
throw std::runtime_error("VISCREF is required when OILVISCT is present");
|
throw std::runtime_error("VISCREF is required when OILVISCT is present");
|
||||||
|
|
||||||
const auto& oilvisctTables = tables.getOilvisctTables();
|
const auto& oilvisctTables = tables.getOilvisctTables();
|
||||||
const auto& viscrefKeyword = deck.getKeyword("VISCREF");
|
const auto& viscrefTable = tables.getViscrefTable();
|
||||||
|
|
||||||
assert(oilvisctTables.size() == numRegions);
|
assert(oilvisctTables.size() == numRegions);
|
||||||
assert(viscrefKeyword.size() == numRegions);
|
assert(viscrefTable.size() == numRegions);
|
||||||
|
|
||||||
for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
|
||||||
const auto& TCol = oilvisctTables[regionIdx].getColumn("Temperature").vectorCopy();
|
const auto& TCol = oilvisctTables[regionIdx].getColumn("Temperature").vectorCopy();
|
||||||
const auto& muCol = oilvisctTables[regionIdx].getColumn("Viscosity").vectorCopy();
|
const auto& muCol = oilvisctTables[regionIdx].getColumn("Viscosity").vectorCopy();
|
||||||
oilvisctCurves_[regionIdx].setXYContainers(TCol, muCol);
|
oilvisctCurves_[regionIdx].setXYContainers(TCol, muCol);
|
||||||
|
|
||||||
const auto& viscrefRecord = viscrefKeyword.getRecord(regionIdx);
|
viscrefPress_[regionIdx] = viscrefTable[regionIdx].reference_pressure;
|
||||||
viscrefPress_[regionIdx] = viscrefRecord.getItem("REFERENCE_PRESSURE").getSIDouble(0);
|
viscrefRs_[regionIdx] = viscrefTable[regionIdx].reference_rs;
|
||||||
viscrefRs_[regionIdx] = viscrefRecord.getItem("REFERENCE_RS").getSIDouble(0);
|
|
||||||
|
|
||||||
// temperature used to calculate the reference viscosity [K]. the
|
// temperature used to calculate the reference viscosity [K]. the
|
||||||
// value does not really matter if the underlying PVT object really
|
// 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
|
// 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
|
// heat capacity (via the SPECHEAT keyword) and we need to integrate it
|
||||||
// ourselfs to get the internal energy
|
// ourselfs to get the internal energy
|
||||||
|
@ -123,8 +123,8 @@ public:
|
|||||||
const auto& tables = eclState.getTableManager();
|
const auto& tables = eclState.getTableManager();
|
||||||
|
|
||||||
enableThermalDensity_ = deck.hasKeyword("WATDENT");
|
enableThermalDensity_ = deck.hasKeyword("WATDENT");
|
||||||
enableThermalViscosity_ = deck.hasKeyword("WATVISCT");
|
enableThermalViscosity_ = tables.hasTables("WATVISCT");
|
||||||
enableInternalEnergy_ = deck.hasKeyword("SPECHEAT");
|
enableInternalEnergy_ = tables.hasTables("SPECHEAT");
|
||||||
|
|
||||||
unsigned numRegions = isothermalPvt_->numRegions();
|
unsigned numRegions = isothermalPvt_->numRegions();
|
||||||
setNumRegions(numRegions);
|
setNumRegions(numRegions);
|
||||||
@ -144,37 +144,33 @@ public:
|
|||||||
|
|
||||||
if (enableThermalViscosity_) {
|
if (enableThermalViscosity_) {
|
||||||
|
|
||||||
if (!deck.hasKeyword("VISCREF"))
|
if (tables.getViscrefTable().empty())
|
||||||
throw std::runtime_error("VISCREF is required when WATVISCT is present");
|
throw std::runtime_error("VISCREF is required when WATVISCT is present");
|
||||||
|
|
||||||
const auto& viscrefKeyword = deck.getKeyword("VISCREF");
|
|
||||||
const auto& watvisctTables = tables.getWatvisctTables();
|
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(watvisctTables.size() == numRegions);
|
||||||
assert(viscrefKeyword.size() == numRegions);
|
assert(viscrefTables.size() == numRegions);
|
||||||
|
|
||||||
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
|
||||||
const auto& T = watvisctTables[regionIdx].getColumn("Temperature").vectorCopy();
|
const auto& T = watvisctTables[regionIdx].getColumn("Temperature").vectorCopy();
|
||||||
const auto& mu = watvisctTables[regionIdx].getColumn("Viscosity").vectorCopy();
|
const auto& mu = watvisctTables[regionIdx].getColumn("Viscosity").vectorCopy();
|
||||||
watvisctCurves_[regionIdx].setXYContainers(T, mu);
|
watvisctCurves_[regionIdx].setXYContainers(T, mu);
|
||||||
|
|
||||||
const auto& viscrefRecord = viscrefKeyword.getRecord(regionIdx);
|
viscrefPress_[regionIdx] = viscrefTables[regionIdx].reference_pressure;
|
||||||
viscrefPress_[regionIdx] = viscrefRecord.getItem("REFERENCE_PRESSURE").getSIDouble(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
|
||||||
auto pvtwRecord = pvtwKeyword.getRecord(regionIdx);
|
pvtwViscosity_[regionIdx] = pvtwTables[regionIdx].viscosity;
|
||||||
pvtwViscosity_[regionIdx] =
|
pvtwViscosibility_[regionIdx] = pvtwTables[regionIdx].viscosibility;
|
||||||
pvtwRecord.getItem("WATER_VISCOSITY").getSIDouble(0);
|
|
||||||
pvtwViscosibility_[regionIdx] =
|
|
||||||
pvtwRecord.getItem("WATER_VISCOSIBILITY").getSIDouble(0);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deck.hasKeyword("SPECHEAT")) {
|
if (enableInternalEnergy_) {
|
||||||
// the specific internal energy of liquid water. be aware that ecl only specifies the heat capacity
|
// 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
|
// (via the SPECHEAT keyword) and we need to integrate it ourselfs to get the
|
||||||
// internal energy
|
// internal energy
|
||||||
|
Loading…
Reference in New Issue
Block a user