modified density calculation to include oil vapor and dissolved gas
This commit is contained in:
parent
25adfda7d9
commit
dcc6eb2e0c
@ -160,6 +160,13 @@ public:
|
|||||||
gasJTRefPres_[regionIdx] = record.P0;
|
gasJTRefPres_[regionIdx] = record.P0;
|
||||||
gasJTC_[regionIdx] = record.C1;
|
gasJTC_[regionIdx] = record.C1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto& densityTable = eclState.getTableManager().getDensityTable();
|
||||||
|
|
||||||
|
assert(densityTable.size() == numRegions);
|
||||||
|
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
|
||||||
|
rhoRefO_[regionIdx] = densityTable[regionIdx].oil;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enableInternalEnergy_) {
|
if (enableInternalEnergy_) {
|
||||||
@ -214,6 +221,7 @@ public:
|
|||||||
gasdentCT2_.resize(numRegions);
|
gasdentCT2_.resize(numRegions);
|
||||||
gasJTRefPres_.resize(numRegions);
|
gasJTRefPres_.resize(numRegions);
|
||||||
gasJTC_.resize(numRegions);
|
gasJTC_.resize(numRegions);
|
||||||
|
rhoRefO_.resize(numRegions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -269,7 +277,7 @@ public:
|
|||||||
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rv);
|
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rv);
|
||||||
const Scalar hVap = 480.6e3; // [J / kg]
|
const Scalar hVap = 480.6e3; // [J / kg]
|
||||||
Evaluation Cp = (internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true) - hVap)/temperature;
|
Evaluation Cp = (internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true) - hVap)/temperature;
|
||||||
Evaluation density = invB * gasReferenceDensity(regionIdx);
|
Evaluation density = invB * (gasReferenceDensity(regionIdx) + Rv * rhoRefO_[regionIdx]);
|
||||||
|
|
||||||
Evaluation enthalpyPres;
|
Evaluation enthalpyPres;
|
||||||
if (JTC != 0) {
|
if (JTC != 0) {
|
||||||
@ -287,7 +295,9 @@ public:
|
|||||||
Evaluation enthalpyPresPrev = 0;
|
Evaluation enthalpyPresPrev = 0;
|
||||||
for (size_t i = 0; i < N; ++i) {
|
for (size_t i = 0; i < N; ++i) {
|
||||||
Evaluation Pnew = Pref + i * deltaP;
|
Evaluation Pnew = Pref + i * deltaP;
|
||||||
Evaluation rho = inverseFormationVolumeFactor(regionIdx, temperature, Pnew, Rv) * gasReferenceDensity(regionIdx);
|
Evaluation rho = inverseFormationVolumeFactor(regionIdx, temperature, Pnew, Rv) *
|
||||||
|
(gasReferenceDensity(regionIdx) + Rv * rhoRefO_[regionIdx]);
|
||||||
|
// see e.g.https://en.wikipedia.org/wiki/Joule-Thomson_effect for a derivation of the Joule-Thomson coeff.
|
||||||
Evaluation jouleThomsonCoefficient = -(1.0/Cp) * (1.0 - alpha * temperature)/rho;
|
Evaluation jouleThomsonCoefficient = -(1.0/Cp) * (1.0 - alpha * temperature)/rho;
|
||||||
Evaluation deltaEnthalpyPres = -Cp * jouleThomsonCoefficient * deltaP;
|
Evaluation deltaEnthalpyPres = -Cp * jouleThomsonCoefficient * deltaP;
|
||||||
enthalpyPres = enthalpyPresPrev + deltaEnthalpyPres;
|
enthalpyPres = enthalpyPresPrev + deltaEnthalpyPres;
|
||||||
@ -545,6 +555,8 @@ private:
|
|||||||
std::vector<Scalar> gasJTRefPres_;
|
std::vector<Scalar> gasJTRefPres_;
|
||||||
std::vector<Scalar> gasJTC_;
|
std::vector<Scalar> gasJTC_;
|
||||||
|
|
||||||
|
std::vector<Scalar> rhoRefO_;
|
||||||
|
|
||||||
// piecewise linear curve representing the internal energy of gas
|
// piecewise linear curve representing the internal energy of gas
|
||||||
std::vector<TabulatedOneDFunction> internalEnergyCurves_;
|
std::vector<TabulatedOneDFunction> internalEnergyCurves_;
|
||||||
|
|
||||||
|
@ -185,6 +185,13 @@ public:
|
|||||||
oilJTRefPres_[regionIdx] = record.P0;
|
oilJTRefPres_[regionIdx] = record.P0;
|
||||||
oilJTC_[regionIdx] = record.C1;
|
oilJTC_[regionIdx] = record.C1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto& densityTable = eclState.getTableManager().getDensityTable();
|
||||||
|
|
||||||
|
assert(densityTable.size() == numRegions);
|
||||||
|
for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
|
||||||
|
rhoRefG_[regionIdx] = densityTable[regionIdx].gas;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enableInternalEnergy_) {
|
if (enableInternalEnergy_) {
|
||||||
@ -235,6 +242,7 @@ public:
|
|||||||
oildentCT2_.resize(numRegions);
|
oildentCT2_.resize(numRegions);
|
||||||
oilJTRefPres_.resize(numRegions);
|
oilJTRefPres_.resize(numRegions);
|
||||||
oilJTC_.resize(numRegions);
|
oilJTC_.resize(numRegions);
|
||||||
|
rhoRefG_.resize(numRegions);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -289,7 +297,7 @@ public:
|
|||||||
|
|
||||||
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rs);
|
Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rs);
|
||||||
Evaluation Cp = internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true)/temperature;
|
Evaluation Cp = internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true)/temperature;
|
||||||
Evaluation density = invB * oilReferenceDensity(regionIdx);
|
Evaluation density = invB * (oilReferenceDensity(regionIdx) + Rs * rhoRefG_[regionIdx]);
|
||||||
|
|
||||||
Evaluation enthalpyPres;
|
Evaluation enthalpyPres;
|
||||||
if (JTC != 0) {
|
if (JTC != 0) {
|
||||||
@ -307,7 +315,9 @@ public:
|
|||||||
Evaluation enthalpyPresPrev = 0;
|
Evaluation enthalpyPresPrev = 0;
|
||||||
for (size_t i = 0; i < N; ++i) {
|
for (size_t i = 0; i < N; ++i) {
|
||||||
Evaluation Pnew = Pref + i * deltaP;
|
Evaluation Pnew = Pref + i * deltaP;
|
||||||
Evaluation rho = inverseFormationVolumeFactor(regionIdx, temperature, Pnew, Rs) * oilReferenceDensity(regionIdx);
|
Evaluation rho = inverseFormationVolumeFactor(regionIdx, temperature, Pnew, Rs) *
|
||||||
|
(oilReferenceDensity(regionIdx) + Rs * rhoRefG_[regionIdx]) ;
|
||||||
|
// see e.g.https://en.wikipedia.org/wiki/Joule-Thomson_effect for a derivation of the Joule-Thomson coeff.
|
||||||
Evaluation jouleThomsonCoefficient = -(1.0/Cp) * (1.0 - alpha * temperature)/rho;
|
Evaluation jouleThomsonCoefficient = -(1.0/Cp) * (1.0 - alpha * temperature)/rho;
|
||||||
Evaluation deltaEnthalpyPres = -Cp * jouleThomsonCoefficient * deltaP;
|
Evaluation deltaEnthalpyPres = -Cp * jouleThomsonCoefficient * deltaP;
|
||||||
enthalpyPres = enthalpyPresPrev + deltaEnthalpyPres;
|
enthalpyPres = enthalpyPresPrev + deltaEnthalpyPres;
|
||||||
@ -564,6 +574,8 @@ private:
|
|||||||
std::vector<Scalar> oilJTRefPres_;
|
std::vector<Scalar> oilJTRefPres_;
|
||||||
std::vector<Scalar> oilJTC_;
|
std::vector<Scalar> oilJTC_;
|
||||||
|
|
||||||
|
std::vector<Scalar> rhoRefG_;
|
||||||
|
|
||||||
// piecewise linear curve representing the internal energy of oil
|
// piecewise linear curve representing the internal energy of oil
|
||||||
std::vector<TabulatedOneDFunction> internalEnergyCurves_;
|
std::vector<TabulatedOneDFunction> internalEnergyCurves_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user