mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
adapt to the simplifications of the blackoil PVT API in opm-material
This commit is contained in:
@@ -833,132 +833,9 @@ private:
|
||||
const auto deck = this->simulator().gridManager().deck();
|
||||
const auto eclState = this->simulator().gridManager().eclState();
|
||||
|
||||
auto densityKeyword = deck->getKeyword("DENSITY");
|
||||
int numRegions = densityKeyword->size();
|
||||
FluidSystem::initBegin(numRegions);
|
||||
|
||||
FluidSystem::setEnableDissolvedGas(deck->hasKeyword("DISGAS"));
|
||||
FluidSystem::setEnableVaporizedOil(deck->hasKeyword("VAPOIL"));
|
||||
|
||||
// set the reference densities of all PVT regions
|
||||
for (int regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
|
||||
Opm::DeckRecordConstPtr densityRecord = densityKeyword->getRecord(regionIdx);
|
||||
FluidSystem::setReferenceDensities(densityRecord->getItem("OIL")->getSIDouble(0),
|
||||
densityRecord->getItem("WATER")->getSIDouble(0),
|
||||
densityRecord->getItem("GAS")->getSIDouble(0),
|
||||
regionIdx);
|
||||
}
|
||||
|
||||
typedef std::shared_ptr<const Opm::GasPvtInterface<Scalar, Evaluation> > GasPvtSharedPtr;
|
||||
GasPvtSharedPtr gasPvt(createGasPvt_(deck, eclState));
|
||||
FluidSystem::setGasPvt(gasPvt);
|
||||
|
||||
typedef std::shared_ptr<const Opm::OilPvtInterface<Scalar, Evaluation> > OilPvtSharedPtr;
|
||||
OilPvtSharedPtr oilPvt(createOilPvt_(deck, eclState));
|
||||
FluidSystem::setOilPvt(oilPvt);
|
||||
|
||||
typedef std::shared_ptr<const Opm::WaterPvtInterface<Scalar, Evaluation> > WaterPvtSharedPtr;
|
||||
WaterPvtSharedPtr waterPvt(createWaterPvt_(deck, eclState));
|
||||
FluidSystem::setWaterPvt(waterPvt);
|
||||
|
||||
FluidSystem::initEnd();
|
||||
FluidSystem::initFromDeck(deck, eclState);
|
||||
}
|
||||
|
||||
Opm::OilPvtInterface<Scalar, Evaluation>* createOilPvt_(Opm::DeckConstPtr deck,
|
||||
Opm::EclipseStateConstPtr eclState)
|
||||
{
|
||||
const auto tableManager = eclState->getTableManager();
|
||||
Opm::DeckKeywordConstPtr densityKeyword = deck->getKeyword("DENSITY");
|
||||
int numPvtRegions = densityKeyword->size();
|
||||
|
||||
if (deck->hasKeyword("PVTO")) {
|
||||
Opm::LiveOilPvt<Scalar, Evaluation> *oilPvt = new Opm::LiveOilPvt<Scalar, Evaluation>;
|
||||
oilPvt->setNumRegions(numPvtRegions);
|
||||
|
||||
for (int regionIdx = 0; regionIdx < numPvtRegions; ++regionIdx)
|
||||
oilPvt->setPvtoTable(regionIdx, tableManager->getPvtoTables()[regionIdx]);
|
||||
|
||||
oilPvt->initEnd();
|
||||
return oilPvt;
|
||||
}
|
||||
else if (deck->hasKeyword("PVDO")) {
|
||||
Opm::DeadOilPvt<Scalar, Evaluation> *oilPvt = new Opm::DeadOilPvt<Scalar, Evaluation>;
|
||||
oilPvt->setNumRegions(numPvtRegions);
|
||||
|
||||
for (int regionIdx = 0; regionIdx < numPvtRegions; ++regionIdx)
|
||||
oilPvt->setPvdoTable(regionIdx, tableManager->getPvdoTables()[regionIdx]);
|
||||
|
||||
oilPvt->initEnd();
|
||||
return oilPvt;
|
||||
}
|
||||
else if (deck->hasKeyword("PVCDO")) {
|
||||
Opm::ConstantCompressibilityOilPvt<Scalar, Evaluation> *oilPvt =
|
||||
new Opm::ConstantCompressibilityOilPvt<Scalar, Evaluation>;
|
||||
oilPvt->setNumRegions(numPvtRegions);
|
||||
|
||||
for (int regionIdx = 0; regionIdx < numPvtRegions; ++regionIdx)
|
||||
oilPvt->setPvcdo(regionIdx, deck->getKeyword("PVCDO"));
|
||||
|
||||
oilPvt->initEnd();
|
||||
return oilPvt;
|
||||
}
|
||||
// TODO (?): PVCO (this is not very hard but the opm-parser requires support for
|
||||
// an additional table)
|
||||
|
||||
OPM_THROW(std::logic_error, "Not implemented: Oil PVT of this deck!");
|
||||
}
|
||||
|
||||
Opm::GasPvtInterface<Scalar, Evaluation>* createGasPvt_(Opm::DeckConstPtr deck,
|
||||
Opm::EclipseStateConstPtr eclState)
|
||||
{
|
||||
Opm::DeckKeywordConstPtr densityKeyword = deck->getKeyword("DENSITY");
|
||||
const auto tableManager = eclState->getTableManager();
|
||||
int numPvtRegions = densityKeyword->size();
|
||||
|
||||
if (deck->hasKeyword("PVTG")) {
|
||||
Opm::WetGasPvt<Scalar, Evaluation> *gasPvt = new Opm::WetGasPvt<Scalar, Evaluation>;
|
||||
gasPvt->setNumRegions(numPvtRegions);
|
||||
|
||||
for (int regionIdx = 0; regionIdx < numPvtRegions; ++regionIdx)
|
||||
gasPvt->setPvtgTable(regionIdx, tableManager->getPvtgTables()[regionIdx]);
|
||||
|
||||
gasPvt->initEnd();
|
||||
return gasPvt;
|
||||
}
|
||||
else if (deck->hasKeyword("PVDG")) {
|
||||
Opm::DryGasPvt<Scalar, Evaluation> *gasPvt = new Opm::DryGasPvt<Scalar, Evaluation>;
|
||||
gasPvt->setNumRegions(numPvtRegions);
|
||||
|
||||
for (int regionIdx = 0; regionIdx < numPvtRegions; ++regionIdx)
|
||||
gasPvt->setPvdgTable(regionIdx, tableManager->getPvdgTables()[regionIdx]);
|
||||
|
||||
gasPvt->initEnd();
|
||||
return gasPvt;
|
||||
}
|
||||
OPM_THROW(std::logic_error, "Not implemented: Gas PVT of this deck!");
|
||||
}
|
||||
|
||||
Opm::WaterPvtInterface<Scalar, Evaluation>* createWaterPvt_(Opm::DeckConstPtr deck,
|
||||
Opm::EclipseStateConstPtr eclState)
|
||||
{
|
||||
Opm::DeckKeywordConstPtr densityKeyword = deck->getKeyword("DENSITY");
|
||||
int numPvtRegions = densityKeyword->size();
|
||||
|
||||
if (deck->hasKeyword("PVTW")) {
|
||||
Opm::ConstantCompressibilityWaterPvt<Scalar, Evaluation> *waterPvt =
|
||||
new Opm::ConstantCompressibilityWaterPvt<Scalar, Evaluation>;
|
||||
waterPvt->setNumRegions(numPvtRegions);
|
||||
|
||||
for (int regionIdx = 0; regionIdx < numPvtRegions; ++regionIdx)
|
||||
waterPvt->setPvtw(regionIdx, deck->getKeyword("PVTW"));
|
||||
|
||||
waterPvt->initEnd();
|
||||
return waterPvt;
|
||||
}
|
||||
|
||||
OPM_THROW(std::logic_error, "Not implemented: Water PVT of this deck!");
|
||||
}
|
||||
|
||||
void readInitialCondition_()
|
||||
{
|
||||
const auto &gridManager = this->simulator().gridManager();
|
||||
|
||||
Reference in New Issue
Block a user