mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-10-12 08:54:53 -05:00
Black Oil model: implement support for multi-region PVT tables
this requires opm-material commit 12a6d1f
This commit is contained in:
1 parent
6f9eb5a29c
commit
06501bb851
2 files changed
+49
-23
No files matched your search
@@ -883,9 +883,9 @@ protected:
|
|||||||
// chosen the correct fluid system. Currently,
|
// chosen the correct fluid system. Currently,
|
||||||
// only Opm::FluidSystems::BlackOil is supported,
|
// only Opm::FluidSystems::BlackOil is supported,
|
||||||
// sorry...
|
// sorry...
|
||||||
Scalar rhoOilSurface = FluidSystem::surfaceDensity(oilPhaseIdx);
|
Scalar rhoOilSurface = FluidSystem::surfaceDensity(oilPhaseIdx, /*regionIdx=*/0);
|
||||||
Scalar rhoGasSurface = FluidSystem::surfaceDensity(gasPhaseIdx);
|
Scalar rhoGasSurface = FluidSystem::surfaceDensity(gasPhaseIdx, /*regionIdx=*/0);
|
||||||
Scalar rhoWaterSurface = FluidSystem::surfaceDensity(waterPhaseIdx);
|
Scalar rhoWaterSurface = FluidSystem::surfaceDensity(waterPhaseIdx, /*regionIdx=*/0);
|
||||||
|
|
||||||
// oil
|
// oil
|
||||||
surfaceRates[oilPhaseIdx] =
|
surfaceRates[oilPhaseIdx] =
|
||||||
|
|||||||
@@ -391,6 +391,27 @@ public:
|
|||||||
return materialParams_[tableIdx];
|
return materialParams_[tableIdx];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Returns the index of the relevant region for thermodynmic properties
|
||||||
|
*/
|
||||||
|
template <class Context>
|
||||||
|
int pvtRegionIndex(const Context &context, int spaceIdx, int timeIdx) const
|
||||||
|
{
|
||||||
|
Opm::DeckConstPtr deck = this->simulator().gridManager().deck();
|
||||||
|
|
||||||
|
if (!deck->hasKeyword("PVTNUM"))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
const auto &grid = this->simulator().gridManager().grid();
|
||||||
|
|
||||||
|
// this is quite specific to the ECFV discretization. But so is everything in an
|
||||||
|
// ECL deck, i.e., we don't need to care here...
|
||||||
|
int compressedDofIdx = context.globalSpaceIndex(spaceIdx, timeIdx);
|
||||||
|
int cartesianDofIdx = grid.globalCell()[compressedDofIdx];
|
||||||
|
|
||||||
|
return deck->getKeyword("PVTNUM")->getIntData()[cartesianDofIdx] - 1;
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \name Problem parameters
|
* \name Problem parameters
|
||||||
*/
|
*/
|
||||||
@@ -649,21 +670,26 @@ private:
|
|||||||
|
|
||||||
FluidSystem::initBegin();
|
FluidSystem::initBegin();
|
||||||
|
|
||||||
// set the reference densities
|
int numRegions = deck->getKeyword("DENSITY")->size();
|
||||||
Opm::DeckRecordConstPtr densityRecord = deck->getKeyword("DENSITY")->getRecord(0);
|
for (int regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
|
||||||
FluidSystem::setSurfaceDensities(densityRecord->getItem("OIL")->getSIDouble(0),
|
// set the reference densities
|
||||||
densityRecord->getItem("WATER")->getSIDouble(0),
|
Opm::DeckRecordConstPtr densityRecord =
|
||||||
densityRecord->getItem("GAS")->getSIDouble(0));
|
deck->getKeyword("DENSITY")->getRecord(regionIdx);
|
||||||
|
FluidSystem::setSurfaceDensities(densityRecord->getItem("OIL")->getSIDouble(0),
|
||||||
|
densityRecord->getItem("WATER")->getSIDouble(0),
|
||||||
|
densityRecord->getItem("GAS")->getSIDouble(0),
|
||||||
|
regionIdx);
|
||||||
|
|
||||||
// so far, we require the presence of the PVTO, PVTW and PVDG
|
// so far, we require the presence of the PVTO, PVTW and PVDG
|
||||||
// keywords...
|
// keywords...
|
||||||
Opm::PvtoTable pvtoTable(deck->getKeyword("PVTO"), /*tableIdx=*/0);
|
Opm::PvtoTable pvtoTable(deck->getKeyword("PVTO"), regionIdx);
|
||||||
Opm::PvtwTable pvtwTable(deck->getKeyword("PVTW"));
|
Opm::PvtwTable pvtwTable(deck->getKeyword("PVTW"), regionIdx);
|
||||||
Opm::PvdgTable pvdgTable(deck->getKeyword("PVDG"));
|
Opm::PvdgTable pvdgTable(deck->getKeyword("PVDG"), regionIdx);
|
||||||
|
|
||||||
FluidSystem::setPvtoTable(pvtoTable);
|
FluidSystem::setPvtoTable(pvtoTable, regionIdx);
|
||||||
FluidSystem::setPvtwTable(pvtwTable);
|
FluidSystem::setPvtwTable(pvtwTable, regionIdx);
|
||||||
FluidSystem::setPvdgTable(pvdgTable);
|
FluidSystem::setPvdgTable(pvdgTable, regionIdx);
|
||||||
|
}
|
||||||
|
|
||||||
FluidSystem::initEnd();
|
FluidSystem::initEnd();
|
||||||
}
|
}
|
||||||
@@ -673,10 +699,6 @@ private:
|
|||||||
const auto deck = this->simulator().gridManager().deck();
|
const auto deck = this->simulator().gridManager().deck();
|
||||||
const auto &grid = this->simulator().gridManager().grid();
|
const auto &grid = this->simulator().gridManager().grid();
|
||||||
|
|
||||||
size_t numDof = this->model().numDof();
|
|
||||||
|
|
||||||
initialFluidStates_.resize(numDof);
|
|
||||||
|
|
||||||
if (!deck->hasKeyword("SWAT") ||
|
if (!deck->hasKeyword("SWAT") ||
|
||||||
!deck->hasKeyword("SGAS"))
|
!deck->hasKeyword("SGAS"))
|
||||||
OPM_THROW(std::runtime_error,
|
OPM_THROW(std::runtime_error,
|
||||||
@@ -702,6 +724,10 @@ private:
|
|||||||
OPM_THROW(std::runtime_error,
|
OPM_THROW(std::runtime_error,
|
||||||
"The Eclipse input file requires the RV keyword to be non-present");
|
"The Eclipse input file requires the RV keyword to be non-present");
|
||||||
|
|
||||||
|
size_t numDof = this->model().numDof();
|
||||||
|
|
||||||
|
initialFluidStates_.resize(numDof);
|
||||||
|
|
||||||
const std::vector<double> &waterSaturationData =
|
const std::vector<double> &waterSaturationData =
|
||||||
deck->getKeyword("SWAT")->getSIDoubleData();
|
deck->getKeyword("SWAT")->getSIDoubleData();
|
||||||
const std::vector<double> &gasSaturationData =
|
const std::vector<double> &gasSaturationData =
|
||||||
@@ -772,7 +798,7 @@ private:
|
|||||||
//
|
//
|
||||||
// first, retrieve the relevant black-oil parameters from
|
// first, retrieve the relevant black-oil parameters from
|
||||||
// the fluid system.
|
// the fluid system.
|
||||||
Scalar RsSat = FluidSystem::gasDissolutionFactor(oilPressure);
|
Scalar RsSat = FluidSystem::gasDissolutionFactor(oilPressure, /*regionIdx=*/0);
|
||||||
Scalar RsReal = rsData[cartesianDofIdx];
|
Scalar RsReal = rsData[cartesianDofIdx];
|
||||||
|
|
||||||
if (RsReal > RsSat) {
|
if (RsReal > RsSat) {
|
||||||
@@ -789,8 +815,8 @@ private:
|
|||||||
|
|
||||||
// calculate composition of the real and the saturated oil phase in terms of
|
// calculate composition of the real and the saturated oil phase in terms of
|
||||||
// mass fractions.
|
// mass fractions.
|
||||||
Scalar rhooRef = FluidSystem::surfaceDensity(oilPhaseIdx);
|
Scalar rhooRef = FluidSystem::surfaceDensity(oilPhaseIdx, /*regionIdx=*/0);
|
||||||
Scalar rhogRef = FluidSystem::surfaceDensity(gasPhaseIdx);
|
Scalar rhogRef = FluidSystem::surfaceDensity(gasPhaseIdx, /*regionIdx=*/0);
|
||||||
Scalar XoGReal = RsReal*rhogRef / (RsReal*rhogRef + rhooRef);
|
Scalar XoGReal = RsReal*rhogRef / (RsReal*rhogRef + rhooRef);
|
||||||
|
|
||||||
// convert mass to mole fractions
|
// convert mass to mole fractions
|
||||||
|
|||||||
Reference in new issue
Block a user