mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-28 18:21:00 -06:00
Merge pull request #598 from akva2/use_tlmixpar_from_state
use TLMIXPAR from state
This commit is contained in:
commit
913439ec28
@ -286,27 +286,21 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (deck.hasKeyword("TLMIXPAR")) {
|
if (!eclState.getTableManager().getTlmixparTable().empty()) {
|
||||||
// resize the attributes of the object
|
// resize the attributes of the object
|
||||||
tlMixParamViscosity_.resize(numMiscRegions);
|
tlMixParamViscosity_.resize(numMiscRegions);
|
||||||
tlMixParamDensity_.resize(numMiscRegions);
|
tlMixParamDensity_.resize(numMiscRegions);
|
||||||
|
|
||||||
assert(numMiscRegions == deck.getKeyword("TLMIXPAR").size());
|
const auto& tlmixparTable = eclState.getTableManager().getTlmixparTable();
|
||||||
|
|
||||||
|
assert(numMiscRegions == tlmixparTable.size());
|
||||||
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numMiscRegions; ++regionIdx) {
|
||||||
const auto& tlmixparRecord = deck.getKeyword("TLMIXPAR").getRecord(regionIdx);
|
// Copy data
|
||||||
const auto& mixParamsViscosityItem = tlmixparRecord.getItem("TL_VISCOSITY_PARAMETER");
|
tlMixParamViscosity_[regionIdx] = tlmixparTable[regionIdx].viscosity;
|
||||||
const auto& mixParamsDensityItem = tlmixparRecord.getItem("TL_DENSITY_PARAMETER");
|
if (tlmixparTable[regionIdx].density == 0.0)
|
||||||
|
|
||||||
if (mixParamsViscosityItem.hasValue(0))
|
|
||||||
tlMixParamViscosity_[regionIdx] = mixParamsViscosityItem.getSIDouble(0);
|
|
||||||
else
|
|
||||||
throw std::invalid_argument("The TL_VISCOSITY parameter can not be defaulted");
|
|
||||||
|
|
||||||
if (mixParamsDensityItem.hasValue(0))
|
|
||||||
tlMixParamDensity_[regionIdx] = mixParamsDensityItem.getSIDouble(0);
|
|
||||||
else
|
|
||||||
tlMixParamDensity_[regionIdx] = tlMixParamViscosity_[regionIdx];
|
tlMixParamDensity_[regionIdx] = tlMixParamViscosity_[regionIdx];
|
||||||
|
else
|
||||||
|
tlMixParamDensity_[regionIdx] = tlmixparTable[regionIdx].density;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user