changed: lessen deck usage setting up BlackoilFluidSystem
This commit is contained in:
parent
7f749723e5
commit
2c270cb4f3
@ -40,6 +40,12 @@
|
|||||||
#include <opm/material/common/HasMemberGeneratorMacros.hpp>
|
#include <opm/material/common/HasMemberGeneratorMacros.hpp>
|
||||||
#include <opm/material/common/Exceptions.hpp>
|
#include <opm/material/common/Exceptions.hpp>
|
||||||
|
|
||||||
|
#if HAVE_ECL_INPUT
|
||||||
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <array>
|
#include <array>
|
||||||
@ -177,24 +183,25 @@ public:
|
|||||||
*/
|
*/
|
||||||
static void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
static void initFromDeck(const Deck& deck, const EclipseState& eclState)
|
||||||
{
|
{
|
||||||
auto densityKeyword = deck.getKeyword("DENSITY");
|
const auto& densityTable = eclState.getTableManager().getDensityTable();
|
||||||
size_t numRegions = densityKeyword.size();
|
size_t numRegions = densityTable.size();
|
||||||
initBegin(numRegions);
|
initBegin(numRegions);
|
||||||
|
|
||||||
numActivePhases_ = 0;
|
numActivePhases_ = 0;
|
||||||
std::fill_n(&phaseIsActive_[0], numPhases, false);
|
std::fill_n(&phaseIsActive_[0], numPhases, false);
|
||||||
|
|
||||||
if (deck.hasKeyword("OIL")) {
|
|
||||||
|
if (eclState.runspec().phases().active(Phase::OIL)) {
|
||||||
phaseIsActive_[oilPhaseIdx] = true;
|
phaseIsActive_[oilPhaseIdx] = true;
|
||||||
++ numActivePhases_;
|
++ numActivePhases_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deck.hasKeyword("GAS")) {
|
if (eclState.runspec().phases().active(Phase::GAS)) {
|
||||||
phaseIsActive_[gasPhaseIdx] = true;
|
phaseIsActive_[gasPhaseIdx] = true;
|
||||||
++ numActivePhases_;
|
++ numActivePhases_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (deck.hasKeyword("WATER")) {
|
if (eclState.runspec().phases().active(Phase::WATER)) {
|
||||||
phaseIsActive_[waterPhaseIdx] = true;
|
phaseIsActive_[waterPhaseIdx] = true;
|
||||||
++ numActivePhases_;
|
++ numActivePhases_;
|
||||||
}
|
}
|
||||||
@ -214,15 +221,14 @@ public:
|
|||||||
// this fluidsystem only supports two or three phases
|
// this fluidsystem only supports two or three phases
|
||||||
assert(numActivePhases_ >= 1 && numActivePhases_ <= 3);
|
assert(numActivePhases_ >= 1 && numActivePhases_ <= 3);
|
||||||
|
|
||||||
setEnableDissolvedGas(deck.hasKeyword("DISGAS"));
|
setEnableDissolvedGas(eclState.getSimulationConfig().hasDISGAS());
|
||||||
setEnableVaporizedOil(deck.hasKeyword("VAPOIL"));
|
setEnableVaporizedOil(eclState.getSimulationConfig().hasVAPOIL());
|
||||||
|
|
||||||
// set the reference densities of all PVT regions
|
// set the reference densities of all PVT regions
|
||||||
for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
|
for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
|
||||||
const auto& densityRecord = densityKeyword.getRecord(regionIdx);
|
setReferenceDensities(densityTable[regionIdx].oil,
|
||||||
setReferenceDensities(densityRecord.getItem("OIL").getSIDouble(0),
|
densityTable[regionIdx].water,
|
||||||
densityRecord.getItem("WATER").getSIDouble(0),
|
densityTable[regionIdx].gas,
|
||||||
densityRecord.getItem("GAS").getSIDouble(0),
|
|
||||||
regionIdx);
|
regionIdx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user